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

@@ -10,7 +10,7 @@ libPolySolver = static_library('polySolver',
polySolver_sources,
include_directories : include_directories('./public'),
cpp_args: ['-fvisibility=default'],
dependencies: [mfem_dep, meshio_dep, polycoeff_dep, polyutils_dep, warning_control_dep, probe_dep, quill_dep, config_dep],
dependencies: [mfem_dep, meshio_dep, polycoeff_dep, polyutils_dep, macros_dep, probe_dep, quill_dep, config_dep],
install: true
)
@@ -18,5 +18,5 @@ polysolver_dep = declare_dependency(
include_directories : include_directories('./public'),
link_with : libPolySolver,
sources : polySolver_sources,
dependencies : [mfem_dep, meshio_dep, polycoeff_dep, polyutils_dep, warning_control_dep, probe_dep, quill_dep, config_dep]
dependencies : [mfem_dep, meshio_dep, polycoeff_dep, polyutils_dep, macros_dep, probe_dep, quill_dep, config_dep]
)

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;