Snapshot optimized solver and audit diagnostics before numerical experiments
This commit is contained in:
@@ -142,6 +142,14 @@ export namespace mean_field::operators {
|
||||
const physics::RigidRotation &rotation
|
||||
);
|
||||
|
||||
HydrostaticEquilibriumPreparationResult TryPrepareReference(
|
||||
const context::hydrostatic::HydrostaticEquilibriumStateView &state,
|
||||
const context::hydrostatic::HydrostaticEquilibriumDependencies &dependencies,
|
||||
const physics::RigidRotation &rotation);
|
||||
PreparedHydrostaticEquilibriumReport PrepareReference(
|
||||
const context::hydrostatic::HydrostaticEquilibriumStateView &state,
|
||||
const context::hydrostatic::HydrostaticEquilibriumDependencies &dependencies,
|
||||
const physics::RigidRotation &rotation);
|
||||
void BuildResidual(mfem::Vector &residual) const;
|
||||
|
||||
void ApplyEnthalpyJacobianAction(
|
||||
@@ -179,6 +187,18 @@ export namespace mean_field::operators {
|
||||
mfem::Vector &action
|
||||
) const;
|
||||
|
||||
void ApplyDisplacementJacobianActionReference(
|
||||
const mfem::Vector &displacementVariation,
|
||||
mfem::Vector &action
|
||||
) const;
|
||||
// Previous cached pointwise implementation, retained for benchmarking
|
||||
// the tensor change separately from the older general mapping path.
|
||||
void ApplyDisplacementJacobianActionCachedReference(
|
||||
const mfem::Vector &displacementVariation, mfem::Vector &action
|
||||
) const;
|
||||
[[nodiscard]] int GetFastDisplacementElementCount() const noexcept;
|
||||
[[nodiscard]] int GetTensorDisplacementElementCount() const noexcept;
|
||||
|
||||
void ApplyCompleteJacobianAction(
|
||||
const mfem::Vector &enthalpyVariation,
|
||||
const mfem::Vector &gravityPotentialVariation,
|
||||
@@ -244,6 +264,10 @@ export namespace mean_field::operators {
|
||||
// Immutable reference values and gradients are shared by FE/rule.
|
||||
std::shared_ptr<const fem::ScalarReferenceTable> enthalpyReferenceTable;
|
||||
std::shared_ptr<const fem::ScalarReferenceTable> gravityPotentialReferenceTable;
|
||||
std::shared_ptr<const fem::ScalarReferenceTable> displacementReferenceTable;
|
||||
// Columns are quadrature points; each holds a column-major inverse
|
||||
// deformed element Jacobian. Empty for the general mapping path.
|
||||
mfem::DenseMatrix displacementInverseJacobians;
|
||||
|
||||
[[nodiscard]] const mfem::DenseMatrix &GetEnthalpyBasis() const {
|
||||
return enthalpyReferenceTable->GetValues();
|
||||
@@ -274,14 +298,24 @@ export namespace mean_field::operators {
|
||||
mfem::Vector bernoulliConstantJacobian;
|
||||
};
|
||||
|
||||
HydrostaticEquilibriumPreparationResult TryPrepareImpl(
|
||||
const context::hydrostatic::HydrostaticEquilibriumStateView &state,
|
||||
const context::hydrostatic::HydrostaticEquilibriumDependencies &dependencies,
|
||||
const physics::RigidRotation &rotation, bool useTensorPreparation);
|
||||
void PrepareStaticPlan();
|
||||
[[nodiscard]] std::optional<mapping::MappingStatus> PrepareGeometry();
|
||||
[[nodiscard]] bool PrepareAlgebraicJacobianBlocks();
|
||||
[[nodiscard]] std::optional<mapping::MappingStatus> PrepareGeometry(bool useTensorPreparation);
|
||||
[[nodiscard]] bool PrepareAlgebraicJacobianBlocks(bool useTensorPreparation);
|
||||
[[nodiscard]] bool PrepareRotation();
|
||||
[[nodiscard]] bool PrepareBaseState();
|
||||
[[nodiscard]] bool PrepareBaseState(bool useTensorPreparation);
|
||||
void FinalizeDisplacementJacobianPreparation();
|
||||
[[nodiscard]] bool AssembleCachedResidual();
|
||||
void VerifyPrepared() const;
|
||||
void ApplyDisplacementJacobianActionImpl(
|
||||
const mfem::Vector &displacementVariation, mfem::Vector &action, bool useFastPath, bool useTensorPath
|
||||
) const;
|
||||
|
||||
mutable mfem::DenseMatrix m_tensorDisplacementValuesAndGradients;
|
||||
mutable mfem::Vector m_tensorDisplacementWorkspace;
|
||||
|
||||
const fem::FEM &m_fem;
|
||||
const mapping::DomainMapper &m_domainMapper;
|
||||
@@ -307,6 +341,7 @@ export namespace mean_field::operators {
|
||||
|
||||
mutable PreparedHydrostaticCompleteJacobianStatistics m_completeJacobianStatistics;
|
||||
|
||||
bool m_preparedWithTensorPreparation{true};
|
||||
bool m_isPrepared{false};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user