Skip to content

Commit

Permalink
k
Browse files Browse the repository at this point in the history
  • Loading branch information
ksagiyam committed Apr 17, 2024
1 parent 5b66b45 commit 8a0bcc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/test_mixed_function_space_with_mixed_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_mixed_function_space_with_mixed_mesh_restrictions_base():
assert len(integral_data.domain_integral_type_map) == 2
assert integral_data.domain_integral_type_map[mesh0] == "interior_facet"
assert integral_data.domain_integral_type_map[mesh1] == "exterior_facet"
# e
# c
form = div(f) * inner(grad(f1), grad(f1)) * inner(grad(u1), grad(v0)) * dx1
form_data = compute_form_data(form, do_split_coefficients={f: [f0_split, f1_split]})
integral_data, = form_data.integral_data
Expand Down Expand Up @@ -89,7 +89,7 @@ def test_mixed_function_space_with_mixed_mesh_3_cg3_bdm3_dg2_dx1():
assert integral_data.domain_integral_type_map[mesh1] == "cell"
assert integral_data.domain_integral_type_map[mesh2] == "cell"
kernel, = compile_form(form)
assert kernel.domain_number == 1
assert kernel.domain_number == 0
assert kernel.integral_type == "cell"
assert kernel.subdomain_id == (999, )
assert kernel.active_domain_numbers.coordinates == (0, 1, 2)
Expand Down Expand Up @@ -199,14 +199,14 @@ def test_mixed_function_space_with_mixed_mesh_restrictions_dg2_dg3_ds1():
assert integral_data.domain_integral_type_map[mesh0] == "interior_facet"
assert integral_data.domain_integral_type_map[mesh1] == "exterior_facet"
kernel, = compile_form(form)
assert kernel.domain_number == 1
assert kernel.domain_number == 0
assert kernel.integral_type == "exterior_facet"
assert kernel.subdomain_id == (777, )
assert kernel.active_domain_numbers.coordinates == (0, 1)
assert kernel.active_domain_numbers.cell_orientations == ()
assert kernel.active_domain_numbers.cell_sizes == ()
assert kernel.active_domain_numbers.exterior_facets == (1, )
assert kernel.active_domain_numbers.interior_facets == (0, )
assert kernel.active_domain_numbers.exterior_facets == (0, )
assert kernel.active_domain_numbers.interior_facets == (1, )
assert kernel.coefficient_numbers == ((0, (0, 1)), )
assert isinstance(kernel.arguments[0], kernel_args.OutputKernelArg)
assert isinstance(kernel.arguments[1], kernel_args.CoordinatesKernelArg)
Expand All @@ -216,8 +216,8 @@ def test_mixed_function_space_with_mixed_mesh_restrictions_dg2_dg3_ds1():
assert isinstance(kernel.arguments[5], kernel_args.ExteriorFacetKernelArg)
assert isinstance(kernel.arguments[6], kernel_args.InteriorFacetKernelArg)
assert kernel.arguments[0].loopy_arg.shape == (10, 2 * 6)
assert kernel.arguments[1].loopy_arg.shape == (2 * (3 * gdim), )
assert kernel.arguments[2].loopy_arg.shape == (3 * gdim, )
assert kernel.arguments[1].loopy_arg.shape == (1 * (3 * gdim), )
assert kernel.arguments[2].loopy_arg.shape == (2 * (3 * gdim), )
assert kernel.arguments[3].loopy_arg.shape == (2 * 6, )
assert kernel.arguments[4].loopy_arg.shape == (10, )
assert kernel.arguments[5].loopy_arg.shape == (1, )
Expand Down
2 changes: 2 additions & 0 deletions tsfc/ufl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def compute_form_data(form,
do_apply_restrictions=True,
do_estimate_degrees=True,
do_split_coefficients=None,
do_assume_single_integral_type=False,
complex_mode=False):
"""Preprocess UFL form in a format suitable for TSFC. Return
form data.
Expand All @@ -67,6 +68,7 @@ def compute_form_data(form,
do_apply_restrictions=do_apply_restrictions,
do_estimate_degrees=do_estimate_degrees,
do_split_coefficients=do_split_coefficients,
do_assume_single_integral_type=do_assume_single_integral_type,
complex_mode=complex_mode
)
constants = extract_firedrake_constants(form)
Expand Down

0 comments on commit 8a0bcc6

Please sign in to comment.