This commit is contained in:
김경종
2026-06-10 10:03:11 +09:00
parent 87529c811a
commit 0912ee6f3b
174 changed files with 414 additions and 8544 deletions
-52
View File
@@ -1,52 +0,0 @@
#pragma once
#include <cstddef>
#include <cstdint>
#include <vector>
namespace fesa::core {
class AnalysisState {
public:
AnalysisState();
explicit AnalysisState(std::size_t dof_count);
std::size_t dofCount() const noexcept;
void resize(std::size_t dof_count);
const std::vector<double>& displacement() const noexcept;
const std::vector<double>& externalForce() const noexcept;
const std::vector<double>& internalForce() const noexcept;
const std::vector<double>& residual() const noexcept;
const std::vector<double>& reaction() const noexcept;
void setDisplacement(std::vector<double> values);
void setExternalForce(std::vector<double> values);
void setInternalForce(std::vector<double> values);
void setResidual(std::vector<double> values);
void setReaction(std::vector<double> values);
void clearForces() noexcept;
double currentTime() const noexcept;
void setCurrentTime(double value) noexcept;
std::int64_t incrementIndex() const noexcept;
void setIncrementIndex(std::int64_t value) noexcept;
std::int64_t iterationIndex() const noexcept;
void setIterationIndex(std::int64_t value) noexcept;
private:
void setVector(std::vector<double>& target, std::vector<double> values);
static void zero(std::vector<double>& values) noexcept;
std::size_t dof_count_;
std::vector<double> displacement_;
std::vector<double> external_force_;
std::vector<double> internal_force_;
std::vector<double> residual_;
std::vector<double> reaction_;
double current_time_;
std::int64_t increment_index_;
std::int64_t iteration_index_;
};
} // namespace fesa::core
-21
View File
@@ -1,21 +0,0 @@
#pragma once
#include "fesa/core/ModelTypes.hpp"
namespace fesa::core {
class BoundaryCondition {
public:
BoundaryCondition(NodeId node_id, Dof dof, double value);
NodeId nodeId() const noexcept;
Dof dof() const noexcept;
double value() const noexcept;
private:
NodeId node_id_;
Dof dof_;
double value_;
};
} // namespace fesa::core
-86
View File
@@ -1,86 +0,0 @@
#pragma once
#include "fesa/boundary/BoundaryCondition.hpp"
#include "fesa/core/ModelTypes.hpp"
#include "fesa/core/Node.hpp"
#include "fesa/core/StepDefinition.hpp"
#include "fesa/element/Element.hpp"
#include "fesa/load/Load.hpp"
#include "fesa/material/Material.hpp"
#include "fesa/property/Property.hpp"
#include "fesa/property/ShellProperty.hpp"
#include <cstddef>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
namespace fesa::core {
class Domain {
public:
void addNode(Node node);
void addElement(std::unique_ptr<fesa::element::Element> element);
void addMaterial(std::unique_ptr<fesa::material::Material> material);
void addProperty(std::unique_ptr<fesa::property::Property> property);
void addShellProperty(std::unique_ptr<fesa::property::ShellProperty> property);
void addNodeSet(std::string name, std::vector<NodeId> node_ids);
void addElementSet(std::string name, std::vector<ElementId> element_ids);
std::size_t addBoundaryCondition(std::unique_ptr<fesa::boundary::BoundaryCondition> boundary);
std::size_t addLoad(std::unique_ptr<fesa::load::Load> load);
void addStep(LinearStaticStepDefinition step);
const Node* findNode(NodeId id) const noexcept;
const Node& node(NodeId id) const;
std::size_t nodeCount() const noexcept;
const fesa::element::Element* findElement(ElementId id) const noexcept;
const fesa::element::Element& element(ElementId id) const;
std::size_t elementCount() const noexcept;
const fesa::material::Material* findMaterial(MaterialId id) const noexcept;
const fesa::material::Material& material(MaterialId id) const;
std::size_t materialCount() const noexcept;
const fesa::property::Property* findProperty(PropertyId id) const noexcept;
const fesa::property::Property& property(PropertyId id) const;
std::size_t propertyCount() const noexcept;
const fesa::property::ShellProperty* findShellProperty(PropertyId id) const noexcept;
const fesa::property::ShellProperty& shellProperty(PropertyId id) const;
std::size_t shellPropertyCount() const noexcept;
const std::vector<NodeId>* findNodeSet(const std::string& name) const noexcept;
const std::vector<NodeId>& nodeSet(const std::string& name) const;
std::size_t nodeSetCount() const noexcept;
const std::vector<ElementId>* findElementSet(const std::string& name) const noexcept;
const std::vector<ElementId>& elementSet(const std::string& name) const;
std::size_t elementSetCount() const noexcept;
const fesa::boundary::BoundaryCondition* findBoundaryCondition(std::size_t index) const noexcept;
const fesa::boundary::BoundaryCondition& boundaryCondition(std::size_t index) const;
std::size_t boundaryConditionCount() const noexcept;
const fesa::load::Load* findLoad(std::size_t index) const noexcept;
const fesa::load::Load& load(std::size_t index) const;
std::size_t loadCount() const noexcept;
const LinearStaticStepDefinition* findStep(StepId id) const noexcept;
const LinearStaticStepDefinition& step(StepId id) const;
std::size_t stepCount() const noexcept;
private:
std::unordered_map<NodeId, Node> nodes_;
std::unordered_map<ElementId, std::unique_ptr<fesa::element::Element>> elements_;
std::unordered_map<MaterialId, std::unique_ptr<fesa::material::Material>> materials_;
std::unordered_map<PropertyId, std::unique_ptr<fesa::property::Property>> properties_;
std::unordered_map<std::string, std::vector<NodeId>> node_sets_;
std::unordered_map<std::string, std::vector<ElementId>> element_sets_;
std::vector<std::unique_ptr<fesa::boundary::BoundaryCondition>> boundary_conditions_;
std::vector<std::unique_ptr<fesa::load::Load>> loads_;
std::unordered_map<StepId, LinearStaticStepDefinition> steps_;
};
} // namespace fesa::core
-29
View File
@@ -1,29 +0,0 @@
#pragma once
#include "fesa/core/ModelTypes.hpp"
#include <array>
namespace fesa::core {
class ElementDefinition {
public:
ElementDefinition(
ElementId id,
ElementType type,
std::array<NodeId, 4> connectivity,
PropertyId property_id);
ElementId id() const noexcept;
ElementType type() const noexcept;
const std::array<NodeId, 4>& connectivity() const noexcept;
PropertyId propertyId() const noexcept;
private:
ElementId id_;
ElementType type_;
std::array<NodeId, 4> connectivity_;
PropertyId property_id_;
};
} // namespace fesa::core
-21
View File
@@ -1,21 +0,0 @@
#pragma once
#include "fesa/core/ModelTypes.hpp"
namespace fesa::core {
class NodalLoadDefinition {
public:
NodalLoadDefinition(NodeId node_id, Dof dof, double value);
NodeId nodeId() const noexcept;
Dof dof() const noexcept;
double value() const noexcept;
private:
NodeId node_id_;
Dof dof_;
double value_;
};
} // namespace fesa::core
-21
View File
@@ -1,21 +0,0 @@
#pragma once
#include "fesa/core/ModelTypes.hpp"
namespace fesa::core {
class LinearElasticMaterialDefinition {
public:
LinearElasticMaterialDefinition(MaterialId id, double young_modulus, double poisson_ratio);
MaterialId id() const noexcept;
double youngModulus() const noexcept;
double poissonRatio() const noexcept;
private:
MaterialId id_;
double young_modulus_;
double poisson_ratio_;
};
} // namespace fesa::core
-30
View File
@@ -1,30 +0,0 @@
#pragma once
#include <cstddef>
#include <cstdint>
namespace fesa::core {
using Id = std::int64_t;
using NodeId = Id;
using ElementId = Id;
using MaterialId = Id;
using PropertyId = Id;
using StepId = Id;
enum class Dof : std::uint8_t {
U1 = 0,
U2 = 1,
U3 = 2,
UR1 = 3,
UR2 = 4,
UR3 = 5
};
enum class ElementType {
Mitc4
};
constexpr std::size_t kDofPerNode = 6;
} // namespace fesa::core
-26
View File
@@ -1,26 +0,0 @@
#pragma once
#include "fesa/core/ModelTypes.hpp"
#include <array>
namespace fesa::core {
class Node {
public:
Node(NodeId id, double x, double y, double z);
static constexpr std::size_t dofCount() noexcept { return kDofPerNode; }
NodeId id() const noexcept;
double x() const noexcept;
double y() const noexcept;
double z() const noexcept;
const std::array<double, 3>& coordinates() const noexcept;
private:
NodeId id_;
std::array<double, 3> coordinates_;
};
} // namespace fesa::core
-21
View File
@@ -1,21 +0,0 @@
#pragma once
#include "fesa/core/ModelTypes.hpp"
namespace fesa::core {
class ShellPropertyDefinition {
public:
ShellPropertyDefinition(PropertyId id, MaterialId material_id, double thickness);
PropertyId id() const noexcept;
MaterialId materialId() const noexcept;
double thickness() const noexcept;
private:
PropertyId id_;
MaterialId material_id_;
double thickness_;
};
} // namespace fesa::core
-31
View File
@@ -1,31 +0,0 @@
#pragma once
#include "fesa/core/ModelTypes.hpp"
#include <cstddef>
#include <string>
#include <vector>
namespace fesa::core {
class LinearStaticStepDefinition {
public:
LinearStaticStepDefinition(
StepId id,
std::string name,
std::vector<std::size_t> boundary_condition_indices,
std::vector<std::size_t> load_indices);
StepId id() const noexcept;
const std::string& name() const noexcept;
const std::vector<std::size_t>& boundaryConditionIndices() const noexcept;
const std::vector<std::size_t>& loadIndices() const noexcept;
private:
StepId id_;
std::string name_;
std::vector<std::size_t> boundary_condition_indices_;
std::vector<std::size_t> load_indices_;
};
} // namespace fesa::core