Skip to content

Commit

Permalink
Get value_shape from function spaces (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddundo authored Nov 17, 2024
1 parent b458ccd commit cf7161b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test_adjoint/test_mesh_seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,11 +431,13 @@ def test_h_enrichment_space(self, family, degree, rank):
mesh_seq_e = mesh_seq.get_enriched_mesh_seq(
enrichment_method="h", num_enrichments=1
)
element = mesh_seq.function_spaces[self.field][0].ufl_element()
enriched_element = mesh_seq_e.function_spaces[self.field][0].ufl_element()
fspace = mesh_seq.function_spaces[self.field][0]
element = fspace.ufl_element()
enriched_fspace = mesh_seq_e.function_spaces[self.field][0]
enriched_element = enriched_fspace.ufl_element()
self.assertEqual(element.family(), enriched_element.family())
self.assertEqual(element.degree(), enriched_element.degree())
self.assertEqual(element.value_shape, enriched_element.value_shape)
self.assertEqual(fspace.value_shape, enriched_fspace.value_shape)

def test_p_enrichment_mesh(self):
mesh_seq = self.go_mesh_seq(self.get_function_spaces_decorator("CG", 1, 0))
Expand Down Expand Up @@ -468,11 +470,13 @@ def test_p_enrichment_space(self, family, degree, rank, num_enrichments):
mesh_seq_e = mesh_seq.get_enriched_mesh_seq(
enrichment_method="p", num_enrichments=num_enrichments
)
element = mesh_seq.function_spaces[self.field][0].ufl_element()
enriched_element = mesh_seq_e.function_spaces[self.field][0].ufl_element()
fspace = mesh_seq.function_spaces[self.field][0]
element = fspace.ufl_element()
enriched_fspace = mesh_seq_e.function_spaces[self.field][0]
enriched_element = enriched_fspace.ufl_element()
self.assertEqual(element.family(), enriched_element.family())
self.assertEqual(element.degree() + num_enrichments, enriched_element.degree())
self.assertEqual(element.value_shape, enriched_element.value_shape)
self.assertEqual(fspace.value_shape, enriched_fspace.value_shape)

@parameterized.expand(
[
Expand Down

0 comments on commit cf7161b

Please sign in to comment.