feat: add analysis model objects
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#include "fesa/boundary/BoundaryCondition.hpp"
|
||||
#include "fesa/boundary/SinglePointConstraint.hpp"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace {
|
||||
|
||||
int require(bool condition) {
|
||||
return condition ? 0 : 1;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int run_boundary_base_tests() {
|
||||
std::unique_ptr<fesa::boundary::BoundaryCondition> owned =
|
||||
std::make_unique<fesa::boundary::SinglePointConstraint>(1, fesa::core::Dof::UR3, 0.25);
|
||||
const fesa::boundary::BoundaryCondition& boundary = *owned;
|
||||
const auto& spc = static_cast<const fesa::boundary::SinglePointConstraint&>(boundary);
|
||||
|
||||
if (const int result = require(boundary.kind() == fesa::boundary::BoundaryConditionKind::SinglePointConstraint);
|
||||
result != 0) {
|
||||
return result;
|
||||
}
|
||||
if (const int result = require(spc.nodeId() == 1); result != 0) {
|
||||
return result;
|
||||
}
|
||||
if (const int result = require(spc.dof() == fesa::core::Dof::UR3); result != 0) {
|
||||
return result;
|
||||
}
|
||||
return require(spc.value() == 0.25);
|
||||
}
|
||||
Reference in New Issue
Block a user