Skip to content
Snippets Groups Projects
Commit fc37e20f authored by René Heß's avatar René Heß
Browse files

Gradvec vectorization for unstructured grids

Note: Not yet working for gmsh files
parent ab43b960
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,7 @@ from dune.perftool.pdelab.localoperator import (name_ansatz_gfs_constructor_para ...@@ -26,6 +26,7 @@ from dune.perftool.pdelab.localoperator import (name_ansatz_gfs_constructor_para
lop_template_range_field, lop_template_range_field,
) )
from dune.perftool.pdelab.restriction import restricted_name from dune.perftool.pdelab.restriction import restricted_name
from dune.perftool.sumfact.accumulation import basis_sf_kernels
from dune.perftool.sumfact.basis import construct_basis_matrix_sequence from dune.perftool.sumfact.basis import construct_basis_matrix_sequence
from dune.perftool.sumfact.quadrature import (additional_inames, from dune.perftool.sumfact.quadrature import (additional_inames,
default_quadrature_inames) default_quadrature_inames)
...@@ -153,6 +154,12 @@ def pymbolic_spatial_coordinate_multilinear(do_predicates, visitor): ...@@ -153,6 +154,12 @@ def pymbolic_spatial_coordinate_multilinear(do_predicates, visitor):
) )
vsf = attach_vectorization_info(sf) vsf = attach_vectorization_info(sf)
# If this sum factorization kernel was not used in the dry run we
# just return 0
if vsf == 0:
visitor.indices = None
return 0
# Add a sum factorization kernel that implements the evaluation of # Add a sum factorization kernel that implements the evaluation of
# the basis functions at quadrature points (stage 1) # the basis functions at quadrature points (stage 1)
var, _ = realize_sum_factorization_kernel(vsf) var, _ = realize_sum_factorization_kernel(vsf)
...@@ -525,6 +532,12 @@ def _name_jacobian(i, j, restriction, visitor): ...@@ -525,6 +532,12 @@ def _name_jacobian(i, j, restriction, visitor):
) )
vsf = attach_vectorization_info(sf) vsf = attach_vectorization_info(sf)
# If this sum factorization kernel was not used in the dry run we
# just return 0
if vsf == 0:
visitor.indices = None
return 0
# Add a sum factorization kernel that implements the evaluation of # Add a sum factorization kernel that implements the evaluation of
# the basis functions at quadrature points (stage 1) # the basis functions at quadrature points (stage 1)
var, _ = realize_sum_factorization_kernel(vsf) var, _ = realize_sum_factorization_kernel(vsf)
...@@ -557,6 +570,13 @@ def define_jacobian_inverse(name, restriction, visitor): ...@@ -557,6 +570,13 @@ def define_jacobian_inverse(name, restriction, visitor):
) )
names_jacobian.append(name_jacobian) names_jacobian.append(name_jacobian)
# The sum factorization kernels from the geometry evaluation of the
# jacobians will never appear in the expression for the input of
# stage 3. This way the SumfactCollectMapper will never see them
# and they will be marked as inactive. Here we explicitly mark the
# as used.
basis_sf_kernels(expression.aggregate)
# Calculate the inverse of the jacobian of the geometry mapping and the # Calculate the inverse of the jacobian of the geometry mapping and the
# determinant by calling a c++ function. Note: The result will be column # determinant by calling a c++ function. Note: The result will be column
# major -> fortran style. # major -> fortran style.
......
...@@ -9,7 +9,7 @@ deg_suffix = deg{formcompiler.ufl_variants.degree} ...@@ -9,7 +9,7 @@ deg_suffix = deg{formcompiler.ufl_variants.degree}
{deg_suffix} == deg1 | exclude {deg_suffix} == deg1 | exclude
{diff_suffix} == numdiff | exclude {diff_suffix} == numdiff | exclude
{quadvec_suffix} == quadvec | exclude {quadvec_suffix} == quadvec | exclude
{gradvec_suffix} == gradvec | exclude # {gradvec_suffix} == gradvec | exclude
lowerleft = 0.0 0.0 lowerleft = 0.0 0.0
upperright = 1.0 1.0 upperright = 1.0 1.0
......
...@@ -9,7 +9,7 @@ deg_suffix = deg{formcompiler.ufl_variants.degree} ...@@ -9,7 +9,7 @@ deg_suffix = deg{formcompiler.ufl_variants.degree}
{deg_suffix} == deg1 | exclude {deg_suffix} == deg1 | exclude
{diff_suffix} == numdiff | exclude {diff_suffix} == numdiff | exclude
{quadvec_suffix} == quadvec | exclude {quadvec_suffix} == quadvec | exclude
{gradvec_suffix} == gradvec | exclude # {gradvec_suffix} == gradvec | exclude
lowerleft = 0.0 0.0 0.0 lowerleft = 0.0 0.0 0.0
upperright = 1.0 1.0 1.0 upperright = 1.0 1.0 1.0
......
...@@ -9,7 +9,7 @@ deg_suffix = deg{formcompiler.ufl_variants.degree} ...@@ -9,7 +9,7 @@ deg_suffix = deg{formcompiler.ufl_variants.degree}
{deg_suffix} == deg1 | exclude {deg_suffix} == deg1 | exclude
{diff_suffix} == numdiff | exclude {diff_suffix} == numdiff | exclude
{quadvec_suffix} == quadvec | exclude {quadvec_suffix} == quadvec | exclude
{gradvec_suffix} == gradvec | exclude # {gradvec_suffix} == gradvec | exclude
lowerleft = 0.0 0.0 lowerleft = 0.0 0.0
upperright = 1.0 1.0 upperright = 1.0 1.0
......
...@@ -9,7 +9,7 @@ deg_suffix = deg{formcompiler.ufl_variants.degree} ...@@ -9,7 +9,7 @@ deg_suffix = deg{formcompiler.ufl_variants.degree}
# {deg_suffix} == deg1 | exclude # {deg_suffix} == deg1 | exclude
{diff_suffix} == numdiff | exclude {diff_suffix} == numdiff | exclude
{quadvec_suffix} == quadvec | exclude {quadvec_suffix} == quadvec | exclude
{gradvec_suffix} == gradvec | exclude # {gradvec_suffix} == gradvec | exclude
lowerleft = 0.0 0.0 0.0 lowerleft = 0.0 0.0 0.0
upperright = 1.0 1.0 1.0 upperright = 1.0 1.0 1.0
......
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