Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New default PETSC parameters #899

Merged
merged 2 commits into from
Oct 29, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions festim/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down Expand Up @@ -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"""

Expand Down
Loading