feat(preconditioner): major work on preconditioner system
first preconditioner MVP
This commit is contained in:
@@ -18,6 +18,7 @@ export namespace mean_field::operators {
|
||||
);
|
||||
|
||||
void Prepare(const mfem::Vector &displacement);
|
||||
void PreparePrimal(const mfem::Vector &displacement);
|
||||
void Mult(
|
||||
const mfem::Vector &gravity_gradient,
|
||||
mfem::Vector &action
|
||||
@@ -31,12 +32,15 @@ export namespace mean_field::operators {
|
||||
void AssembleTrueDiagonal(mfem::Vector &diagonal) const;
|
||||
|
||||
[[nodiscard]] bool IsPrepared() const noexcept;
|
||||
[[nodiscard]] bool HasVariationData() const noexcept;
|
||||
[[nodiscard]] std::uint64_t GetPreparationCount() const noexcept;
|
||||
|
||||
[[nodiscard]] const field::FieldDofMap &GetFluxMap() const noexcept;
|
||||
[[nodiscard]] const field::FieldDofMap &GetDisplacementMap() const noexcept;
|
||||
|
||||
private:
|
||||
enum class PreparationMode : std::uint8_t { primal, linearization };
|
||||
|
||||
struct ElementVariationData {
|
||||
int elementId{-1};
|
||||
mfem::Array<int> gravityGradientDofs;
|
||||
@@ -51,6 +55,10 @@ export namespace mean_field::operators {
|
||||
};
|
||||
|
||||
void PrepareVariationData();
|
||||
void PrepareImpl(
|
||||
const mfem::Vector &displacement,
|
||||
PreparationMode mode
|
||||
);
|
||||
|
||||
const fem::FEM &m_fem;
|
||||
const mapping::DomainMapper &m_domain_mapper;
|
||||
@@ -68,6 +76,9 @@ export namespace mean_field::operators {
|
||||
mutable mfem::Vector m_flux_true;
|
||||
mutable mfem::Vector m_action_true;
|
||||
mutable mfem::Vector m_domain_action_true;
|
||||
mutable mfem::Vector m_flux_local;
|
||||
mutable mfem::Vector m_action_local;
|
||||
mutable mfem::Vector m_domain_action_local;
|
||||
mfem::Vector m_displacement_true;
|
||||
std::vector<ElementVariationData> m_variationElements;
|
||||
|
||||
@@ -86,5 +97,7 @@ export namespace mean_field::operators {
|
||||
mutable mfem::DenseMatrix m_massTensorVariation;
|
||||
std::uint64_t m_preparation_count{0};
|
||||
bool m_is_prepared{false};
|
||||
bool m_has_variation_data{false};
|
||||
bool m_single_rank{true};
|
||||
};
|
||||
} // namespace mean_field::operators
|
||||
|
||||
Reference in New Issue
Block a user