diff --git a/examples/cube/cube_periodic.json b/examples/cube/cube_periodic.json index e38f1d5c6..cd3f48c28 100644 --- a/examples/cube/cube_periodic.json +++ b/examples/cube/cube_periodic.json @@ -40,12 +40,12 @@ { "Periodic": { - "OriginalAttributes": [1, 2], - "DuplicateAttributes": [6, 4] + "OriginalAttributes": [3, 5], + "DuplicateAttributes": [4, 6] }, "PEC": { - "Attributes": [3, 5] + "Attributes": [1, 2] } }, "Solver": diff --git a/examples/cube/mesh/cube_periodic.geo b/examples/cube/mesh/cube_periodic.geo new file mode 100644 index 000000000..bee7eb5fa --- /dev/null +++ b/examples/cube/mesh/cube_periodic.geo @@ -0,0 +1,38 @@ +// Periodic hexahedral cube mesh + +Point(1) = {0, 0, 0, 1.0}; +Point(2) = {1, 0, 0, 1.0}; +Point(3) = {1, 1, 0, 1.0}; +Point(4) = {0, 1, 0, 1.0}; + +Characteristic Length {:} = 0.25; + +Line(1) = {1, 2}; +Line(2) = {2, 3}; +Line(3) = {3, 4}; +Line(4) = {4, 1}; + +//Periodic Curve {1} = {-3}; +//Periodic Curve {2} = {-4}; + +Curve Loop(1) = {1, 2, 3, 4}; +Plane Surface(1) = {1}; +Transfinite Surface {1}; + +Recombine Surface {1}; +out[] = Extrude {0, 0, 1} { Surface{1}; Layers{4}; Recombine; }; + +Physical Volume(1) = {out[1]}; +Physical Surface(1) = {1}; // back +Physical Surface(2) = {out[5]}; // front +Physical Surface(3) = {out[4]}; // left +Physical Surface(4) = {out[2]}; // right +Physical Surface(5) = {out[0]}; // bottom +Physical Surface(6) = {out[3]}; // top + +Mesh 3; +Mesh.MshFileVersion = 2.2; + +//Periodic Surface {out[0]} = {1} Translate {0, 0, 1}; // No periodicity in the z-direction (back & front) +Periodic Surface {out[4]} = {out[2]} Translate {0, 1, 0}; // left and right +Periodic Surface {out[3]} = {out[5]} Translate {1, 0, 0}; // bottom and top diff --git a/examples/cube/mesh/cube_periodic.msh b/examples/cube/mesh/cube_periodic.msh new file mode 100644 index 000000000..d5befd516 --- /dev/null +++ b/examples/cube/mesh/cube_periodic.msh @@ -0,0 +1,353 @@ +$MeshFormat +2.2 0 8 +$EndMeshFormat +$Nodes +125 +1 0 0 0 +2 1 0 0 +3 1 1 0 +4 0 1 0 +5 0 0 1 +6 1 0 1 +7 1 1 1 +8 0 1 1 +9 0.2499999999994121 0 0 +10 0.499999999998694 0 0 +11 0.7499999999993416 0 0 +12 1 0.2500000000010404 0 +13 1 0.5000000000020591 0 +14 1 0.7500000000003465 0 +15 0.7499999999993416 1 0 +16 0.499999999998694 1 0 +17 0.2499999999994121 1 0 +18 0 0.7500000000003465 0 +19 0 0.5000000000020591 0 +20 0 0.2500000000010404 0 +21 0.2499999999994121 0 1 +22 0.499999999998694 0 1 +23 0.7499999999993416 0 1 +24 1 0.2500000000010404 1 +25 1 0.5000000000020591 1 +26 1 0.7500000000003465 1 +27 0.7499999999993416 1 1 +28 0.499999999998694 1 1 +29 0.2499999999994121 1 1 +30 0 0.7500000000003465 1 +31 0 0.5000000000020591 1 +32 0 0.2500000000010404 1 +33 0 0 0.25 +34 0 0 0.5 +35 0 0 0.75 +36 1 0 0.25 +37 1 0 0.5 +38 1 0 0.75 +39 1 1 0.25 +40 1 1 0.5 +41 1 1 0.75 +42 0 1 0.25 +43 0 1 0.5 +44 0 1 0.75 +45 0.2499999999998191 0.2500000000006334 0 +46 0.2500000000002262 0.5000000000012177 0 +47 0.2500000000006333 0.7500000000000953 0 +48 0.4999999999995353 0.2500000000002262 0 +49 0.5000000000003766 0.5000000000003766 0 +50 0.5000000000012179 0.7499999999998441 0 +51 0.7499999999995928 0.2499999999998191 0 +52 0.7499999999998441 0.4999999999995353 0 +53 0.7500000000000953 0.7499999999995928 0 +54 0.2499999999994121 0 0.25 +55 0.2499999999994121 0 0.5 +56 0.2499999999994121 0 0.75 +57 0.499999999998694 0 0.25 +58 0.499999999998694 0 0.5 +59 0.499999999998694 0 0.75 +60 0.7499999999993416 0 0.25 +61 0.7499999999993416 0 0.5 +62 0.7499999999993416 0 0.75 +63 1 0.2500000000010404 0.25 +64 1 0.2500000000010404 0.5 +65 1 0.2500000000010404 0.75 +66 1 0.5000000000020591 0.25 +67 1 0.5000000000020591 0.5 +68 1 0.5000000000020591 0.75 +69 1 0.7500000000003465 0.25 +70 1 0.7500000000003465 0.5 +71 1 0.7500000000003465 0.75 +72 0.7499999999993416 1 0.25 +73 0.7499999999993416 1 0.5 +74 0.7499999999993416 1 0.75 +75 0.499999999998694 1 0.25 +76 0.499999999998694 1 0.5 +77 0.499999999998694 1 0.75 +78 0.2499999999994121 1 0.25 +79 0.2499999999994121 1 0.5 +80 0.2499999999994121 1 0.75 +81 0 0.7500000000003465 0.25 +82 0 0.7500000000003465 0.5 +83 0 0.7500000000003465 0.75 +84 0 0.5000000000020591 0.25 +85 0 0.5000000000020591 0.5 +86 0 0.5000000000020591 0.75 +87 0 0.2500000000010404 0.25 +88 0 0.2500000000010404 0.5 +89 0 0.2500000000010404 0.75 +90 0.2499999999998191 0.2500000000006334 1 +91 0.2500000000002262 0.5000000000012177 1 +92 0.2500000000006333 0.7500000000000953 1 +93 0.4999999999995353 0.2500000000002262 1 +94 0.5000000000003766 0.5000000000003766 1 +95 0.5000000000012179 0.7499999999998441 1 +96 0.7499999999995928 0.2499999999998191 1 +97 0.7499999999998441 0.4999999999995353 1 +98 0.7500000000000953 0.7499999999995928 1 +99 0.2499999999998191 0.2500000000006334 0.25 +100 0.2499999999998191 0.2500000000006334 0.5 +101 0.2499999999998191 0.2500000000006334 0.75 +102 0.2500000000002262 0.5000000000012177 0.25 +103 0.2500000000002262 0.5000000000012177 0.5 +104 0.2500000000002262 0.5000000000012177 0.75 +105 0.2500000000006333 0.7500000000000953 0.25 +106 0.2500000000006333 0.7500000000000953 0.5 +107 0.2500000000006333 0.7500000000000953 0.75 +108 0.4999999999995353 0.2500000000002262 0.25 +109 0.4999999999995353 0.2500000000002262 0.5 +110 0.4999999999995353 0.2500000000002262 0.75 +111 0.5000000000003766 0.5000000000003766 0.25 +112 0.5000000000003766 0.5000000000003766 0.5 +113 0.5000000000003766 0.5000000000003766 0.75 +114 0.5000000000012179 0.7499999999998441 0.25 +115 0.5000000000012179 0.7499999999998441 0.5 +116 0.5000000000012179 0.7499999999998441 0.75 +117 0.7499999999995928 0.2499999999998191 0.25 +118 0.7499999999995928 0.2499999999998191 0.5 +119 0.7499999999995928 0.2499999999998191 0.75 +120 0.7499999999998441 0.4999999999995353 0.25 +121 0.7499999999998441 0.4999999999995353 0.5 +122 0.7499999999998441 0.4999999999995353 0.75 +123 0.7500000000000953 0.7499999999995928 0.25 +124 0.7500000000000953 0.7499999999995928 0.5 +125 0.7500000000000953 0.7499999999995928 0.75 +$EndNodes +$Elements +160 +1 3 2 1 1 1 9 45 20 +2 3 2 1 1 20 45 46 19 +3 3 2 1 1 19 46 47 18 +4 3 2 1 1 18 47 17 4 +5 3 2 1 1 9 10 48 45 +6 3 2 1 1 45 48 49 46 +7 3 2 1 1 46 49 50 47 +8 3 2 1 1 47 50 16 17 +9 3 2 1 1 10 11 51 48 +10 3 2 1 1 48 51 52 49 +11 3 2 1 1 49 52 53 50 +12 3 2 1 1 50 53 15 16 +13 3 2 1 1 11 2 12 51 +14 3 2 1 1 51 12 13 52 +15 3 2 1 1 52 13 14 53 +16 3 2 1 1 53 14 3 15 +17 3 2 4 13 1 9 54 33 +18 3 2 4 13 33 54 55 34 +19 3 2 4 13 34 55 56 35 +20 3 2 4 13 35 56 21 5 +21 3 2 4 13 9 10 57 54 +22 3 2 4 13 54 57 58 55 +23 3 2 4 13 55 58 59 56 +24 3 2 4 13 56 59 22 21 +25 3 2 4 13 10 11 60 57 +26 3 2 4 13 57 60 61 58 +27 3 2 4 13 58 61 62 59 +28 3 2 4 13 59 62 23 22 +29 3 2 4 13 11 2 36 60 +30 3 2 4 13 60 36 37 61 +31 3 2 4 13 61 37 38 62 +32 3 2 4 13 62 38 6 23 +33 3 2 6 17 2 12 63 36 +34 3 2 6 17 36 63 64 37 +35 3 2 6 17 37 64 65 38 +36 3 2 6 17 38 65 24 6 +37 3 2 6 17 12 13 66 63 +38 3 2 6 17 63 66 67 64 +39 3 2 6 17 64 67 68 65 +40 3 2 6 17 65 68 25 24 +41 3 2 6 17 13 14 69 66 +42 3 2 6 17 66 69 70 67 +43 3 2 6 17 67 70 71 68 +44 3 2 6 17 68 71 26 25 +45 3 2 6 17 14 3 39 69 +46 3 2 6 17 69 39 40 70 +47 3 2 6 17 70 40 41 71 +48 3 2 6 17 71 41 7 26 +49 3 2 3 21 3 15 72 39 +50 3 2 3 21 39 72 73 40 +51 3 2 3 21 40 73 74 41 +52 3 2 3 21 41 74 27 7 +53 3 2 3 21 15 16 75 72 +54 3 2 3 21 72 75 76 73 +55 3 2 3 21 73 76 77 74 +56 3 2 3 21 74 77 28 27 +57 3 2 3 21 16 17 78 75 +58 3 2 3 21 75 78 79 76 +59 3 2 3 21 76 79 80 77 +60 3 2 3 21 77 80 29 28 +61 3 2 3 21 17 4 42 78 +62 3 2 3 21 78 42 43 79 +63 3 2 3 21 79 43 44 80 +64 3 2 3 21 80 44 8 29 +65 3 2 2 25 4 18 81 42 +66 3 2 2 25 42 81 82 43 +67 3 2 2 25 43 82 83 44 +68 3 2 2 25 44 83 30 8 +69 3 2 2 25 18 19 84 81 +70 3 2 2 25 81 84 85 82 +71 3 2 2 25 82 85 86 83 +72 3 2 2 25 83 86 31 30 +73 3 2 2 25 19 20 87 84 +74 3 2 2 25 84 87 88 85 +75 3 2 2 25 85 88 89 86 +76 3 2 2 25 86 89 32 31 +77 3 2 2 25 20 1 33 87 +78 3 2 2 25 87 33 34 88 +79 3 2 2 25 88 34 35 89 +80 3 2 2 25 89 35 5 32 +81 3 2 5 26 5 21 90 32 +82 3 2 5 26 32 90 91 31 +83 3 2 5 26 31 91 92 30 +84 3 2 5 26 30 92 29 8 +85 3 2 5 26 21 22 93 90 +86 3 2 5 26 90 93 94 91 +87 3 2 5 26 91 94 95 92 +88 3 2 5 26 92 95 28 29 +89 3 2 5 26 22 23 96 93 +90 3 2 5 26 93 96 97 94 +91 3 2 5 26 94 97 98 95 +92 3 2 5 26 95 98 27 28 +93 3 2 5 26 23 6 24 96 +94 3 2 5 26 96 24 25 97 +95 3 2 5 26 97 25 26 98 +96 3 2 5 26 98 26 7 27 +97 5 2 1 1 1 9 45 20 33 54 99 87 +98 5 2 1 1 33 54 99 87 34 55 100 88 +99 5 2 1 1 34 55 100 88 35 56 101 89 +100 5 2 1 1 35 56 101 89 5 21 90 32 +101 5 2 1 1 20 45 46 19 87 99 102 84 +102 5 2 1 1 87 99 102 84 88 100 103 85 +103 5 2 1 1 88 100 103 85 89 101 104 86 +104 5 2 1 1 89 101 104 86 32 90 91 31 +105 5 2 1 1 19 46 47 18 84 102 105 81 +106 5 2 1 1 84 102 105 81 85 103 106 82 +107 5 2 1 1 85 103 106 82 86 104 107 83 +108 5 2 1 1 86 104 107 83 31 91 92 30 +109 5 2 1 1 18 47 17 4 81 105 78 42 +110 5 2 1 1 81 105 78 42 82 106 79 43 +111 5 2 1 1 82 106 79 43 83 107 80 44 +112 5 2 1 1 83 107 80 44 30 92 29 8 +113 5 2 1 1 9 10 48 45 54 57 108 99 +114 5 2 1 1 54 57 108 99 55 58 109 100 +115 5 2 1 1 55 58 109 100 56 59 110 101 +116 5 2 1 1 56 59 110 101 21 22 93 90 +117 5 2 1 1 45 48 49 46 99 108 111 102 +118 5 2 1 1 99 108 111 102 100 109 112 103 +119 5 2 1 1 100 109 112 103 101 110 113 104 +120 5 2 1 1 101 110 113 104 90 93 94 91 +121 5 2 1 1 46 49 50 47 102 111 114 105 +122 5 2 1 1 102 111 114 105 103 112 115 106 +123 5 2 1 1 103 112 115 106 104 113 116 107 +124 5 2 1 1 104 113 116 107 91 94 95 92 +125 5 2 1 1 47 50 16 17 105 114 75 78 +126 5 2 1 1 105 114 75 78 106 115 76 79 +127 5 2 1 1 106 115 76 79 107 116 77 80 +128 5 2 1 1 107 116 77 80 92 95 28 29 +129 5 2 1 1 10 11 51 48 57 60 117 108 +130 5 2 1 1 57 60 117 108 58 61 118 109 +131 5 2 1 1 58 61 118 109 59 62 119 110 +132 5 2 1 1 59 62 119 110 22 23 96 93 +133 5 2 1 1 48 51 52 49 108 117 120 111 +134 5 2 1 1 108 117 120 111 109 118 121 112 +135 5 2 1 1 109 118 121 112 110 119 122 113 +136 5 2 1 1 110 119 122 113 93 96 97 94 +137 5 2 1 1 49 52 53 50 111 120 123 114 +138 5 2 1 1 111 120 123 114 112 121 124 115 +139 5 2 1 1 112 121 124 115 113 122 125 116 +140 5 2 1 1 113 122 125 116 94 97 98 95 +141 5 2 1 1 50 53 15 16 114 123 72 75 +142 5 2 1 1 114 123 72 75 115 124 73 76 +143 5 2 1 1 115 124 73 76 116 125 74 77 +144 5 2 1 1 116 125 74 77 95 98 27 28 +145 5 2 1 1 11 2 12 51 60 36 63 117 +146 5 2 1 1 60 36 63 117 61 37 64 118 +147 5 2 1 1 61 37 64 118 62 38 65 119 +148 5 2 1 1 62 38 65 119 23 6 24 96 +149 5 2 1 1 51 12 13 52 117 63 66 120 +150 5 2 1 1 117 63 66 120 118 64 67 121 +151 5 2 1 1 118 64 67 121 119 65 68 122 +152 5 2 1 1 119 65 68 122 96 24 25 97 +153 5 2 1 1 52 13 14 53 120 66 69 123 +154 5 2 1 1 120 66 69 123 121 67 70 124 +155 5 2 1 1 121 67 70 124 122 68 71 125 +156 5 2 1 1 122 68 71 125 97 25 26 98 +157 5 2 1 1 53 14 3 15 123 69 39 72 +158 5 2 1 1 123 69 39 72 124 70 40 73 +159 5 2 1 1 124 70 40 73 125 71 41 74 +160 5 2 1 1 125 71 41 74 98 26 7 27 +$EndElements +$Periodic +2 +2 17 25 +Affine 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 1 +25 +2 1 +3 4 +6 5 +7 8 +12 20 +13 19 +14 18 +24 32 +25 31 +26 30 +36 33 +37 34 +38 35 +39 42 +40 43 +41 44 +63 87 +64 88 +65 89 +66 84 +67 85 +68 86 +69 81 +70 82 +71 83 +2 21 13 +Affine 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 1 +25 +3 2 +4 1 +7 6 +8 5 +15 11 +16 10 +17 9 +27 23 +28 22 +29 21 +39 36 +40 37 +41 38 +42 33 +43 34 +44 35 +72 60 +73 61 +74 62 +75 57 +76 58 +77 59 +78 54 +79 55 +80 56 +$EndPeriodic