feat(preconditioner): major work on preconditioner system
first preconditioner MVP
This commit is contained in:
@@ -787,6 +787,36 @@ namespace mean_field::operators {
|
||||
++m_algebraicJacobianStatistics.enthalpyApplications;
|
||||
}
|
||||
|
||||
void PreparedHydrostaticEquilibriumOperator::AssembleEnthalpyJacobianDiagonal(mfem::Vector &diagonal) const {
|
||||
VerifyPrepared();
|
||||
|
||||
mfem::Vector localDiagonal(m_fem.enthalpyFes->GetVSize());
|
||||
localDiagonal = 0.0;
|
||||
mfem::Vector elementDiagonal;
|
||||
|
||||
for (const ElementPAData &data : m_elements) {
|
||||
MFEM_VERIFY(
|
||||
data.enthalpyDofTransformation == nullptr,
|
||||
"Enthalpy mass-diagonal assembly currently requires scalar H1 element DOFs without a DOF transform."
|
||||
);
|
||||
MFEM_VERIFY(
|
||||
data.enthalpyJacobian.Height() == data.enthalpyDofs.Size() &&
|
||||
data.enthalpyJacobian.Width() == data.enthalpyDofs.Size(),
|
||||
"The prepared enthalpy Jacobian block is not square on an element."
|
||||
);
|
||||
elementDiagonal.SetSize(data.enthalpyDofs.Size());
|
||||
for (int dof = 0; dof < data.enthalpyDofs.Size(); ++dof) {
|
||||
elementDiagonal(dof) = data.enthalpyJacobian(dof, dof);
|
||||
}
|
||||
localDiagonal.AddElementVector(data.enthalpyDofs, elementDiagonal);
|
||||
}
|
||||
|
||||
mfem::Vector trueDiagonal;
|
||||
local_to_true(*m_fem.enthalpyFes, localDiagonal, trueDiagonal);
|
||||
diagonal.SetSize(m_context.GetEnthalpyMap().reduced_size());
|
||||
m_context.GetEnthalpyMap().gather(trueDiagonal, diagonal);
|
||||
}
|
||||
|
||||
void PreparedHydrostaticEquilibriumOperator::ApplyGravityPotentialJacobianAction(
|
||||
const mfem::Vector &gravityPotentialVariation,
|
||||
mfem::Vector &action
|
||||
|
||||
Reference in New Issue
Block a user