Files
FESADev/include/fesa/elements/element.h
T

70 lines
2.1 KiB
C++

#ifndef FESA_ELEMENTS_ELEMENT_H_
#define FESA_ELEMENTS_ELEMENT_H_
#include <array>
#include <optional>
#include <variant>
#include <vector>
#include "fesa/core/status.h"
#include "fesa/elements/element_dof_layout.h"
#include "fesa/elements/mitc4_drilling_mode.h"
#include "fesa/math/matrix.h"
#include "fesa/math/vector.h"
#include "fesa/results/result_records.h"
#include "fesa/results/solid_result_records.h"
namespace fesa {
/// @brief Carries one element-local stiffness in its declared DOF order.
struct ElementStiffnessContribution {
ElementDofLayout layout;
Matrix values;
};
/// @brief Keeps beam recovery locations in their distinct row collections.
struct BeamElementResultRows {
std::vector<EndpointResultRow> endpoint_rows;
std::vector<GaussResultRow> gauss_rows;
std::vector<StressS11Row> stress_rows;
};
/// @brief Keeps physical shell rows separate from numerical drilling data.
struct ShellElementResultRows {
std::vector<ShellResultRow> rows;
double physical_strain_energy{0.0};
std::optional<Mitc4DrillingMode> drilling_mode;
std::array<double, 3> drilling_moment{};
};
/// @brief Selects the physical recovery shape of one runtime element.
using ElementResultPayload =
std::variant<BeamElementResultRows, ShellElementResultRows,
SolidElementResultRows>;
/// @brief Carries stable source identity with one typed recovery payload.
struct ElementResultBundle {
SourceEntityId source_id;
ElementResultPayload payload;
};
/// @brief Defines the numerical contract consumed by solver pipeline owners.
class Element {
public:
virtual ~Element() = default;
/// @brief Returns the stable element-local DOF ordering.
virtual const ElementDofLayout& DofLayout() const noexcept = 0;
/// @brief Computes the finite stiffness in the declared local ordering.
virtual Result<ElementStiffnessContribution> ComputeStiffness() const = 0;
/// @brief Recovers typed physical rows from element-local global DOFs.
virtual Result<ElementResultBundle> Recover(
const Vector& element_displacement) const = 0;
};
} // namespace fesa
#endif // FESA_ELEMENTS_ELEMENT_H_