fix(poly): increased default gamma and changed initial guess
The default gamma value has been upped to 1e4 which is enough to strongly constrain the solution to have zero slope at the core region. Further, the initial guess has been changed from a series expansion of theta to a simple quadratic that is one at origin and zero at the polytrope radius. This is faster to evaluate and seems to work just as well.
This commit is contained in:
@@ -104,7 +104,7 @@ void PolySolver::assembleNonlinearForm() {
|
||||
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);
|
||||
double gamma = config.get<double>("Poly:Solver:Constraint:Gamma", 1e4);
|
||||
auto constraintIntegrator = std::make_unique<polyMFEMUtils::BilinearIntegratorWrapper>(
|
||||
new polyMFEMUtils::ConstraintIntegrator(gamma, &mesh)
|
||||
);
|
||||
@@ -118,12 +118,12 @@ void PolySolver::solve(){
|
||||
mfem::FunctionCoefficient initCoeff (
|
||||
[this](const mfem::Vector &x) {
|
||||
double r = x.Norml2();
|
||||
double theta = laneEmden::thetaSerieseExpansion(r, n, 10);
|
||||
return theta;
|
||||
// double radius = Probe::getMeshRadius(mesh);
|
||||
// double u = 1/radius;
|
||||
// double theta = laneEmden::thetaSerieseExpansion(r, n, 10);
|
||||
// return theta;
|
||||
double radius = Probe::getMeshRadius(mesh);
|
||||
double u = 1/radius;
|
||||
|
||||
// return -std::pow((u*r), 2)+1.0;
|
||||
return -std::pow((u*r), 2)+1.0;
|
||||
}
|
||||
);
|
||||
u->ProjectCoefficient(initCoeff);
|
||||
|
||||
Reference in New Issue
Block a user