74 lines
2.6 KiB
C++
74 lines
2.6 KiB
C++
#ifndef FESA_LOADS_CONCENTRATED_NODAL_LOAD_H_
|
|
#define FESA_LOADS_CONCENTRATED_NODAL_LOAD_H_
|
|
|
|
#include <array>
|
|
#include <cstddef>
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
#include "fesa/core/diagnostic.h"
|
|
#include "fesa/loads/load.h"
|
|
#include "fesa/model/source_target_resolver.h"
|
|
|
|
namespace fesa {
|
|
|
|
/// @brief Emits global concentrated nodal components for one source target.
|
|
class ConcentratedNodalLoad final : public Load {
|
|
public:
|
|
/// @brief Creates a six-component global concentrated nodal load.
|
|
ConcentratedNodalLoad(SourceTargetQuery target,
|
|
std::array<double, 6> global_components,
|
|
std::size_t source_order);
|
|
|
|
/// @brief Creates one parsed CLOAD component while preserving diagnostics.
|
|
ConcentratedNodalLoad(SourceTargetQuery target, int source_dof,
|
|
double magnitude, std::size_t source_order,
|
|
SourceLocation location,
|
|
std::optional<EntityIndex> amplitude_index = {},
|
|
std::string amplitude_name_raw = {},
|
|
SourceLocation amplitude_location = {});
|
|
|
|
/// @brief Computes target-major, component-minor full-DOF contributions.
|
|
Result<std::vector<LoadContribution>> ComputeContributions(
|
|
const LoadContext& context) const override;
|
|
|
|
/// @brief Returns the immutable source target query.
|
|
const SourceTargetQuery& Target() const noexcept;
|
|
|
|
/// @brief Returns six global force/moment components without reordering.
|
|
const std::array<double, 6>& GlobalComponents() const noexcept;
|
|
|
|
/// @brief Returns the stable CLOAD declaration order.
|
|
std::size_t SourceOrder() const noexcept;
|
|
|
|
/// @brief Returns the source location used by structured diagnostics.
|
|
const SourceLocation& Location() const noexcept;
|
|
|
|
/// @brief Returns a model-level amplitude index when one was specified.
|
|
std::optional<EntityIndex> AmplitudeIndex() const noexcept {
|
|
return amplitude_index_;
|
|
}
|
|
/// @brief Returns preserved CLOAD amplitude option spelling.
|
|
const std::string& AmplitudeName() const noexcept {
|
|
return amplitude_name_raw_;
|
|
}
|
|
/// @brief Returns the source location of the CLOAD amplitude option.
|
|
const SourceLocation& AmplitudeLocation() const noexcept {
|
|
return amplitude_location_;
|
|
}
|
|
|
|
private:
|
|
SourceTargetQuery target_;
|
|
std::array<double, 6> global_components_{};
|
|
std::size_t source_order_;
|
|
SourceLocation location_{};
|
|
int source_dof_{0};
|
|
std::optional<EntityIndex> amplitude_index_;
|
|
std::string amplitude_name_raw_;
|
|
SourceLocation amplitude_location_;
|
|
};
|
|
|
|
} // namespace fesa
|
|
|
|
#endif // FESA_LOADS_CONCENTRATED_NODAL_LOAD_H_
|