feat(elements): implement certified full-integration Hex8 kernel

This commit is contained in:
KOKO\Mimi
2026-10-09 01:03:43 +09:00
parent df0388ae2f
commit 9088af7b32
8 changed files with 1337 additions and 2 deletions
+32
View File
@@ -0,0 +1,32 @@
#ifndef FESA_ELEMENTS_HEX8_GEOMETRY_H_
#define FESA_ELEMENTS_HEX8_GEOMETRY_H_
#include <array>
#include "fesa/elements/hex8_element.h"
namespace fesa::hex8_internal {
using Triple = std::array<double, 3>;
using Tensor = std::array<Triple, 3>;
inline constexpr int kNodeSigns[8][3] = {{-1, -1, -1}, {1, -1, -1}, {1, 1, -1},
{-1, 1, -1}, {-1, -1, 1}, {1, -1, 1},
{1, 1, 1}, {-1, 1, 1}};
/// @brief Distinguishes a witness from an exhausted conservative certificate.
enum class Certificate { kPositive, kNonpositive, kUncertain, kNonfinite };
/// @brief Certifies the closed natural cube with interval Bernstein bounds.
/// @note Current addition rounding is enclosed when displacement is supplied.
Certificate Certify(const Hex8Element::Coordinates& coordinates,
const Vector* displacement = nullptr);
/// @brief Evaluates trilinear shapes and natural derivatives in source order.
void Shape(const Triple& natural, std::array<double, 8>& values,
std::array<Triple, 8>& derivatives);
/// @brief Computes a three-column map Jacobian using translated coordinates.
Tensor Jacobian(const Hex8Element::Coordinates& coordinates,
const std::array<Triple, 8>& derivatives);
/// @brief Computes the signed determinant; no absolute value or clamp.
double Determinant(const Tensor& matrix);
/// @brief Computes the inverse for an already validated positive determinant.
Tensor Inverse(const Tensor& matrix, double determinant);
} // namespace fesa::hex8_internal
#endif // FESA_ELEMENTS_HEX8_GEOMETRY_H_