refactor: extract core domain dof modules

This commit is contained in:
NINI
2026-05-05 01:10:30 +09:00
parent 59dcc77a24
commit fd93bc35b0
20 changed files with 915 additions and 648 deletions
+81
View File
@@ -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