feat: add analysis model objects
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include "fesa/material/LinearElasticMaterial.hpp"
|
||||
#include "fesa/material/Material.hpp"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace {
|
||||
|
||||
int require(bool condition) {
|
||||
return condition ? 0 : 1;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int run_material_base_tests() {
|
||||
std::unique_ptr<fesa::material::Material> owned =
|
||||
std::make_unique<fesa::material::LinearElasticMaterial>(700, 210.0, 0.3);
|
||||
const fesa::material::Material& material = *owned;
|
||||
const auto& elastic = static_cast<const fesa::material::LinearElasticMaterial&>(material);
|
||||
|
||||
if (const int result = require(material.id() == 700); result != 0) {
|
||||
return result;
|
||||
}
|
||||
if (const int result = require(elastic.youngModulus() == 210.0); result != 0) {
|
||||
return result;
|
||||
}
|
||||
return require(elastic.poissonRatio() == 0.3);
|
||||
}
|
||||
Reference in New Issue
Block a user