feat: add solver core skeleton

This commit is contained in:
NINI
2026-06-12 02:25:07 +09:00
parent 4e7fd1087d
commit cbd1a6c5d7
46 changed files with 1911 additions and 19 deletions
@@ -0,0 +1,37 @@
#include <fesa/analysis/linear_static_analysis.hpp>
namespace {
fesa::model::Domain make_domain()
{
fesa::model::Domain domain;
domain.add_node({fesa::core::NodeId{1}, {0.0, 0.0, 0.0}});
domain.add_node({fesa::core::NodeId{2}, {1.0, 0.0, 0.0}});
domain.add_material({fesa::core::MaterialId{3}, "steel"});
domain.add_property({fesa::core::PropertyId{4}, "bar", fesa::core::MaterialId{3}});
domain.add_element({
fesa::core::ElementId{5},
fesa::model::ElementTopology::truss2,
{fesa::core::NodeId{1}, fesa::core::NodeId{2}},
fesa::core::PropertyId{4}
});
fesa::model::AnalysisStep step{fesa::core::StepId{6}, "static"};
step.add_boundary_condition({fesa::core::NodeId{1}, fesa::model::DofComponent::ux, 0.0});
step.add_load({fesa::core::NodeId{2}, fesa::model::DofComponent::ux, 10.0});
domain.add_step(step);
return domain;
}
} // namespace
int main()
{
const auto domain = make_domain();
fesa::analysis::LinearStaticAnalysis analysis{domain, fesa::core::StepId{6}};
analysis.run();
if (analysis.analysis_model() == nullptr || analysis.state() == nullptr) {
return 1;
}
return analysis.state()->displacement().size() == 6 ? 0 : 1;
}