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

Add sumfact test directory

parent c4a0d4ca
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,8 @@ def get_form_compiler_arguments():
parser.add_argument("--ini-file", type=str, help="An inifile to use. A generated driver will be hard-coded to it, a [formcompiler] section will be used as default values to form compiler arguments (use snake case)")
parser.add_argument("--timer", action="store_true", help="measure times")
parser.add_argument("--project-basedir", type=str, help="The base (build) directory of the dune-perftool project")
# TODO at some point this help description should be updated
parser.add_argument("--sumfact", action="store_true", help="Use sumfactorization")
# Modify the positional argument to not be a list
args = vars(parser.parse_args())
......
......@@ -3,3 +3,5 @@ add_subdirectory(laplace)
add_subdirectory(nonlinear)
add_subdirectory(poisson)
add_subdirectory(stokes)
add_subdirectory(sumfact)
add_subdirectory(poisson)
# 1. Poisson Test Case: source f, bc g
dune_add_formcompiler_system_test(UFLFILE poisson.ufl
BASENAME sumfact_poisson
INIFILE poisson.mini
)
# 2. Poisson Test Case: DG, f + pure dirichlet
dune_add_formcompiler_system_test(UFLFILE poisson_dg.ufl
BASENAME sumfact_poisson_dg
INIFILE poisson_dg.mini
)
__name = sumfact_poisson_{__exec_suffix}
__exec_suffix = numdiff, symdiff | expand num
lowerleft = 0.0 0.0
upperright = 1.0 1.0
elements = 32 32
elementType = simplical
[wrapper.vtkcompare]
name = {__name}
reference = poisson_ref
extension = vtu
[formcompiler]
numerical_jacobian = 1, 0 | expand num
exact_solution_expression = g
compare_l2errorsquared = 1e-6
sumfact = 1
f = Expression("Dune::FieldVector<double,2> c(0.5); c-= x; return 4.*(1.-c.two_norm2())*std::exp(-1.*c.two_norm2());")
g = Expression("Dune::FieldVector<double,2> c(0.5); c-= x; return std::exp(-1.*c.two_norm2());")
V = FiniteElement("CG", "triangle", 1, dirichlet_expression=g)
u = TrialFunction(V)
v = TestFunction(V)
forms = [(inner(grad(u), grad(v)) - f*v)*dx]
__name = sumfact_poisson_dg_{__exec_suffix}
__exec_suffix = numdiff, symdiff | expand num
lowerleft = 0.0 0.0
upperright = 1.0 1.0
elements = 32 32
elementType = simplical
[wrapper.vtkcompare]
name = {__name}
reference = poisson_dg_ref
extension = vtu
[formcompiler]
numerical_jacobian = 1, 0 | expand num
exact_solution_expression = g
compare_l2errorsquared = 2e-5
sumfact = 1
f = Expression("Dune::FieldVector<double,2> c(0.5); c-= x; return 4.*(1.-c.two_norm2())*std::exp(-1.*c.two_norm2());")
g = Expression("Dune::FieldVector<double,2> c(0.5); c-= x; return std::exp(-1.*c.two_norm2());", on_intersection=True)
cell = triangle
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 \
+ inner(n, avg(grad(u)))*jump(v)*dS \
+ gamma*jump(u)*jump(v)*dS \
+ theta*jump(u)*inner(avg(grad(v)), n)*dS \
- inner(n, grad(u))*v*ds \
+ gamma*u*v*ds \
- theta*u*inner(grad(v), n)*ds \
- f*v*dx \
+ theta*g*inner(grad(v), n)*ds \
- gamma*g*v*ds
forms = [r]
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