perf(allocations): reduced overall allocations by 95%, increaseed jacobian applicatin by 2x

This commit uses global pre allocated work space to dramatically reduce memory usage and allocation time
This commit is contained in:
2026-09-10 06:50:56 -04:00
parent b3c04d507a
commit 75cc638739
66 changed files with 207183 additions and 99552 deletions

View File

@@ -2785,6 +2785,22 @@ export namespace mean_field::operators {
return *m_physical;
}
void BuildVolumeDisplacementDirection(
const mfem::Vector &stateDirection,
mfem::Vector &volumeDisplacementDirection
) const {
if (stateDirection.Size() != Width()) {
throw std::invalid_argument(
"The prepared stellar-equilibrium root received a state direction with the wrong size."
);
}
const auto rootDirection = m_manifest.directionView(stateDirection);
m_physical->BuildVolumeDisplacementDirection(
rootDirection.block(utils::blocks::surface_deformation_field.parameters_term),
volumeDisplacementDirection
);
}
template <models::ModelSpecification Specification>
requires ModelType::template
containsSpecification<Specification> [[nodiscard]] const auto &GetPreparedContribution() const noexcept {