Skip to content

Commit

Permalink
#110: Test for h-enrichment error
Browse files Browse the repository at this point in the history
  • Loading branch information
jwallwork23 committed Feb 28, 2024
1 parent 8334e6a commit feab3bd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test_adjoint/test_mesh_seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,21 @@ def test_num_enrichments_error(self):
msg = "A positive number of enrichments is required."
self.assertEqual(str(cm.exception), msg)

def test_h_enrichment_error(self):
end_time = 1.0
num_subintervals = 2
dt = end_time / num_subintervals
mesh_seq = GoalOrientedMeshSeq(
TimePartition(end_time, num_subintervals, dt, "field"),
[UnitTriangleMesh()] * num_subintervals,
get_qoi=self.constant_qoi,
qoi_type="end_time",
)
with self.assertRaises(ValueError) as cm:
mesh_seq.get_enriched_mesh_seq(enrichment_method="h")
msg = "h-enrichment is not supported for shallow-copied meshes."
self.assertEqual(str(cm.exception), msg)

@parameterized.expand([[1], [2]])
def test_h_enrichment_mesh(self, num_enrichments):
"""
Expand Down

0 comments on commit feab3bd

Please sign in to comment.