diff --git a/.github/workflows/ci_conda.yml b/.github/workflows/ci_conda.yml index 0af9bae05..9c3d0055d 100644 --- a/.github/workflows/ci_conda.yml +++ b/.github/workflows/ci_conda.yml @@ -20,7 +20,7 @@ jobs: - name: Create Conda environment shell: bash -l {0} run: | - conda install -c conda-forge fenics-dolfinx=0.8.0 + conda install -c conda-forge fenics-dolfinx=0.9.0 - name: Install local package and dependencies shell: bash -l {0} diff --git a/.github/workflows/ci_docker.yml b/.github/workflows/ci_docker.yml index 7074e6e8f..e104da607 100644 --- a/.github/workflows/ci_docker.yml +++ b/.github/workflows/ci_docker.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - container_version: [v0.8.0, nightly] + container_version: [v0.9.0, nightly] container: dolfinx/dolfinx:${{ matrix.container_version }} steps: - name: Checkout code diff --git a/festim/problem.py b/festim/problem.py index 582ea6385..17bb92d4e 100644 --- a/festim/problem.py +++ b/festim/problem.py @@ -24,6 +24,7 @@ def __init__( subdomains=None, boundary_conditions=None, settings=None, + petcs_options=None, ) -> None: self.mesh = mesh # for arguments to initialise as empty list @@ -42,6 +43,7 @@ def __init__( self.formulation = None self.bc_forms = [] self.show_progress_bar = True + self.petcs_options = petcs_options @property def volume_subdomains(self): @@ -102,6 +104,13 @@ def create_solver(self): self.solver.rtol = self.settings.rtol self.solver.max_it = self.settings.max_iterations + if self.petcs_options is None: + ksp = self.solver.krylov_solver + ksp.setType("preonly") + ksp.getPC().setType("lu") + ksp.getPC().setFactorSolverType("mumps") + ksp.setErrorIfNotConverged(True) + def run(self): """Runs the model"""