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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user