From be1e362651fc501ef4d20d9a1b36af9aa44e975a Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Tue, 29 Oct 2024 15:34:38 -0400 Subject: [PATCH 1/2] added new default solver --- festim/problem.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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""" From e6e8a2ca33b27232ffedc81e792a4c6836da22ad Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Tue, 29 Oct 2024 15:38:04 -0400 Subject: [PATCH 2/2] fixed version of dolfinx --- .github/workflows/ci_conda.yml | 2 +- .github/workflows/ci_docker.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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