feat(poly): added full constraint integrator function

not yet debugged
This commit is contained in:
2025-03-19 13:49:21 -04:00
parent 2680502465
commit b3581d11ed
5 changed files with 86 additions and 24 deletions

View File

@@ -20,6 +20,7 @@
// *********************************************************************** */
#include "mfem.hpp"
#include <memory>
#include <string>
#include <stdexcept>
@@ -102,6 +103,13 @@ void PolySolver::assembleNonlinearForm() {
auto nonlinearIntegrator = std::make_unique<polyMFEMUtils::NonlinearPowerIntegrator>(*nonlinearSourceCoeff, n);
compositeIntegrator->add_integrator(nonlinearIntegrator.release());
// Add the contraint term \gamma(\nabla \theta(0)\cdot\nabla v(0))^{2}
double gamma = config.get<double>("Poly:Solver:Constraint:Gamma", 1e2);
auto constraintIntegrator = std::make_unique<polyMFEMUtils::BilinearIntegratorWrapper>(
new polyMFEMUtils::ConstraintIntegrator(gamma, &mesh)
);
compositeIntegrator->add_integrator(constraintIntegrator.release());
nonlinearForm->AddDomainIntegrator(compositeIntegrator.release());
}
@@ -110,7 +118,7 @@ void PolySolver::solve(){
mfem::FunctionCoefficient initCoeff (
[this](const mfem::Vector &x) {
double r = x.Norml2();
double theta = laneEmden::thetaSerieseExpansion(r, n, 12);
double theta = laneEmden::thetaSerieseExpansion(r, n, 10);
return theta;
// double radius = Probe::getMeshRadius(mesh);
// double u = 1/radius;