59 lines
2.1 KiB
C++
59 lines
2.1 KiB
C++
#ifndef FESA_ELEMENTS_HEX8_DEFINITION_H_
|
|
#define FESA_ELEMENTS_HEX8_DEFINITION_H_
|
|
|
|
#include <array>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
#include "fesa/elements/element_definition.h"
|
|
|
|
namespace fesa {
|
|
/// @brief Owns source-safe eight-node Solid topology without numerical state.
|
|
class Hex8Definition final : public ElementDefinition {
|
|
public:
|
|
/// @brief Constructs a semantic candidate in source connectivity order.
|
|
Hex8Definition(SourceEntityId source, std::array<EntityIndex, 8> nodes,
|
|
EntityIndex material, EntityIndex section,
|
|
SourceLocation source_location)
|
|
: source_id{std::move(source)},
|
|
node_indices{nodes},
|
|
material_index{material},
|
|
section_index{section},
|
|
location{std::move(source_location)},
|
|
property_index_{section},
|
|
node_indices_view_{nodes.begin(), nodes.end()} {}
|
|
ElementDefinitionKind Kind() const noexcept override {
|
|
return ElementDefinitionKind::kHex8;
|
|
}
|
|
const SourceEntityId& SourceId() const noexcept override { return source_id; }
|
|
std::string_view SourceElementType() const noexcept override {
|
|
return "C3D8";
|
|
}
|
|
const std::vector<EntityIndex>& NodeIndices() const noexcept override {
|
|
return node_indices_view_;
|
|
}
|
|
EntityIndex MaterialIndex() const noexcept override { return material_index; }
|
|
EntityIndex PropertyIndex() const noexcept override {
|
|
return property_index_;
|
|
}
|
|
|
|
SourceEntityId source_id;
|
|
std::array<EntityIndex, 8> node_indices;
|
|
EntityIndex material_index;
|
|
EntityIndex section_index;
|
|
SourceLocation location;
|
|
|
|
private:
|
|
friend class Domain;
|
|
/// @brief Synchronizes candidate topology with the immutable base view.
|
|
void SynchronizeNodeIndices() {
|
|
node_indices_view_.assign(node_indices.begin(), node_indices.end());
|
|
}
|
|
/// @brief Binds the local Solid section to the unified property collection.
|
|
void SetPropertyIndex(EntityIndex index) noexcept { property_index_ = index; }
|
|
EntityIndex property_index_;
|
|
std::vector<EntityIndex> node_indices_view_;
|
|
};
|
|
} // namespace fesa
|
|
#endif // FESA_ELEMENTS_HEX8_DEFINITION_H_
|