Skip to content
Snippets Groups Projects
Commit 3cb3511c authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Implement sumfact_multilinear Geometry Mixin

parent eada9b38
No related branches found
No related tags found
No related merge requests found
Showing with 199 additions and 418 deletions
...@@ -113,7 +113,7 @@ class CodegenFormOptionsArray(ImmutableRecord): ...@@ -113,7 +113,7 @@ class CodegenFormOptionsArray(ImmutableRecord):
geometry_mixins = CodegenOption(default="generic", helpstr="A comma separated list of mixin identifiers to use for geometries. Currently implemented mixins: generic, axiparallel, equidistant, sumfact_multilinear, sumfact_axiparallel, sumfact_equidistant") geometry_mixins = CodegenOption(default="generic", helpstr="A comma separated list of mixin identifiers to use for geometries. Currently implemented mixins: generic, axiparallel, equidistant, sumfact_multilinear, sumfact_axiparallel, sumfact_equidistant")
quadrature_mixins = CodegenOption(default="generic", helpstr="A comma separated list of mixin identifiers to use for quadrature. Currently implemented: generic, sumfact") quadrature_mixins = CodegenOption(default="generic", helpstr="A comma separated list of mixin identifiers to use for quadrature. Currently implemented: generic, sumfact")
basis_mixins = CodegenOption(default="generic", helpstr="A comma separated list of mixin identifiers to use for basis function evaluation. Currently implemented: generic, sumfact") basis_mixins = CodegenOption(default="generic", helpstr="A comma separated list of mixin identifiers to use for basis function evaluation. Currently implemented: generic, sumfact")
accumulation_mixins = CodegenOption(default="generic", helpstr="A comma separated list of mixin identifiers to use for accumulation. Currently implemented: generic") accumulation_mixins = CodegenOption(default="generic", helpstr="A comma separated list of mixin identifiers to use for accumulation. Currently implemented: generic, sumfact")
enable_volume = CodegenOption(default=True, helpstr="Whether to assemble volume integrals") enable_volume = CodegenOption(default=True, helpstr="Whether to assemble volume integrals")
enable_skeleton = CodegenOption(default=True, helpstr="Whether to assemble skeleton integrals") enable_skeleton = CodegenOption(default=True, helpstr="Whether to assemble skeleton integrals")
enable_boundary = CodegenOption(default=True, helpstr="Whether to assemble boundary integrals") enable_boundary = CodegenOption(default=True, helpstr="Whether to assemble boundary integrals")
......
...@@ -20,19 +20,6 @@ class PDELabInterface(object): ...@@ -20,19 +20,6 @@ class PDELabInterface(object):
# The visitor instance will be registered by its init method # The visitor instance will be registered by its init method
self.visitor = None self.visitor = None
# Accumulation interfaces
def get_accumulation_info(self, expr, visitor):
from dune.codegen.pdelab.localoperator import get_accumulation_info
return get_accumulation_info(expr, visitor)
def list_accumulation_infos(self, expr, visitor):
from dune.codegen.pdelab.localoperator import list_accumulation_infos
return list_accumulation_infos(expr, visitor)
def generate_accumulation_instruction(self, expr, visitor):
from dune.codegen.pdelab.localoperator import generate_accumulation_instruction
return generate_accumulation_instruction(expr, visitor)
# #
# TODO: The following ones are actually entirely PDELab independent! # TODO: The following ones are actually entirely PDELab independent!
# They should be placed elsewhere and be used directly in the visitor. # They should be placed elsewhere and be used directly in the visitor.
......
This diff is collapsed.
...@@ -141,15 +141,6 @@ def base_weight_function_mangler(target, func, dtypes): ...@@ -141,15 +141,6 @@ def base_weight_function_mangler(target, func, dtypes):
return CallMangleInfo(func.name, (NumpyType(dtype_floatingpoint()),), ()) return CallMangleInfo(func.name, (NumpyType(dtype_floatingpoint()),), ())
def default_quadrature_inames(visitor):
info = visitor.current_info[1]
if info is None:
element = None
else:
element = info.element
return quadrature_inames(element)
@kernel_cached @kernel_cached
def _quadrature_inames(element): def _quadrature_inames(element):
if element is None: if element is None:
...@@ -193,8 +184,7 @@ def additional_inames(visitor): ...@@ -193,8 +184,7 @@ def additional_inames(visitor):
restriction = Restriction.NONE restriction = Restriction.NONE
if get_global_context_value("integral_type") == "interior_facet": if get_global_context_value("integral_type") == "interior_facet":
restriction = Restriction.POSITIVE restriction = Restriction.POSITIVE
from dune.codegen.sumfact.basis import lfs_inames lfs_inames = visitor.lfs_inames(element, restriction)
lfs_inames = lfs_inames(element, restriction)
return lfs_inames return lfs_inames
else: else:
return () return ()
...@@ -56,14 +56,14 @@ class UFL2LoopyVisitor(ModifiedTerminalTracker): ...@@ -56,14 +56,14 @@ class UFL2LoopyVisitor(ModifiedTerminalTracker):
return self._call(o, do_predicates) return self._call(o, do_predicates)
def accumulate(self, o): def accumulate(self, o):
for info in self.interface.list_accumulation_infos(o, self): for info in self.list_accumulation_infos(o):
self.current_info = info self.current_info = info
expr = self._call(o, False) expr = self._call(o, False)
if expr != 0: if expr != 0:
if get_form_option("simplify"): if get_form_option("simplify"):
from dune.codegen.sympy import simplify_pymbolic_expression from dune.codegen.sympy import simplify_pymbolic_expression
expr = simplify_pymbolic_expression(expr) expr = simplify_pymbolic_expression(expr)
self.interface.generate_accumulation_instruction(expr, self) self.generate_accumulation_instruction(expr)
def _call(self, o, do_predicates): def _call(self, o, do_predicates):
# Reset state variables # Reset state variables
...@@ -96,7 +96,7 @@ class UFL2LoopyVisitor(ModifiedTerminalTracker): ...@@ -96,7 +96,7 @@ class UFL2LoopyVisitor(ModifiedTerminalTracker):
def argument(self, o): def argument(self, o):
self.interface.initialize_function_spaces(o, self) self.interface.initialize_function_spaces(o, self)
# Update the information on where to accumulate this # Update the information on where to accumulate this
info = self.interface.get_accumulation_info(o, self) info = self.get_accumulation_info(o)
if o.number() == 0: if o.number() == 0:
if info != self.current_info[0]: if info != self.current_info[0]:
self.indices = None self.indices = None
......
...@@ -30,6 +30,7 @@ numerical_jacobian = 1, 0 | expand num ...@@ -30,6 +30,7 @@ numerical_jacobian = 1, 0 | expand num
sumfact = 1 sumfact = 1
vectorization_quadloop = 1, 0 | expand quad vectorization_quadloop = 1, 0 | expand quad
vectorization_strategy = explicit, none | expand grad vectorization_strategy = explicit, none | expand grad
geometry_mixins = sumfact_multilinear
[formcompiler.ufl_variants] [formcompiler.ufl_variants]
degree = 1, 2 | expand deg degree = 1, 2 | expand deg
...@@ -30,6 +30,7 @@ numerical_jacobian = 1, 0 | expand num ...@@ -30,6 +30,7 @@ numerical_jacobian = 1, 0 | expand num
sumfact = 1 sumfact = 1
vectorization_quadloop = 1, 0 | expand quad vectorization_quadloop = 1, 0 | expand quad
vectorization_strategy = explicit, none | expand grad vectorization_strategy = explicit, none | expand grad
geometry_mixins = sumfact_multilinear
[formcompiler.ufl_variants] [formcompiler.ufl_variants]
degree = 1, 2 | expand deg degree = 1, 2 | expand deg
...@@ -29,6 +29,7 @@ sumfact = 1 ...@@ -29,6 +29,7 @@ sumfact = 1
sumfact_regular_jacobians = 1 sumfact_regular_jacobians = 1
vectorization_quadloop = 1, 0 | expand quad vectorization_quadloop = 1, 0 | expand quad
vectorization_strategy = explicit, none | expand grad vectorization_strategy = explicit, none | expand grad
geometry_mixins = sumfact_multilinear
[formcompiler.ufl_variants] [formcompiler.ufl_variants]
degree = 1, 2 | expand deg degree = 1, 2 | expand deg
...@@ -30,6 +30,7 @@ numerical_jacobian = 1, 0 | expand num ...@@ -30,6 +30,7 @@ numerical_jacobian = 1, 0 | expand num
sumfact = 1 sumfact = 1
vectorization_quadloop = 1, 0 | expand quad vectorization_quadloop = 1, 0 | expand quad
vectorization_strategy = explicit, none | expand grad vectorization_strategy = explicit, none | expand grad
geometry_mixins = sumfact_multilinear
[formcompiler.ufl_variants] [formcompiler.ufl_variants]
degree = 1, 2 | expand deg degree = 1, 2 | expand deg
...@@ -31,6 +31,7 @@ sumfact = 1 ...@@ -31,6 +31,7 @@ sumfact = 1
sumfact_regular_jacobians = 1 sumfact_regular_jacobians = 1
vectorization_quadloop = 1, 0 | expand quad vectorization_quadloop = 1, 0 | expand quad
vectorization_strategy = explicit, none | expand grad vectorization_strategy = explicit, none | expand grad
geometry_mixins = sumfact_multilinear
[formcompiler.ufl_variants] [formcompiler.ufl_variants]
degree = 1, 2 | expand deg degree = 1, 2 | expand deg
...@@ -31,6 +31,7 @@ sumfact = 1 ...@@ -31,6 +31,7 @@ sumfact = 1
sumfact_regular_jacobians = 1 sumfact_regular_jacobians = 1
vectorization_quadloop = 1, 0 | expand quad vectorization_quadloop = 1, 0 | expand quad
vectorization_strategy = explicit, none | expand grad vectorization_strategy = explicit, none | expand grad
geometry_mixins = sumfact_multilinear
[formcompiler.ufl_variants] [formcompiler.ufl_variants]
degree = 1, 2 | expand deg degree = 1, 2 | expand deg
...@@ -30,6 +30,7 @@ fastdg = 1 ...@@ -30,6 +30,7 @@ fastdg = 1
sumfact_regular_jacobians = 1 sumfact_regular_jacobians = 1
vectorization_quadloop = 1, 0 | expand quad vectorization_quadloop = 1, 0 | expand quad
vectorization_strategy = explicit, none | expand grad vectorization_strategy = explicit, none | expand grad
geometry_mixins = sumfact_multilinear
[formcompiler.ufl_variants] [formcompiler.ufl_variants]
degree = 1, 2 | expand deg degree = 1, 2 | expand deg
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment