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

Solve some issues due to rebasing

parent a269a5d7
No related branches found
No related tags found
No related merge requests found
...@@ -161,3 +161,8 @@ def option_switch(opt): ...@@ -161,3 +161,8 @@ def option_switch(opt):
else: else:
return "default" return "default"
return _switch return _switch
def set_option_dependencies():
if get_option("overlapping"):
set_option("parallel", True)
...@@ -24,13 +24,19 @@ def name_assembled_constraints(): ...@@ -24,13 +24,19 @@ def name_assembled_constraints():
return name return name
def has_dirichlet_constraints(is_dirichlet):
if isinstance(is_dirichlet, (list, tuple)):
return any(bool(d) for d in is_dirichlet)
else:
return bool(is_dirichlet)
@preamble @preamble
def assemble_constraints(name): def assemble_constraints(name):
element = get_trial_element() element = get_trial_element()
gfs = name_trial_gfs() gfs = name_trial_gfs()
is_dirichlet = preprocess_leaf_data(element, "is_dirichlet") is_dirichlet = preprocess_leaf_data(element, "is_dirichlet")
from dune.perftool.pdelab.driver.interpolate import _do_interpolate if has_dirichlet_constraints(is_dirichlet):
if _do_interpolate(is_dirichlet):
bctype_function = name_bctype_function(element, is_dirichlet) bctype_function = name_bctype_function(element, is_dirichlet)
return "Dune::PDELab::constraints({}, {}, {});".format(bctype_function, return "Dune::PDELab::constraints({}, {}, {});".format(bctype_function,
gfs, gfs,
......
...@@ -14,7 +14,8 @@ from dune.perftool.pdelab.driver.gridfunctionspace import (name_trial_gfs, ...@@ -14,7 +14,8 @@ from dune.perftool.pdelab.driver.gridfunctionspace import (name_trial_gfs,
from dune.perftool.pdelab.driver.gridoperator import (name_gridoperator, from dune.perftool.pdelab.driver.gridoperator import (name_gridoperator,
name_parameters, name_parameters,
type_gridoperator,) type_gridoperator,)
from dune.perftool.pdelab.driver.constraints import (name_bctype_function, from dune.perftool.pdelab.driver.constraints import (has_dirichlet_constraints,
name_bctype_function,
name_constraintscontainer, name_constraintscontainer,
) )
from dune.perftool.pdelab.driver.interpolate import (interpolate_dirichlet_data, from dune.perftool.pdelab.driver.interpolate import (interpolate_dirichlet_data,
...@@ -58,10 +59,8 @@ def time_loop(): ...@@ -58,10 +59,8 @@ def time_loop():
interpolate_dirichlet_data(vector) interpolate_dirichlet_data(vector)
is_dirichlet = preprocess_leaf_data(element, "is_dirichlet") is_dirichlet = preprocess_leaf_data(element, "is_dirichlet")
from dune.perftool.pdelab.driver.interpolate import _do_interpolate
assemble_new_constraints = "" assemble_new_constraints = ""
dirichlet_constraints = _do_interpolate(is_dirichlet) if has_dirichlet_constraints(is_dirichlet):
if dirichlet_constraints:
bctype = name_bctype_function(element, is_dirichlet) bctype = name_bctype_function(element, is_dirichlet)
gfs = name_trial_gfs() gfs = name_trial_gfs()
cc = name_constraintscontainer() cc = name_constraintscontainer()
...@@ -78,7 +77,7 @@ def time_loop(): ...@@ -78,7 +77,7 @@ def time_loop():
apply_call = "{}.apply(time, dt, {}, {}new);".format(osm, vector, vector) apply_call = "{}.apply(time, dt, {}, {}new);".format(osm, vector, vector)
else: else:
osm = name_onestepmethod() osm = name_onestepmethod()
if dirichlet_constraints: if has_dirichlet_constraints(is_dirichlet):
dirichlet = preprocess_leaf_data(element, "interpolate_expression") dirichlet = preprocess_leaf_data(element, "interpolate_expression")
boundary = name_boundary_function(element, dirichlet) boundary = name_boundary_function(element, dirichlet)
apply_call = "{}.apply(time, dt, {}, {}, {}new);".format(osm, vector, boundary, vector) apply_call = "{}.apply(time, dt, {}, {}, {}new);".format(osm, vector, boundary, vector)
......
...@@ -5,7 +5,7 @@ degree = 2 ...@@ -5,7 +5,7 @@ degree = 2
dim = 2 dim = 2
x = SpatialCoordinate(cell) x = SpatialCoordinate(cell)
time = variable(Constant(cell, count=2)) time = get_time(cell)
P2 = VectorElement("DG", cell, degree) P2 = VectorElement("DG", cell, degree)
P1 = FiniteElement("DG", cell, degree-1) P1 = FiniteElement("DG", cell, degree-1)
...@@ -44,5 +44,5 @@ r = mu * inner(grad(u), grad(v))*dx \ ...@@ -44,5 +44,5 @@ r = mu * inner(grad(u), grad(v))*dx \
- avg(q)*inner(jump(u), n)*dS \ - avg(q)*inner(jump(u), n)*dS \
forms = [mass,r] forms = [mass,r]
dirichlet_expression = g_v, g_p interpolate_expression = g_v, g_p
exact_solution = g_v, g_p exact_solution = g_v, g_p
...@@ -56,7 +56,7 @@ r = mu * inner(grad(u), grad(v))*dx \ ...@@ -56,7 +56,7 @@ r = mu * inner(grad(u), grad(v))*dx \
+ q*inner(u-g_v, n)*ds + q*inner(u-g_v, n)*ds
forms = [mass,r] forms = [mass,r]
dirichlet_expression = g_v, g_p interpolate_expression = g_v, g_p
t_end = 0.5 t_end = 0.5
v_end = as_vector((-a*exp(-d*d*t_end)*(exp(a*x[0])*sin(d*x[2]+a*x[1])+cos(d*x[1]+a*x[0])*exp(a*x[2])), v_end = as_vector((-a*exp(-d*d*t_end)*(exp(a*x[0])*sin(d*x[2]+a*x[1])+cos(d*x[1]+a*x[0])*exp(a*x[2])),
......
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