feat(support): continued migration to new field dof support system
mass normaliztion, gravity, displacement, and hydrostatic equilibrium are now migrated
This commit is contained in:
@@ -458,9 +458,10 @@ namespace {
|
||||
const mfem::Vector projection_rhs = assemble_monopole_projection_rhs(f, displacement, mass, stellar_radius);
|
||||
|
||||
mean_field::operators::PreparedMappedHDivMassOperator mass_operator(f, *f.domainMapperStateless);
|
||||
mass_operator.Prepare(displacement_true);
|
||||
mass_operator.Prepare(mass_operator.GetDisplacementMap().gather(displacement_true));
|
||||
const mfem::Vector reduced_projection_rhs = mass_operator.GetFluxMap().gather(projection_rhs);
|
||||
|
||||
mfem::Vector projected_gradient(f.gravityFluxFes->GetTrueVSize());
|
||||
mfem::Vector projected_gradient(mass_operator.Width());
|
||||
projected_gradient = 0.0;
|
||||
|
||||
mfem::CGSolver solver(f.gravityFluxFes->GetComm());
|
||||
@@ -469,13 +470,13 @@ namespace {
|
||||
solver.SetAbsTol(1.0e-12);
|
||||
solver.SetMaxIter(2000);
|
||||
solver.SetPrintLevel(0);
|
||||
solver.Mult(projection_rhs, projected_gradient);
|
||||
solver.Mult(reduced_projection_rhs, projected_gradient);
|
||||
|
||||
mfem::Vector projection_residual;
|
||||
mass_operator.Mult(projected_gradient, projection_residual);
|
||||
projection_residual -= projection_rhs;
|
||||
projection_residual -= reduced_projection_rhs;
|
||||
|
||||
const double source_norm = global_norm(projection_rhs, f.gravityFluxFes->GetComm());
|
||||
const double source_norm = global_norm(reduced_projection_rhs, f.gravityFluxFes->GetComm());
|
||||
const double residual_norm = global_norm(projection_residual, f.gravityFluxFes->GetComm());
|
||||
const double relative_residual = residual_norm / std::max(source_norm, std::numeric_limits<double>::epsilon());
|
||||
|
||||
@@ -487,7 +488,7 @@ namespace {
|
||||
|
||||
REQUIRE(std::isfinite(relative_residual));
|
||||
REQUIRE(relative_residual < 1.0e-8);
|
||||
return projected_gradient;
|
||||
return mass_operator.GetFluxMap().scatter(projected_gradient);
|
||||
}
|
||||
|
||||
double mapped_hdiv_relative_error(
|
||||
@@ -502,7 +503,7 @@ namespace {
|
||||
displacement.GetTrueDofs(displacement_true);
|
||||
|
||||
mean_field::operators::PreparedMappedHDivMassOperator mass_operator(f, *f.domainMapperStateless);
|
||||
mass_operator.Prepare(displacement_true);
|
||||
mass_operator.Prepare(mass_operator.GetDisplacementMap().gather(displacement_true));
|
||||
|
||||
mfem::Vector difference(computed);
|
||||
difference -= reference;
|
||||
@@ -510,13 +511,15 @@ namespace {
|
||||
mfem::Vector difference_action;
|
||||
mfem::Vector reference_action;
|
||||
|
||||
mass_operator.Mult(difference, difference_action);
|
||||
mass_operator.Mult(reference, reference_action);
|
||||
const mfem::Vector reduced_difference = mass_operator.GetFluxMap().gather(difference);
|
||||
const mfem::Vector reduced_reference = mass_operator.GetFluxMap().gather(reference);
|
||||
mass_operator.Mult(reduced_difference, difference_action);
|
||||
mass_operator.Mult(reduced_reference, reference_action);
|
||||
|
||||
MPI_Comm communicator = f.gravityFluxFes->GetComm();
|
||||
|
||||
const double difference_energy = global_dot(difference, difference_action, communicator);
|
||||
const double reference_energy = global_dot(reference, reference_action, communicator);
|
||||
const double difference_energy = global_dot(reduced_difference, difference_action, communicator);
|
||||
const double reference_energy = global_dot(reduced_reference, reference_action, communicator);
|
||||
|
||||
REQUIRE(difference_energy >= -1.0e-12 * std::abs(reference_energy));
|
||||
REQUIRE(reference_energy > 0.0);
|
||||
@@ -853,7 +856,7 @@ namespace {
|
||||
|
||||
TEST_CASE(
|
||||
"New Gravity Monopole Accuracy And Projection Floor",
|
||||
tags::gravity &tags::analytic_comparison &tags::initialization &tags::integration &tags::accuracy
|
||||
tags::gravity_analytic_accuracy
|
||||
) {
|
||||
auto args = test_utils::setup_args();
|
||||
args.p.rtol = 1.0e-13;
|
||||
@@ -1022,7 +1025,7 @@ TEST_CASE(
|
||||
|
||||
TEST_CASE(
|
||||
"New Gravity Virial Consistency Across Volume Preserving Deformation",
|
||||
tags::gravity &tags::self_consistency &tags::initialization &tags::integration &tags::accuracy
|
||||
tags::gravity_consistency &tags::accuracy
|
||||
) {
|
||||
auto args = test_utils::setup_args();
|
||||
args.p.rtol = 1.0e-13;
|
||||
|
||||
Reference in New Issue
Block a user