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

Fix CompositeGridFunctionSpaces with 1 child

These might sound completely silly, but they are useful when writing
code generic w.r.t. the number of components
parent 6921eb8b
No related branches found
No related tags found
No related merge requests found
...@@ -63,7 +63,7 @@ class PerftoolOptionsArray(ImmutableRecord): ...@@ -63,7 +63,7 @@ class PerftoolOptionsArray(ImmutableRecord):
turn_off_diagonal_jacobian = PerftoolOption(default=False, helpstr="Do not use diagonal_jacobian transformation on the ufl tree and cast result of jacobianInverseTransposed into a FieldMatrix.") turn_off_diagonal_jacobian = PerftoolOption(default=False, helpstr="Do not use diagonal_jacobian transformation on the ufl tree and cast result of jacobianInverseTransposed into a FieldMatrix.")
architecture = PerftoolOption(default="haswell", helpstr="The architecture to optimize for. Possible values: haswell|knl") architecture = PerftoolOption(default="haswell", helpstr="The architecture to optimize for. Possible values: haswell|knl")
grid_offset = PerftoolOption(default=False, helpstr="Set to true if you want a yasp grid where the lower left corner is not in the origin.") grid_offset = PerftoolOption(default=False, helpstr="Set to true if you want a yasp grid where the lower left corner is not in the origin.")
simplify = PerftoolOption(default=True, helpstr="Whether to simplify expressions using sympy") simplify = PerftoolOption(default=False, helpstr="Whether to simplify expressions using sympy")
precision_bits = PerftoolOption(default=64, helpstr="The number of bits for the floating point type") precision_bits = PerftoolOption(default=64, helpstr="The number of bits for the floating point type")
assure_statement_ordering = PerftoolOption(default=False, helpstr="Whether special care should be taken for a good statement ordering in sumfact kernels, runs into a loopy scheduler performance bug, but is necessary for production.") assure_statement_ordering = PerftoolOption(default=False, helpstr="Whether special care should be taken for a good statement ordering in sumfact kernels, runs into a loopy scheduler performance bug, but is necessary for production.")
......
...@@ -234,6 +234,8 @@ def name_gfs(element, is_dirichlet, treepath=(), root=True): ...@@ -234,6 +234,8 @@ def name_gfs(element, is_dirichlet, treepath=(), root=True):
subgfs.append(name_gfs(subel, is_dirichlet[k:k + subel.value_size()], treepath=treepath + (i,), root=False)) subgfs.append(name_gfs(subel, is_dirichlet[k:k + subel.value_size()], treepath=treepath + (i,), root=False))
k = k + subel.value_size() k = k + subel.value_size()
name = "_".join(subgfs) name = "_".join(subgfs)
if len(subgfs) == 1:
name = "{}_dummy".format(name)
name = "{}_{}".format(name, "_".join(str(t) for t in treepath)) name = "{}_{}".format(name, "_".join(str(t) for t in treepath))
define_composite_gfs(element, is_dirichlet, name, tuple(subgfs), root) define_composite_gfs(element, is_dirichlet, name, tuple(subgfs), root)
return name return name
...@@ -272,6 +274,8 @@ def type_gfs(element, is_dirichlet, root=True): ...@@ -272,6 +274,8 @@ def type_gfs(element, is_dirichlet, root=True):
subgfs.append(type_gfs(subel, is_dirichlet[k:k + subel.value_size()], root=False)) subgfs.append(type_gfs(subel, is_dirichlet[k:k + subel.value_size()], root=False))
k = k + subel.value_size() k = k + subel.value_size()
name = "_".join(subgfs) name = "_".join(subgfs)
if len(subgfs) == 1:
name = "{}_dummy".format(name)
typedef_composite_gfs(element, name, tuple(subgfs), root) typedef_composite_gfs(element, name, tuple(subgfs), root)
return name return name
else: else:
......
...@@ -52,6 +52,8 @@ def name_boundary_function(element, func): ...@@ -52,6 +52,8 @@ def name_boundary_function(element, func):
childs.append(name_boundary_function(subel, func[k:k + subel.value_size()])) childs.append(name_boundary_function(subel, func[k:k + subel.value_size()]))
k = k + subel.value_size() k = k + subel.value_size()
name = "_".join(childs) name = "_".join(childs)
if len(childs) == 1:
name = "{}_dummy".format(name)
define_compositegfs_parameterfunction(name, tuple(childs)) define_compositegfs_parameterfunction(name, tuple(childs))
return name return name
else: else:
......
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