Files
FESADev/src/fesa/elements/hex8_geometry.h
T

34 lines
1.7 KiB
C++

#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,
const Vector* displacement_low = 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_