diff --git a/demo/macro/macro.square.2d b/demo/macro/macro.square.2d
new file mode 100644
index 0000000000000000000000000000000000000000..7d310bfbb624959589f9fa057df7154400383bed
--- /dev/null
+++ b/demo/macro/macro.square.2d
@@ -0,0 +1,47 @@
+DIM: 2
+DIM_OF_WORLD: 2
+
+number of elements: 8
+number of vertices: 9
+
+vertex coordinates:
+-1 -1 
+0 -1 
+1 -1 
+-1 0 
+0 0 
+1 0 
+-1 1 
+0 1 
+1 1 
+
+element vertices:
+0 4 3
+4 0 1
+1 5 4
+5 1 2
+3 7 6
+7 3 4
+4 8 7
+8 4 5
+
+element boundaries:
+0 1 0
+3 0 0
+0 0 0
+3 2 0
+4 1 0
+0 0 0
+4 0 0
+0 2 0
+
+element neighbours:
+5 -1 1
+-1 2 0
+7 1 3
+-1 -1 2
+-1 -1 5
+0 6 4
+-1 5 7
+2 -1 6
+
diff --git a/demo/macro/periodic.square.2d b/demo/macro/periodic.square.2d
new file mode 100644
index 0000000000000000000000000000000000000000..a375d8bc5bbad1921408f3aad336f3b9bff8c119
--- /dev/null
+++ b/demo/macro/periodic.square.2d
@@ -0,0 +1,47 @@
+DIM: 2
+DIM_OF_WORLD: 2
+
+number of elements: 8
+number of vertices: 9
+
+vertex coordinates:
+-1 -1 
+0 -1 
+1 -1 
+-1 0 
+0 0 
+1 0 
+-1 1 
+0 1 
+1 1 
+
+element vertices:
+0 4 3
+4 0 1
+1 5 4
+5 1 2
+3 7 6
+7 3 4
+4 8 7
+8 4 5
+
+element boundaries:
+0 -1 0
+-2 0 0
+0 0 0
+-2 -1 0
+-2 -1 0
+0 0 0
+-2 0 0
+0 -1 0
+
+element neighbours:
+5 3 1
+4 2 0
+7 1 3
+6 0 2
+1 7 5
+0 6 4
+3 5 7
+2 4 6
+
diff --git a/demo/macro/periodic.square.2d.563774.tmp b/demo/macro/periodic.square.2d.563774.tmp
new file mode 100644
index 0000000000000000000000000000000000000000..a72743fad8b5938eacdcf55502bf060e0045aaad
--- /dev/null
+++ b/demo/macro/periodic.square.2d.563774.tmp
@@ -0,0 +1,236 @@
+DIM: 2
+DIM_OF_WORLD: 2
+
+number of vertices: 25
+number of elements: 32
+
+vertex coordinates:
+-1.000000e+00 -1.000000e+00 
+0.000000e+00 -1.000000e+00 
+1.000000e+00 -1.000000e+00 
+-1.000000e+00 0.000000e+00 
+0.000000e+00 0.000000e+00 
+1.000000e+00 0.000000e+00 
+-1.000000e+00 1.000000e+00 
+0.000000e+00 1.000000e+00 
+1.000000e+00 1.000000e+00 
+-5.000000e-01 -5.000000e-01 
+5.000000e-01 -5.000000e-01 
+-1.000000e+00 -5.000000e-01 
+1.000000e+00 -5.000000e-01 
+-5.000000e-01 5.000000e-01 
+-5.000000e-01 0.000000e+00 
+0.000000e+00 -5.000000e-01 
+-5.000000e-01 -1.000000e+00 
+-5.000000e-01 1.000000e+00 
+5.000000e-01 5.000000e-01 
+5.000000e-01 0.000000e+00 
+5.000000e-01 -1.000000e+00 
+5.000000e-01 1.000000e+00 
+-1.000000e+00 5.000000e-01 
+1.000000e+00 5.000000e-01 
+0.000000e+00 5.000000e-01 
+
+element vertices:
+9 3 11 
+0 9 11 
+9 4 14 
+3 9 14 
+9 1 15 
+4 9 15 
+9 0 16 
+1 9 16 
+10 4 15 
+1 10 15 
+10 5 19 
+4 10 19 
+10 2 12 
+5 10 12 
+10 1 20 
+2 10 20 
+13 6 22 
+3 13 22 
+13 7 17 
+6 13 17 
+13 4 24 
+7 13 24 
+13 3 14 
+4 13 14 
+18 7 24 
+4 18 24 
+18 8 21 
+7 18 21 
+18 5 23 
+8 18 23 
+18 4 19 
+5 18 19 
+
+element boundaries:
+-1 0 0 
+0 -1 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+-2 0 0 
+0 -2 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+-1 0 0 
+0 -1 0 
+-2 0 0 
+0 -2 0 
+-1 0 0 
+0 -1 0 
+-2 0 0 
+0 -2 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+-2 0 0 
+0 -2 0 
+-1 0 0 
+0 -1 0 
+0 0 0 
+0 0 0 
+
+element neighbours:
+13 1 3 
+0 12 6 
+23 3 5 
+2 22 0 
+9 5 7 
+4 8 2 
+19 7 1 
+6 18 4 
+5 9 11 
+8 4 14 
+31 11 13 
+10 30 8 
+1 13 15 
+12 0 10 
+27 15 9 
+14 26 12 
+29 17 19 
+16 28 22 
+7 19 21 
+18 6 16 
+25 21 23 
+20 24 18 
+3 23 17 
+22 2 20 
+21 25 27 
+24 20 30 
+15 27 29 
+26 14 24 
+17 29 31 
+28 16 26 
+11 31 25 
+30 10 28 
+
+projections:
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+0 0 0 
+
+element region:
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+-1
+
+surface region:
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
+-1 -1 -1 
diff --git a/demo/macro/periodic.square.per b/demo/macro/periodic.square.per
new file mode 100644
index 0000000000000000000000000000000000000000..7ef1932da299b3974fa19f9ca674c47b4e4775e3
--- /dev/null
+++ b/demo/macro/periodic.square.per
@@ -0,0 +1,7 @@
+associations: 4
+
+mode  bc  el1 - local vertices <->  el2 - local vertices
+ 1   -1   0      2 0       3   0 2 
+ 1   -1   4      2 0       7   0 2 
+ 1   -2   1      2 1       4   1 2 
+ 1   -2   3      2 1       6   1 2 
diff --git a/demo/macro/periodic.square.per.563774.tmp b/demo/macro/periodic.square.per.563774.tmp
new file mode 100644
index 0000000000000000000000000000000000000000..17b9ef55c4a64e239cd816f2800eb6c9550febe8
--- /dev/null
+++ b/demo/macro/periodic.square.per.563774.tmp
@@ -0,0 +1,11 @@
+associations: 8
+
+mode  bc  el1 - local vertices <->  el2 - local vertices
+1 -1 0 1 2 13 0 2 
+1 -1 1 0 2 12 1 2 
+1 -2 6 1 2 19 0 2 
+1 -2 7 0 2 18 1 2 
+1 -2 14 1 2 27 0 2 
+1 -2 15 0 2 26 1 2 
+1 -1 16 1 2 29 0 2 
+1 -1 17 0 2 28 1 2