Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions firedrake/assemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,9 @@ def _apply_bc(self, tensor, bc, u=None):
bc.apply(r, u=u)
elif isinstance(bc, EquationBCSplit):
bc.zero(tensor)
if isinstance(bc.f, ufl.ZeroBaseForm) or bc.f.empty():
# form is empty, do nothing
return
OneFormAssembler(bc.f, bcs=bc.bcs,
form_compiler_parameters=self._form_compiler_params,
needs_zeroing=False,
Expand Down
3 changes: 0 additions & 3 deletions firedrake/bcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,9 +641,6 @@ def reconstruct(self, field=None, V=None, subu=None, u=None, row_field=None, col
rank = len(self.f.arguments())
splitter = ExtractSubBlock()
form = splitter.split(self.f, argument_indices=(row_field, col_field)[:rank])
if isinstance(form, ufl.ZeroBaseForm) or form.empty():
# form is empty, do nothing
return
if u is not None:
form = firedrake.replace(form, {self.u: u})
if action_x is not None:
Expand Down
20 changes: 10 additions & 10 deletions tests/firedrake/equation_bcs/test_equation_bcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ def linear_poisson_mixed(solver_parameters, mesh_num, porder):
u1 = cos(2 * pi * y) / 2
n = FacetNormal(mesh)

a = (inner(sigma, tau) + inner(u, div(tau)) + inner(div(sigma), v)) * dx
L = inner(u1, dot(tau, n)) * ds(1) + inner(f, v) * dx
a = inner(sigma, tau)*dx + inner(u, div(tau))*dx + inner(div(sigma), v + div(tau))*dx
L = inner(u1, dot(tau, n)) * ds(1) + inner(f, v + div(tau)) * dx

g = as_vector([-2 * pi * sin(2 * pi * x + pi / 3) * cos(2 * pi * y), -2 * pi * cos(2 * pi * x + pi / 3) * sin(2 * pi * y)])

Expand Down Expand Up @@ -331,24 +331,24 @@ def test_EquationBC_mixedpoisson_matfree_fieldsplit():
eq_type = "linear"
porder = 0
# Mixed poisson with EquationBCs
# matfree with fieldsplit pc
# matfree with fieldsplit schur direct solver

solver_parameters = {'mat_type': mat_type,
'ksp_type': 'fgmres',
'ksp_atol': 1e-11,
'ksp_max_it': 200,
'ksp_type': 'preonly',
'pc_type': 'fieldsplit',
'pc_fieldsplit_type': 'schur',
'pc_fieldsplit_schur_fact_type': 'full',
'fieldsplit_0_ksp_type': 'cg',
'fieldsplit_0_ksp_type': 'preonly',
'fieldsplit_0_pc_type': 'python',
'fieldsplit_0_pc_python_type': 'firedrake.AssembledPC',
'fieldsplit_0_assembled_pc_type': 'lu',
'fieldsplit_1_ksp_type': 'cg',
'fieldsplit_1_pc_use_amat': True,
'fieldsplit_0_assembled_pc_factor_mat_solver_type': 'mumps',
'fieldsplit_1_ksp_type': 'gmres',
'fieldsplit_1_pc_type': 'python',
'fieldsplit_1_pc_python_type': 'firedrake.MassInvPC',
'fieldsplit_1_Mp_pc_type': 'icc'}
'fieldsplit_1_Mp_pc_type': 'lu',
'fieldsplit_1_Mp_pc_factor_mat_solver_type': 'mumps',
}
err = []
mesh_sizes = [16, 32]
if eq_type == "linear":
Expand Down
Loading