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

Add additional shape information to basis evaluation.

Even if the basis scalar, it is worth to put a shape of (n, 1),
because that is how PDELab thinks about it. Not doing so can have
you end up with mismatches between `Dune::FieldVector<double, 1>` and `double`.
parent 889db4dd
No related branches found
No related tags found
No related merge requests found
......@@ -92,7 +92,7 @@ def declare_cache_temporary(element, restriction, which):
@kernel_cached
def evaluate_basis(leaf_element, name, restriction):
lfs = name_leaf_lfs(leaf_element, restriction)
temporary_variable(name, shape=(name_lfs_bound(lfs),), decl_method=declare_cache_temporary(leaf_element, restriction, 'Function'))
temporary_variable(name, shape=(name_lfs_bound(lfs), 1), decl_method=declare_cache_temporary(leaf_element, restriction, 'Function'))
cache = name_localbasis_cache(leaf_element)
qp = get_backend("qp_in_cell")(restriction)
instruction(inames=get_backend("quad_inames")(),
......@@ -113,7 +113,7 @@ def pymbolic_basis(leaf_element, restriction, number, context=''):
evaluate_basis(leaf_element, name, restriction)
iname, = lfs_inames(leaf_element, restriction, number, context=context)
return Subscript(Variable(name), (Variable(iname),))
return Subscript(Variable(name), (Variable(iname), 0))
@backend(interface="evaluate_grad")
......@@ -166,7 +166,7 @@ def evaluate_coefficient(visitor, element, name, container, restriction, index):
lfs = name_lfs(element, restriction, index)
basis = visitor.interface.pymbolic_basis(sub_element, restriction, 0, context='trial')
basisindex, = get_pymbolic_indices(basis)
basisindex, _ = get_pymbolic_indices(basis)
if get_option("blockstructured"):
from dune.perftool.blockstructured.argument import pymbolic_coefficient
......
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