feat(surface): surface deformation prescriptions
restricted the unknown state vector to surface deformation and implemented one prescription, NodalRadialSurface, while the full volumetric displacment field is reconstructed analytically from that. This reduced the number of degrees of freedom in the system by a factor of 80 while also removing many null vectors from the system.
This commit is contained in:
@@ -4,6 +4,7 @@ module;
|
||||
#include <concepts>
|
||||
#include <cstdint>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include <mfem.hpp>
|
||||
|
||||
@@ -18,7 +19,6 @@ export import :operators.context.gravity_field;
|
||||
export import :operators.gravity_field;
|
||||
export import :operators.gravity_field_jacobian;
|
||||
export import :operators.prepared_barotropic_closure;
|
||||
export import :operators.prepared_centering_constraint;
|
||||
export import :operators.prepared_displacement_residual;
|
||||
export import :operators.prepared_hydrostatic_equilibrium;
|
||||
export import :operators.prepared_mass_normalization;
|
||||
@@ -37,7 +37,7 @@ export namespace mean_field::operators {
|
||||
struct StellarEquilibriumDependencies final {
|
||||
StellarEquilibriumDependencyStamp discretization;
|
||||
StellarEquilibriumDependencyStamp density;
|
||||
StellarEquilibriumDependencyStamp displacement;
|
||||
StellarEquilibriumDependencyStamp surfaceDeformation;
|
||||
StellarEquilibriumDependencyStamp gravityGradient;
|
||||
StellarEquilibriumDependencyStamp gravityPotential;
|
||||
StellarEquilibriumDependencyStamp enthalpy;
|
||||
@@ -55,17 +55,18 @@ export namespace mean_field::operators {
|
||||
PreparedDisplacementResidualReport displacement;
|
||||
PreparedMassNormalizationReport massNormalization;
|
||||
PreparedSurfaceConstraintReport surfaceConstraint;
|
||||
PreparedCenteringConstraintReport centeringConstraint;
|
||||
deformation::DomainDeformationGeometryReport generatedGeometry;
|
||||
StellarEquilibriumDependencyStamp generatedDisplacement;
|
||||
bool generatedVolumeDisplacement{false};
|
||||
bool assembledResidual{false};
|
||||
|
||||
[[nodiscard]] bool DidAnyChildWork() const noexcept {
|
||||
return gravity.DidAnyWork() || barotropicClosure.DidAnyWork() || hydrostatic.DidAnyWork() ||
|
||||
displacement.DidAnyWork() || massNormalization.DidAnyWork() || surfaceConstraint.DidAnyWork() ||
|
||||
centeringConstraint.DidAnyWork();
|
||||
displacement.DidAnyWork() || massNormalization.DidAnyWork() || surfaceConstraint.DidAnyWork();
|
||||
}
|
||||
|
||||
[[nodiscard]] bool DidAnyWork() const noexcept {
|
||||
return DidAnyChildWork() || assembledResidual;
|
||||
return DidAnyChildWork() || generatedVolumeDisplacement || assembledResidual;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -73,11 +74,13 @@ export namespace mean_field::operators {
|
||||
std::uint64_t residualAssemblies{0};
|
||||
std::uint64_t residualApplications{0};
|
||||
std::uint64_t jacobianApplications{0};
|
||||
std::uint64_t generatedGeometryBuilds{0};
|
||||
|
||||
constexpr auto operator<=>(const PreparedStellarEquilibriumStatistics &) const = default;
|
||||
};
|
||||
|
||||
using StellarEquilibriumLayout = utils::blocks::form_layout<utils::blocks::barotropic_equilibrium_form>;
|
||||
using StellarEquilibriumLayout =
|
||||
utils::blocks::form_layout<utils::blocks::surface_deformed_stellar_equilibrium_form>;
|
||||
|
||||
class PreparedStellarEquilibriumOperator final : public mfem::Operator {
|
||||
public:
|
||||
@@ -99,7 +102,8 @@ export namespace mean_field::operators {
|
||||
domainMapper,
|
||||
stellarModel.equationOfState(),
|
||||
stellarModel.targetMass(),
|
||||
PressureSurfaceConstraintView{stellarModel.compiledSurfaceConstraint()}
|
||||
PressureSurfaceConstraintView{stellarModel.compiledSurfaceConstraint()},
|
||||
deformation::PreparedDomainDeformationRuntime{stellarModel.compileDomainDeformation(f)}
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -138,19 +142,27 @@ export namespace mean_field::operators {
|
||||
[[nodiscard]] const PreparedDisplacementResidualOperator &GetDisplacementOperator() const noexcept;
|
||||
[[nodiscard]] const PreparedMassNormalizationOperator &GetMassNormalizationOperator() const noexcept;
|
||||
[[nodiscard]] const PreparedPressureSurfaceConstraint &GetSurfaceConstraintOperator() const noexcept;
|
||||
[[nodiscard]] const PreparedCenteringConstraint &GetCenteringConstraintOperator() const noexcept;
|
||||
[[nodiscard]] const deformation::PreparedDomainDeformationRuntime &GetDomainDeformation() const noexcept;
|
||||
[[nodiscard]] const mfem::Vector &GetSurfaceDeformationParameters() const;
|
||||
[[nodiscard]] const mfem::Vector &GetGeneratedVolumeDisplacement() const;
|
||||
[[nodiscard]] const mfem::Vector &GetFullMechanicalResidual() const;
|
||||
[[nodiscard]] const StellarEquilibriumDependencyStamp &GetGeneratedDisplacementDependency() const;
|
||||
|
||||
private:
|
||||
struct ConstructionData;
|
||||
|
||||
static ConstructionData MakeConstructionData(fem::FEM &f);
|
||||
static ConstructionData MakeConstructionData(
|
||||
fem::FEM &f,
|
||||
deformation::PreparedDomainDeformationRuntime domainDeformation
|
||||
);
|
||||
|
||||
PreparedStellarEquilibriumOperator(
|
||||
fem::FEM &f,
|
||||
const mapping::DomainMapper &domainMapper,
|
||||
const eos::Polytrope &equationOfState,
|
||||
double targetMass,
|
||||
PressureSurfaceConstraintView surfaceConstraint
|
||||
PressureSurfaceConstraintView surfaceConstraint,
|
||||
deformation::PreparedDomainDeformationRuntime domainDeformation
|
||||
);
|
||||
|
||||
PreparedStellarEquilibriumOperator(
|
||||
@@ -177,9 +189,14 @@ export namespace mean_field::operators {
|
||||
PreparedDisplacementResidualOperator m_displacementOperator;
|
||||
PreparedMassNormalizationOperator m_massNormalizationOperator;
|
||||
PreparedPressureSurfaceConstraint m_surfaceConstraintOperator;
|
||||
PreparedCenteringConstraint m_centeringConstraintOperator;
|
||||
deformation::PreparedDomainDeformationRuntime m_domainDeformation;
|
||||
|
||||
StellarEquilibriumDependencies m_preparedDependencies;
|
||||
StellarEquilibriumDependencyStamp m_generatedDisplacementDependency;
|
||||
deformation::DomainDeformationGeometryReport m_generatedGeometryReport;
|
||||
mfem::Vector m_surfaceDeformationParameters;
|
||||
mfem::Vector m_generatedVolumeDisplacement;
|
||||
mfem::Vector m_fullMechanicalResidual;
|
||||
mfem::Vector m_cachedResidual;
|
||||
double m_targetMass{0.0};
|
||||
|
||||
@@ -189,5 +206,9 @@ export namespace mean_field::operators {
|
||||
mfem::Vector m_gravityState;
|
||||
|
||||
mutable mfem::Vector m_gravityDirection;
|
||||
mutable mfem::Vector m_volumeDisplacementDirection;
|
||||
mutable mfem::Vector m_fullMechanicalAction;
|
||||
mutable mfem::Vector m_surfaceShapeAction;
|
||||
mutable mfem::Vector m_pullbackDerivativeAction;
|
||||
};
|
||||
} // namespace mean_field::operators
|
||||
|
||||
Reference in New Issue
Block a user