Skip to content
Snippets Groups Projects
Commit 41078b5d authored by Marcel Koch's avatar Marcel Koch
Browse files

small renaming

parent ce941233
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,6 @@ def compute_jacobian_2d(name):
)
def define_jacobian_matrix(name):
temporary_variable(name, shape_impl=('fm',), shape=(world_dimension(), world_dimension()))
if world_dimension() == 2:
......@@ -77,24 +76,26 @@ def name_jacobian_matrix():
return name
def pymbolic_compute_determinant(matrix):
def compute_determinant(name, matrix):
dim = world_dimension()
matrix_entry = [[prim.Subscript(prim.Variable(matrix), (i, j)) for j in range(dim)] for i in range(dim)]
expr_determinant = prim.Sum((prim.Product((matrix_entry[0][0], matrix_entry[1][1])),
-1*prim.Product((matrix_entry[1][0], matrix_entry[0][1]))))
return expr_determinant
if dim == 2:
matrix_entry = [[prim.Subscript(prim.Variable(matrix), (i, j)) for j in range(dim)] for i in range(dim)]
expr_determinant = prim.Sum((prim.Product((matrix_entry[0][0], matrix_entry[1][1])),
-1*prim.Product((matrix_entry[1][0], matrix_entry[0][1]))))
instruction(expression=expr_determinant,
assignee=prim.Variable(name),
within_inames=frozenset(sub_element_inames()+get_backend(interface="quad_inames")()),
within_inames_is_final=True,
depends_on=frozenset({Writes(matrix)})
)
else:
raise NotImplementedError()
def define_jacobian_determinant(name):
temporary_variable(name, shape=())
jacobian = name_jacobian_matrix()
expr_determinant = pymbolic_compute_determinant(jacobian)
return instruction(expression=expr_determinant,
assignee=prim.Variable(name),
within_inames=frozenset(sub_element_inames()+get_backend(interface="quad_inames")()),
within_inames_is_final=True,
depends_on=frozenset({Writes(jacobian)})
)
compute_determinant(name, jacobian)
def define_jacobian_determinant_inverse(name):
......@@ -137,7 +138,7 @@ def name_jacobian_determinant_abs():
return name
# scale determinant according to the order of the blockstructure
# scale determinant according to the order of the blockstructuring
def pymbolic_jacobian_determinant():
if get_form_option("constant_transformation_matrix"):
from dune.perftool.pdelab.geometry import name_jacobian_determinant
......
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