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 &density,
|
||||
mfem::Vector &action
|
||||
@@ -29,6 +30,7 @@ export namespace mean_field::operators {
|
||||
) const;
|
||||
|
||||
[[nodiscard]] bool IsPrepared() const noexcept;
|
||||
[[nodiscard]] bool HasVariationData() const noexcept;
|
||||
[[nodiscard]] std::uint64_t GetPreparationCount() const noexcept;
|
||||
|
||||
[[nodiscard]] const field::FieldDofMap &GetDensityMap() const noexcept;
|
||||
@@ -41,6 +43,8 @@ export namespace mean_field::operators {
|
||||
) const override;
|
||||
|
||||
private:
|
||||
enum class PreparationMode : std::uint8_t { primal, linearization };
|
||||
|
||||
struct ElementPAData {
|
||||
int element_id{-1};
|
||||
|
||||
@@ -64,6 +68,11 @@ export namespace mean_field::operators {
|
||||
mfem::Vector quadrature_data;
|
||||
};
|
||||
|
||||
void PrepareImpl(
|
||||
const mfem::Vector &displacement,
|
||||
PreparationMode mode
|
||||
);
|
||||
|
||||
const fem::FEM &m_fem;
|
||||
const mapping::DomainMapper &m_domain_mapper;
|
||||
|
||||
@@ -77,6 +86,11 @@ export namespace mean_field::operators {
|
||||
mutable mfem::Vector m_density_true;
|
||||
mutable mfem::Vector m_potential_true;
|
||||
mutable mfem::Vector m_action_true;
|
||||
mutable mfem::Vector m_potential_local;
|
||||
mutable mfem::Vector m_local_action;
|
||||
mutable mfem::Vector m_element_input;
|
||||
mutable mfem::Vector m_quadrature_action;
|
||||
mutable mfem::Vector m_element_action;
|
||||
mutable mfem::Vector m_density_local;
|
||||
mutable mfem::Vector m_displacement_variation_local;
|
||||
mutable mfem::Vector m_local_variation_action;
|
||||
@@ -90,5 +104,6 @@ export namespace mean_field::operators {
|
||||
|
||||
std::uint64_t m_preparation_count{0};
|
||||
bool m_is_prepared{false};
|
||||
bool m_has_variation_data{false};
|
||||
};
|
||||
} // namespace mean_field::operators
|
||||
|
||||
Reference in New Issue
Block a user