Closed stephankramer closed 4 years ago
Try this patch in pyop2?
diff --git a/pyop2/codegen/builder.py b/pyop2/codegen/builder.py
index 81811ea8..cbb2b111 100644
--- a/pyop2/codegen/builder.py
+++ b/pyop2/codegen/builder.py
@@ -702,8 +702,6 @@ class WrapperBuilder(object):
def _layer_index(self):
if self.constant_layers:
return FixedIndex(0)
- if self.subset:
- return self._loop_index
else:
return self.loop_index
That works - magic!
Do you mind preparing a test?
Thanks! Sure, will do
The following code
sets up an extruded domain for the ocean under an iceshelf (2d vertical slice, flat bottom, left boundary of 2m, right boundary of 42m, with sloping top boundary). The first three boundary integrals (bottom, top and lhs) are calculated correctly. The last one comes out incorrectly (giving 4 instead of the expected 42) where it seems that the rhs boundary only has 2 vertical facets (the same as in the first column on the left) instead of 22 vertical facets. This is confirmed by looking at something like
solve(v*u*dx-v*Constant(1.0)*ds_v(2, domain=mesh)==0, u)
with a DG Functionu
and TestFunctionv
, where the solution only appears in the bottom right corner. If I look at boundary nodes usingDirichletBC
it does come up with the correct nodes along the rhs boundary.