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:
@@ -1068,6 +1068,29 @@ namespace mean_field::operators {
|
||||
return m_generatedVolumeDisplacement;
|
||||
}
|
||||
|
||||
void PreparedStellarEquilibriumOperator::BuildVolumeDisplacementDirection(
|
||||
const mfem::Vector &surfaceDeformationDirection,
|
||||
mfem::Vector &volumeDisplacementDirection
|
||||
) const {
|
||||
VerifyPrepared();
|
||||
MFEM_VERIFY(
|
||||
surfaceDeformationDirection.Size() == m_domainDeformation.parameterCount(),
|
||||
"PreparedStellarEquilibriumOperator received a surface-deformation direction with the wrong size."
|
||||
);
|
||||
validate_finite_vector(
|
||||
surfaceDeformationDirection,
|
||||
"PreparedStellarEquilibriumOperator received a non-finite surface-deformation direction."
|
||||
);
|
||||
MFEM_VERIFY(
|
||||
volumeDisplacementDirection.Size() == m_domainDeformation.volumeDisplacementSize(),
|
||||
"PreparedStellarEquilibriumOperator received a volume-displacement workspace with the wrong size."
|
||||
);
|
||||
|
||||
m_domainDeformation.applyJacobian(
|
||||
m_surfaceDeformationParameters, surfaceDeformationDirection, volumeDisplacementDirection
|
||||
);
|
||||
}
|
||||
|
||||
const mfem::Vector &PreparedStellarEquilibriumOperator::GetFullMechanicalResidual() const {
|
||||
VerifyPrepared();
|
||||
return m_fullMechanicalResidual;
|
||||
|
||||
Reference in New Issue
Block a user