refactor(polySolver): removed build_prec method

building and managing has been offloaded to the operator
This commit is contained in:
2025-04-21 08:07:17 -04:00
parent 4a6b7aaa35
commit 184f92faf1
2 changed files with 0 additions and 26 deletions

View File

@@ -335,31 +335,6 @@ void PolySolver::LoadSolverUserParams(double &newtonRelTol, double &newtonAbsTol
LOG_DEBUG(m_logger, "GMRES Solver (relTol: {:0.2E}, absTol: {:0.2E}, maxIter: {}, printLevel: {})", gmresRelTol, gmresAbsTol, gmresMaxIter, gmresPrintLevel);
}
mfem::BlockDiagonalPreconditioner PolySolver::build_preconditioner() const {
// --- Set up the preconditioners. The non-linear form will use a Chebyshev Preconditioner while the linear terms will use a simpler Jacobi preconditioner ---
mfem::BlockDiagonalPreconditioner prec(m_polytropOperator->GetBlockOffsets());
const mfem::BlockOperator &jacobian = m_polytropOperator->GetJacobianOperator();
// Get all the blocks. J00 -> Non-linear form (df(θ)/dθ), J01-> -M, J10 -> -Q, J11 -> D
const mfem::Operator& J00 = jacobian.GetBlock(0, 0);
mfem::Vector J00diag;
J00.AssembleDiagonal(J00diag);
SSE::MFEMArrayPairSet ess_tdof_pair_set = m_polytropOperator->GetEssentialTrueDofs();
// TODO: This order may need to be tuned (EMB)
// --- ess_tdof_pair_set.first -> (theta dof ids, theta dof vals).first -> theta dof ids
// --- ess_tdof_pair_set.second -> (phi dof ids, phi dof vals).first -> phi dof ids
mfem::OperatorChebyshevSmoother J00Prec(J00, J00diag, ess_tdof_pair_set.first.first, 2);
mfem::OperatorJacobiSmoother J11Prec(m_polytropOperator->GetJ11diag(), ess_tdof_pair_set.second.first);
prec.SetDiagonalBlock(0, &J00Prec);
prec.SetDiagonalBlock(1, &J11Prec);
return prec;
}
mfem::NewtonSolver PolySolver::setupNewtonSolver() const {
// --- Load configuration parameters ---
double newtonRelTol, newtonAbsTol, gmresRelTol, gmresAbsTol;