fix(poly): working to resolve overshoot mode

This commit is contained in:
2025-06-10 12:49:31 -04:00
parent f65db72bce
commit 76d6d3d1cf
5 changed files with 87 additions and 26 deletions

View File

@@ -114,18 +114,18 @@ void PolySolver::assembleBlockSystem() {
const std::unique_ptr<formBundle> forms = buildIndividualForms(blockOffsets);
// const double penalty_param = m_config.get<double>("Poly::Solver::ZeroDerivativePenalty", 1e10);
// mfem::Array<int> thetaCenterDofs, phiCenterDofs;
// std::tie(thetaCenterDofs, phiCenterDofs) = findCenterElement();
// mfem::SparseMatrix& D_mat = forms->D->SpMat();
//
// for (int i = 0; i < phiCenterDofs.Size(); ++i)
// {
// const int dof_idx = phiCenterDofs[i];
// if (dof_idx >= 0 && dof_idx < D_mat.Height()) {
// D_mat(dof_idx, dof_idx) += penalty_param;
// }
// }
const double penalty_param = m_config.get<double>("Poly::Solver::ZeroDerivativePenalty", 1.0);
mfem::Array<int> thetaCenterDofs, phiCenterDofs;
std::tie(thetaCenterDofs, phiCenterDofs) = findCenterElement();
mfem::SparseMatrix& D_mat = forms->D->SpMat();
for (int i = 0; i < phiCenterDofs.Size(); ++i)
{
const int dof_idx = phiCenterDofs[i];
if (dof_idx >= 0 && dof_idx < D_mat.Height()) {
D_mat(dof_idx, dof_idx) += penalty_param;
}
}
// --- Build the BlockOperator ---
m_polytropOperator = std::make_unique<PolytropeOperator>(
@@ -233,7 +233,7 @@ SSE::MFEMArrayPairSet PolySolver::getEssentialTrueDof() const {
std::tie(thetaCenterDofs, phiCenterDofs) = findCenterElement();
thetaCenterVals.SetSize(thetaCenterDofs.Size());
// phiCenterVals.SetSize(phiCenterDofs.Size());
//
// phiCenterVals = 0.0;
thetaCenterVals = 1.0;