perf(hex8): cache immutable paired linear Hessian

This commit is contained in:
KOKO\Mimi
2026-10-09 23:55:01 +09:00
parent 5435acdde3
commit e878379c30
6 changed files with 76 additions and 3 deletions
+7
View File
@@ -180,6 +180,13 @@ Result<Hex8Element> Hex8Element::Create(EntityIndex index,
return Result<Hex8Element>::Failure(
candidate.Failure("Hex8 reference stiffness has an unrepresentable "
"positive diagonal."));
const Vector zero{24U};
const auto paired = candidate.EvaluateHighLow(zero, zero, false);
if (paired.HasValue()) {
candidate.paired_linear_tangent_high_ = paired.Value().high.tangent;
candidate.paired_linear_tangent_low_ = paired.Value().tangent_low;
candidate.paired_linear_tangent_ready_ = true;
}
return Result<Hex8Element>::Success(std::move(candidate));
}