#ifndef FESA_ELEMENTS_HEX8_GEOMETRY_H_ #define FESA_ELEMENTS_HEX8_GEOMETRY_H_ #include #include "fesa/elements/hex8_element.h" namespace fesa::hex8_internal { using Triple = std::array; using Tensor = std::array; 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, const Vector* displacement_low = nullptr); /// @brief Evaluates trilinear shapes and natural derivatives in source order. void Shape(const Triple& natural, std::array& values, std::array& derivatives); /// @brief Computes a three-column map Jacobian using translated coordinates. Tensor Jacobian(const Hex8Element::Coordinates& coordinates, const std::array& 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_