#ifndef FESA_ELEMENTS_NONLINEAR_MITC4_INERTIA_H_ #define FESA_ELEMENTS_NONLINEAR_MITC4_INERTIA_H_ #include #include #include "fesa/core/status.h" #include "fesa/elements/nonlinear_mitc4_shell.h" #include "fesa/math/matrix.h" #include "fesa/math/vector.h" #include "fesa/math/vector3.h" #include "fesa/model/model_types.h" namespace fesa { /// @brief Stores exact physical rotation-rate and drilling-null quantities. struct DynamicRotationKinematics { Vector3 director; Vector3 drill_null; Matrix null_gradient{3U, 3U}; /// @brief Stores D2 drill_null[velocity, velocity], without Dn[a]. Vector3 null_directional_second; Vector3 angular_velocity; Vector3 angular_acceleration; /// @brief Stores director derivatives in fixed-global chart directions. std::array director_first; std::array, 3> director_second; std::array, 3>, 3> director_third; }; /// @brief Evaluates exact finite-rotation rates and the unit drilling null. /// @param phi Fixed-global principal-chart rotation coordinate. /// @param initial_director Unit director at zero rotation. /// @param velocity Fixed-chart rotation-coordinate rate. /// @param acceleration Fixed-chart rotation-coordinate acceleration. /// @return Finite director/rates/null derivatives or a structured failure. [[nodiscard]] Result EvaluateDynamicRotation( const Vector3& phi, const Vector3& initial_director, const Vector3& velocity, const Vector3& acceleration); /// @brief Stores the nodal lumped kinetic-inertia quantities at one trial. struct NonlinearMitc4InertiaEvaluation { Matrix mass; Matrix position_tangent; Matrix velocity_tangent; Vector force; Vector convective_force; double kinetic_energy; Vector3 momentum; Vector3 angular_momentum; Vector3 momentum_rate; Vector3 angular_momentum_rate; /// @brief Stores uncancelled quadrature norm sums for balance checks. double momentum_rate_scale = 0.0; double angular_momentum_rate_scale = 0.0; }; /// @brief Evaluates finite-rotation nodal lumped inertia for one MITC4 shell. /// @note This object owns immutable reference geometry only, never analysis /// trial state. class NonlinearMitc4Inertia { public: /// @brief Creates a checked nodal lumped kinetic-mass evaluator. /// @param nodes Four non-owning nodes in source order. /// @param initial_frames Fixed proper node frames in source order. /// @param section Centered shell section with positive thickness. /// @param material Shell material used to retain the nonlinear-shell input /// contract. /// @param density Reference mass density, strictly positive and finite. /// @return A checked immutable evaluator or a structured model failure. static Result Create( std::array nodes, std::array initial_frames, const ShellSection& section, const LinearElasticMaterial& material, double density); /// @brief Evaluates physical nodal lumped inertia at a complete trial. /// @param trial Fixed-global translation and rotation coordinates. /// @param velocity24 Fixed-chart generalized physical velocity. /// @param physical_acceleration24 Fixed-chart generalized physical /// acceleration. /// @return Current mass, inertia force and exact partial tangents, or a /// fail-closed diagnostic. [[nodiscard]] Result Evaluate( const NonlinearMitc4TrialDofs& trial, const Vector& velocity24, const Vector& physical_acceleration24) const; private: NonlinearMitc4Inertia(std::array coordinates, std::array initial_frames, std::array initial_directors, double thickness, double density, SourceLocation source_location, std::string identity); std::array coordinates_; std::array initial_frames_; std::array initial_directors_; double thickness_; double density_; SourceLocation source_location_; std::string identity_; }; } // namespace fesa #endif // FESA_ELEMENTS_NONLINEAR_MITC4_INERTIA_H_