Skip to content

Commit

Permalink
Activate multigrid for temperature solvers
Browse files Browse the repository at this point in the history
  • Loading branch information
sgeotech committed Dec 20, 2023
1 parent 5eae4a0 commit 785ab12
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/JacResTemp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ PetscErrorCode JacResCreateTempParam(JacRes *jr)

// create temperature diffusion solver
PetscCall(KSPCreate(PETSC_COMM_WORLD, &jr->tksp));

// enable geometric multigrid
PetscCall(KSPSetDM(jr->tksp, jr->DA_T));
PetscCall(KSPSetDMActive(jr->tksp, PETSC_FALSE));

// set options
PetscCall(KSPSetOptionsPrefix(jr->tksp,"ts_"));
PetscCall(KSPSetFromOptions(jr->tksp));

Expand Down
6 changes: 6 additions & 0 deletions src/LaMEMLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,12 @@ PetscErrorCode LaMEMLibSolveTemp(LaMEMLib *lm, PetscScalar dt)

// create temperature diffusion solver
ierr = KSPCreate(PETSC_COMM_WORLD, &tksp); CHKERRQ(ierr);

// enable geometric multigrid
PetscCall(KSPSetDM(tksp, jr->DA_T));
PetscCall(KSPSetDMActive(tksp, PETSC_FALSE));

// set options
ierr = KSPSetOptionsPrefix(tksp,"its_"); CHKERRQ(ierr);
ierr = KSPSetFromOptions(tksp); CHKERRQ(ierr);

Expand Down

0 comments on commit 785ab12

Please sign in to comment.