Skip to content

Commit

Permalink
remove fieldsplitting of ERK mass solves for now
Browse files Browse the repository at this point in the history
  • Loading branch information
JHopeCollins committed Nov 6, 2024
1 parent 50dd3ba commit 43c8831
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions gusto/time_discretisation/time_discretisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,29 +401,6 @@ def setup(self, equation, apply_bcs=True, *active_labels):
self.solver_parameters.setdefault('snes_lag_preconditioner', -2)
self.solver_parameters.setdefault('snes_lag_preconditioner_persists', None)

# The time derivatives for different fields are independent if all the
# time derivatives are linear, i.e. the mass matrix is block diagonal.
# Solving the time-derivative monolithically is suboptimal for algorithms
# with superlinear scaling (i.e. if the factorisation doesn't "recognise"
# the block diagonal structure.
# Instead we ask PETSc to split up the matrix into individual fields
# (fieldsplit), and solve each field independently (additive).
# Equivalently, nfields*(Nx^k) < (nfields*N)^k if nfields>1, k>1
if len(self.x0.subfunctions) > 1:
self.solver_parameters.update({
'ksp_type': 'preonly',
'pc_type': 'fieldsplit',
'pc_fieldsplit_type': 'additive',
})
for fs in self.fs.subfunctions:
self.solver_parameters.update({
f'fieldsplit_{fs.name}': {
'ksp_type': 'cg',
'pc_type': 'bjacobi',
'sub_pc_type': 'ilu',
}
})

@cached_property
def lhs(self):
"""Set up the discretisation's left hand side (the time derivative)."""
Expand Down

0 comments on commit 43c8831

Please sign in to comment.