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

Correctly use base weight in the fastdg case

parent ca219931
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,9 @@ class BaseWeight(FunctionIdentifier): ...@@ -50,6 +50,9 @@ class BaseWeight(FunctionIdentifier):
def name(self): def name(self):
return '{}.weight'.format(self.accumobj) return '{}.weight'.format(self.accumobj)
def operations(self):
return 0
@function_mangler @function_mangler
def base_weight_function_mangler(target, func, dtypes): def base_weight_function_mangler(target, func, dtypes):
...@@ -61,9 +64,11 @@ def pymbolic_base_weight(): ...@@ -61,9 +64,11 @@ def pymbolic_base_weight():
""" This is the base weight that should be multiplied to the quadrature """ This is the base weight that should be multiplied to the quadrature
weight. With the fast DG assembler this will handle the weighting of the weight. With the fast DG assembler this will handle the weighting of the
time discretization scheme. time discretization scheme.
TODO: Introduce backend switch that uses above BaseWeight function
""" """
return 1.0 if get_form_option("fastdg"):
return prim.Call(BaseWeight(name_accumulation_variable()), ())
else:
return 1.0
def default_quadrature_inames(visitor): def default_quadrature_inames(visitor):
...@@ -172,8 +177,11 @@ def quadrature_weight(visitor): ...@@ -172,8 +177,11 @@ def quadrature_weight(visitor):
element = None element = None
else: else:
element = info.element element = info.element
return prim.Subscript(lp.symbolic.TaggedVariable(name, "operator_precomputed"),
tuple(prim.Variable(i) for i in quadrature_inames(element))) ret = prim.Subscript(lp.symbolic.TaggedVariable(name, "operator_precomputed"),
tuple(prim.Variable(i) for i in quadrature_inames(element)))
return prim.Product((pymbolic_base_weight(), ret))
def define_quadrature_position(name, local_index): def define_quadrature_position(name, local_index):
......
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