perf(jacobian-action): major updates to jacobian action application by removing redudant quadrature work. ~5x increase in speed
This commit is contained in:
@@ -22,6 +22,11 @@ export namespace mean_field::operators {
|
||||
const mfem::Vector &density,
|
||||
mfem::Vector &action
|
||||
) const override;
|
||||
void MultDisplacementVariationTrue(
|
||||
const mfem::Vector &densityTrue,
|
||||
const mfem::Vector &displacementVariationTrue,
|
||||
mfem::Vector &actionVariationTrue
|
||||
) const;
|
||||
|
||||
[[nodiscard]] bool IsPrepared() const noexcept;
|
||||
[[nodiscard]] std::uint64_t GetPreparationCount() const noexcept;
|
||||
@@ -41,13 +46,18 @@ export namespace mean_field::operators {
|
||||
|
||||
mfem::Array<int> density_dofs;
|
||||
mfem::Array<int> potential_dofs;
|
||||
mfem::Array<int> displacement_dofs;
|
||||
|
||||
mfem::DofTransformation *density_dof_transformation{nullptr};
|
||||
mfem::DofTransformation *potential_dof_transformation{nullptr};
|
||||
mfem::DofTransformation *displacement_dof_transformation{nullptr};
|
||||
|
||||
const mfem::IntegrationRule *integration_rule{nullptr};
|
||||
|
||||
// Rows are quadrature points; columns are element DOFs.
|
||||
mfem::DenseMatrix density_basis;
|
||||
mfem::DenseMatrix potential_basis;
|
||||
mfem::DenseMatrix inverse_element_jacobians;
|
||||
|
||||
// Contains quadrature weight, mesh Jacobian, mapped Jacobian,
|
||||
// and 4*pi*G.
|
||||
@@ -67,6 +77,15 @@ 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_density_local;
|
||||
mutable mfem::Vector m_displacement_variation_local;
|
||||
mutable mfem::Vector m_local_variation_action;
|
||||
mutable mfem::Vector m_element_density;
|
||||
mutable mfem::Vector m_element_displacement_variation;
|
||||
mutable mfem::Vector m_quadrature_variation_action;
|
||||
mutable mfem::Vector m_element_variation_action;
|
||||
mutable mfem::DenseMatrix m_reference_displacement_dshape;
|
||||
mutable mfem::DenseMatrix m_reference_displacement_jacobian;
|
||||
mfem::Vector m_displacement_true;
|
||||
|
||||
std::uint64_t m_preparation_count{0};
|
||||
|
||||
Reference in New Issue
Block a user