refactor: extract core domain dof modules
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
#pragma once
|
||||
|
||||
#include "fesa/Boundary/Boundary.hpp"
|
||||
#include "fesa/Core/Types.hpp"
|
||||
#include "fesa/Load/Load.hpp"
|
||||
#include "fesa/Property/Property.hpp"
|
||||
#include "fesa/Util/String.hpp"
|
||||
|
||||
#include <array>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace fesa {
|
||||
|
||||
struct Vec3 {
|
||||
Real x = 0.0;
|
||||
Real y = 0.0;
|
||||
Real z = 0.0;
|
||||
};
|
||||
|
||||
struct Node {
|
||||
GlobalId id = 0;
|
||||
Vec3 coordinates;
|
||||
};
|
||||
|
||||
enum class ElementType { MITC4 };
|
||||
|
||||
inline std::string elementTypeLabel(ElementType type) {
|
||||
switch (type) {
|
||||
case ElementType::MITC4:
|
||||
return "MITC4";
|
||||
}
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
struct Element {
|
||||
GlobalId id = 0;
|
||||
ElementType type = ElementType::MITC4;
|
||||
std::array<GlobalId, 4> node_ids{};
|
||||
std::string source_elset;
|
||||
};
|
||||
|
||||
struct NodeSet {
|
||||
std::string name;
|
||||
std::vector<GlobalId> node_ids;
|
||||
};
|
||||
|
||||
struct ElementSet {
|
||||
std::string name;
|
||||
std::vector<GlobalId> element_ids;
|
||||
};
|
||||
|
||||
struct Material {
|
||||
std::string name;
|
||||
Real elastic_modulus = 0.0;
|
||||
Real poisson_ratio = 0.0;
|
||||
};
|
||||
|
||||
struct StepDefinition {
|
||||
std::string name = "Step-1";
|
||||
std::string analysis_type = "linear_static";
|
||||
};
|
||||
|
||||
struct Domain {
|
||||
std::map<GlobalId, Node> nodes;
|
||||
std::map<GlobalId, Element> elements;
|
||||
std::map<std::string, NodeSet> node_sets;
|
||||
std::map<std::string, ElementSet> element_sets;
|
||||
std::map<std::string, Material> materials;
|
||||
std::vector<ShellSection> shell_sections;
|
||||
std::vector<BoundaryCondition> boundary_conditions;
|
||||
std::vector<NodalLoad> loads;
|
||||
std::vector<StepDefinition> steps;
|
||||
|
||||
static std::string key(const std::string& label) {
|
||||
return lower(trim(label));
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace fesa
|
||||
Reference in New Issue
Block a user