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

Cleanup sumfact tests using ufl variation

parent 76fa6485
No related branches found
No related tags found
No related merge requests found
Showing
with 60 additions and 144 deletions
# Poisson CG 2D
dune_add_formcompiler_system_test(UFLFILE poisson_2d_order1.ufl
BASENAME sumfact_poisson_2d_order1
INIFILE poisson_2d_order1.mini
# 1. Poisson Test Case in 2D
dune_add_formcompiler_system_test(UFLFILE poisson_2d.ufl
BASENAME sumfact_poisson_2d
INIFILE poisson_2d.mini
)
dune_add_formcompiler_system_test(UFLFILE poisson_2d_order2.ufl
BASENAME sumfact_poisson_2d_order2
INIFILE poisson_2d_order2.mini
# 2. Poisson Test case in 3D
dune_add_formcompiler_system_test(UFLFILE poisson_3d.ufl
BASENAME sumfact_poisson_3d
INIFILE poisson_3d.mini
)
# Poisson CG 3D
dune_add_formcompiler_system_test(UFLFILE poisson_3d_order1.ufl
BASENAME sumfact_poisson_3d_order1
INIFILE poisson_3d_order1.mini
)
dune_add_formcompiler_system_test(UFLFILE poisson_3d_order2.ufl
BASENAME sumfact_poisson_3d_order2
INIFILE poisson_3d_order2.mini
)
# Operator counting test
dune_add_formcompiler_system_test(UFLFILE opcount_poisson_2d_order2.ufl
BASENAME opcount_sumfact_poisson_2d_order2
INIFILE opcount_poisson_2d_order2.mini
)
# Poisson DG
dune_add_formcompiler_system_test(UFLFILE poisson_dg.ufl
# 3. Poisson Test Case: DG in 2D
dune_add_formcompiler_system_test(UFLFILE poisson_dg_2d.ufl
BASENAME sumfact_poisson_dg
INIFILE poisson_dg.mini
INIFILE poisson_dg_2d.mini
)
# 4. Poisson Test Case: DG in 3D
dune_add_formcompiler_system_test(UFLFILE poisson_dg_3d.ufl
BASENAME sumfact_poisson_dg
INIFILE poisson_dg_3d.mini
)
# Poisson DG using FastDGGridOperator
dune_add_formcompiler_system_test(UFLFILE poisson_dg.ufl
dune_add_formcompiler_system_test(UFLFILE poisson_dg_2d.ufl
BASENAME sumfact_poisson_fastdg
INIFILE poisson_fastdg.mini
)
__name = sumfact_poisson_2d_order1_{__exec_suffix}
__exec_suffix = {diff_suffix}_{vec_suffix}
__name = sumfact_poisson_2d_{__exec_suffix}
__exec_suffix = {deg_suffix}_{diff_suffix}_{vec_suffix}
diff_suffix = numdiff, symdiff | expand num
vec_suffix = vec, nonvec | expand vec
deg_suffix = deg{formcompiler.ufl_variants.degree}
cells = 8 8
extension = 1. 1.
......@@ -18,3 +19,6 @@ exact_solution_expression = g
compare_l2errorsquared = 1e-4
sumfact = 1
vectorize_quad = 1, 0 | expand vec
[formcompiler.ufl_variants]
degree = 1, 2 | expand deg
cell = "quadrilateral"
x = SpatialCoordinate(cell)
c = (0.5-x[0])**2 + (0.5-x[1])**2
g = exp(-1.*c)
f = 4*(1.-c)*g
V = FiniteElement("CG", cell, degree, dirichlet_expression=g)
u = TrialFunction(V)
v = TestFunction(V)
forms = [(inner(grad(u), grad(v)) - f*v)*dx]
cell = "quadrilateral"
f = Expression("Dune::FieldVector<double,2> c(0.5); c-= x; return 4.*(1.-c.two_norm2())*std::exp(-1.*c.two_norm2());", cell=cell)
g = Expression("Dune::FieldVector<double,2> c(0.5); c-= x; return std::exp(-1.*c.two_norm2());", cell=cell)
V = FiniteElement("CG", cell, 1, dirichlet_expression=g)
u = TrialFunction(V)
v = TestFunction(V)
forms = [(inner(grad(u), grad(v)) - f*v)*dx]
__name = sumfact_poisson_2d_order2_{__exec_suffix}
__exec_suffix = {diff_suffix}_{vec_suffix}
diff_suffix = numdiff, symdiff | expand num
vec_suffix = vec, nonvec | expand vec
cells = 8 8
extension = 1. 1.
[wrapper.vtkcompare]
name = {__name}
reference = poisson_ref
extension = vtu
[formcompiler]
numerical_jacobian = 1, 0 | expand num
exact_solution_expression = g
compare_l2errorsquared = 1e-8
sumfact = 1
vectorize_quad = 1, 0 | expand vec
cell = "quadrilateral"
f = Expression("Dune::FieldVector<double,2> c(0.5); c-= x; return 4.*(1.-c.two_norm2())*std::exp(-1.*c.two_norm2());", cell=cell)
g = Expression("Dune::FieldVector<double,2> c(0.5); c-= x; return std::exp(-1.*c.two_norm2());", cell=cell)
V = FiniteElement("CG", cell, 2, dirichlet_expression=g)
u = TrialFunction(V)
v = TestFunction(V)
forms = [(inner(grad(u), grad(v)) - f*v)*dx]
__name = sumfact_poisson_3d_order1_{__exec_suffix}
__exec_suffix = {diff_suffix}_{vecq_suffix}_{vecg_suffix}
__name = sumfact_poisson_3d_{__exec_suffix}
__exec_suffix = {deg_suffix}_{diff_suffix}_{vecq_suffix}_{vecg_suffix}
diff_suffix = numdiff, symdiff | expand num
vecq_suffix = quadvec, nonquadvec | expand vec_q
vecg_suffix = gradvec, nongradvec | expand vec_g
deg_suffix = deg{formcompiler.ufl_variants.degree}
cells = 8 8 8
extension = 1. 1. 1.
......@@ -16,7 +17,10 @@ extension = vtu
[formcompiler]
numerical_jacobian = 1, 0 | expand num
exact_solution_expression = g
compare_l2errorsquared = 1e-4
compare_l2errorsquared = 2e-4
sumfact = 1
vectorize_quad = 1, 0 | expand vec_q
vectorize_grads = 1, 0 | expand vec_g
[formcompiler.ufl_variants]
degree = 1, 2 | expand deg
......@@ -5,10 +5,7 @@ c = (0.5 - x[0])**2 + (0.5 - x[1])**2 + (0.5 - x[2])**2
g = exp(-1.*c)
f = 6*(1.-c)*g
#f = Expression("Dune::FieldVector<double,3> c(0.5); c-= x; return 6.*(1.-c.two_norm2())*std::exp(-1.*c.two_norm2());", cell=cell)
#g = Expression("Dune::FieldVector<double,3> c(0.5); c-= x; return std::exp(-1.*c.two_norm2());", cell=cell)
V = FiniteElement("CG", cell, 1, dirichlet_expression=g)
V = FiniteElement("CG", cell, degree, dirichlet_expression=g)
u = TrialFunction(V)
v = TestFunction(V)
......
__name = sumfact_poisson_3d_order2_{__exec_suffix}
__exec_suffix = {diff_suffix}_{vecq_suffix}_{vecg_suffix}
diff_suffix = numdiff, symdiff | expand num
vecq_suffix = quadvec, nonquadvec | expand vec_q
vecg_suffix = gradvec, nongradvec | expand vec_g
cells = 8 8 8
extension = 1. 1. 1.
[wrapper.vtkcompare]
name = {__name}
reference = poisson_ref
extension = vtu
[formcompiler]
numerical_jacobian = 1, 0 | expand num
exact_solution_expression = g
compare_l2errorsquared = 1e-8
sumfact = 1
vectorize_quad = 1, 0 | expand vec_q
vectorize_grads = 1, 0 | expand vec_g
cell = "hexahedron"
f = Expression("Dune::FieldVector<double,2> c(0.5); c-= x; return 4.*(1.-c.two_norm2())*std::exp(-1.*c.two_norm2());", cell=cell)
g = Expression("Dune::FieldVector<double,2> c(0.5); c-= x; return std::exp(-1.*c.two_norm2());", cell=cell)
V = FiniteElement("CG", cell, 2, dirichlet_expression=g)
u = TrialFunction(V)
v = TestFunction(V)
forms = [(inner(grad(u), grad(v)) - f*v)*dx]
cell = "quadrilateral"
f = Expression("Dune::FieldVector<double,2> c(0.5); c-= x; return 4.*(1.-c.two_norm2())*std::exp(-1.*c.two_norm2());", cell=cell)
g = Expression("Dune::FieldVector<double,2> c(0.5); c-= x; return std::exp(-1.*c.two_norm2());", on_intersection=True, cell=cell)
x = SpatialCoordinate(cell)
c = (0.5-x[0])**2 + (0.5-x[1])**2
g = exp(-1.*c)
f = 4*(1.-c)*g
V = FiniteElement("DG", cell, 1)
V = FiniteElement("DG", cell, degree)
u = TrialFunction(V)
v = TestFunction(V)
......@@ -24,4 +26,4 @@ r = inner(grad(u), grad(v))*dx \
+ theta*g*inner(grad(v), n)*ds \
- gamma*g*v*ds
forms = [r]
\ No newline at end of file
forms = [r]
__name = sumfact_poisson_dg_only_volume_{__exec_suffix}
__exec_suffix = {__num_suffix}_{__sumfact_suffix}
__num_suffix = numdiff, symdiff |expand num
__sumfact_suffix = normal, sumfact | expand sumf
cells = 1 1
extension = 1. 1.
printresidual = 1
printmatrix = 1
[wrapper.vtkcompare]
name = {__name}
extension = vtu
[formcompiler]
numerical_jacobian = 1, 0 | expand num
sumfact = 0, 1 | expand sumf
print_transformations = 1
print_transformations_dir = .
cell = "quadrilateral"
f = Expression("return -2.0*x.size();", cell=cell)
g = Expression("return x.two_norm2();", on_intersection=True, cell=cell)
V = FiniteElement("DG", cell, 1)
u = TrialFunction(V)
v = TestFunction(V)
n = FacetNormal(cell)('+')
gamma = 1.0
theta = 1.0
r = inner(grad(u), grad(v))*dx \
- f*v*dx
forms = [r]
\ No newline at end of file
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