feat(meshIO): LinearRescale method added

Rescaling a mesh by a linear transformation is a useful option so that we can start with a single "base" mesh and then rescale it to the dimensions needed for our problem. This commit adds the LinearRescale option too meshIO so that a unit sphere can be turned into a sphere of arbitrary radius (as an example).
This commit is contained in:
2025-02-24 16:35:39 -05:00
parent 83213f961b
commit 6416d95260
3 changed files with 38 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ const std::string SPHERICAL_MESH = std::string(getenv("MESON_SOURCE_ROOT")) + "/
PolySolver::PolySolver(double n, double order)
: n(n),
order(order),
meshIO(SPHERICAL_MESH),
meshIO(SPHERICAL_MESH, 5),
mesh(meshIO.GetMesh()),
feCollection(std::make_unique<mfem::H1_FECollection>(order, mesh.SpaceDimension())),
feSpace(std::make_unique<mfem::FiniteElementSpace>(&mesh, feCollection.get())),
@@ -33,6 +33,7 @@ PolySolver::PolySolver(double n, double order)
}())),
nonLinearSourceCoeff(std::make_unique<mfem::ConstantCoefficient>(1.0)),
gaussianCoeff(std::make_unique<polyMFEMUtils::GaussianCoefficient>(0.1)) {
assembleNonlinearForm();
assembleConstraintForm();
}