perf(hex8): defer optional paired tangent until a valid linear trial
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#ifndef FESA_SRC_FESA_ELEMENTS_HEX8_LINEAR_TANGENT_CACHE_H_
|
||||
#define FESA_SRC_FESA_ELEMENTS_HEX8_LINEAR_TANGENT_CACHE_H_
|
||||
|
||||
#include <mutex>
|
||||
|
||||
#include "fesa/math/matrix.h"
|
||||
|
||||
namespace fesa::hex8_internal {
|
||||
/// @brief Shares one immutable paired Hessian among identical element copies.
|
||||
/// @note Only call_once preparation writes. Linear readers synchronize through
|
||||
/// the flag; nonlinear trials do not access this optional state. At most two
|
||||
/// 24-by-24 matrices (9216 value bytes) are retained after successful preparation.
|
||||
struct LinearTangentCache {
|
||||
std::once_flag preparation;
|
||||
bool ready{false};
|
||||
Matrix high{0U, 0U};
|
||||
Matrix low{0U, 0U};
|
||||
};
|
||||
} // namespace fesa::hex8_internal
|
||||
|
||||
#endif // FESA_SRC_FESA_ELEMENTS_HEX8_LINEAR_TANGENT_CACHE_H_
|
||||
Reference in New Issue
Block a user