Skip to content
Snippets Groups Projects
Commit c755fd28 authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

Restore staggered index convention

According to the documentation, 0 is W and 1 is S
parent 10fe510f
Branches
Tags
1 merge request!88fix minor regressions introduced with !86
Pipeline #19956 passed
...@@ -483,7 +483,7 @@ class Field(AbstractField): ...@@ -483,7 +483,7 @@ class Field(AbstractField):
for i, o in enumerate(offset): for i, o in enumerate(offset):
if (o + sp.Rational(1, 2)).is_Integer: if (o + sp.Rational(1, 2)).is_Integer:
offset[i] += sp.Rational(1, 2) offset[i] += sp.Rational(1, 2)
neighbor[i] = 1 neighbor[i] = -1
neighbor = offset_to_direction_string(neighbor) neighbor = offset_to_direction_string(neighbor)
try: try:
idx = self.staggered_stencil.index(neighbor) idx = self.staggered_stencil.index(neighbor)
...@@ -515,14 +515,14 @@ class Field(AbstractField): ...@@ -515,14 +515,14 @@ class Field(AbstractField):
assert FieldType.is_staggered(self) assert FieldType.is_staggered(self)
stencils = { stencils = {
2: { 2: {
2: ["E", "N"], # D2Q5 2: ["W", "S"], # D2Q5
4: ["E", "N", "NE", "SE"] # D2Q9 4: ["W", "S", "SW", "NW"] # D2Q9
}, },
3: { 3: {
3: ["E", "N", "T"], # D3Q7 3: ["W", "S", "B"], # D3Q7
7: ["E", "N", "T", "TNE", "BNE", "TSE", "BSE "], # D3Q15 7: ["W", "S", "B", "BSW", "TSW", "BNW", "TNW"], # D3Q15
9: ["E", "N", "T", "NE", "SE", "TE", "BE", "TN", "BN"], # D3Q19 9: ["W", "S", "B", "SW", "NW", "BW", "TW", "BS", "TS"], # D3Q19
13: ["E", "N", "T", "NE", "SE", "TE", "BE", "TN", "BN", "TNE", "BNE", "TSE", "BSE"] # D3Q27 13: ["W", "S", "B", "SW", "NW", "BW", "TW", "BS", "TS", "BSW", "TSW", "BNW", "TNW"] # D3Q27
} }
} }
if not self.index_shape[0] in stencils[self.spatial_dimensions]: if not self.index_shape[0] in stencils[self.spatial_dimensions]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment