feat: add solver core skeleton
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
#include <fesa/results/results.hpp>
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
namespace {
|
||||
|
||||
int fail()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main()
|
||||
{
|
||||
fesa::results::ResultStep step{"static"};
|
||||
auto& frame = step.add_frame(1, 0.0);
|
||||
if (step.name() != "static" ||
|
||||
step.frames().size() != 1 ||
|
||||
frame.frame_id() != 1 ||
|
||||
frame.time() != 0.0) {
|
||||
return fail();
|
||||
}
|
||||
|
||||
frame.add_field_output({
|
||||
"U",
|
||||
fesa::results::FieldLocation::nodal,
|
||||
{"ux", "uy"},
|
||||
{1, 2},
|
||||
{0.0, 0.1, 1.0, 1.1}
|
||||
});
|
||||
if (frame.field_outputs().size() != 1 ||
|
||||
frame.field_outputs()[0].entity_ids[1] != 2 ||
|
||||
frame.field_outputs()[0].values[3] != 1.1) {
|
||||
return fail();
|
||||
}
|
||||
|
||||
frame.add_history_output({"load-factor", {0.0, 1.0}, {0.0, 10.0}});
|
||||
if (frame.history_outputs().size() != 1 ||
|
||||
frame.history_outputs()[0].values[1] != 10.0) {
|
||||
return fail();
|
||||
}
|
||||
|
||||
try {
|
||||
frame.add_field_output({
|
||||
"bad",
|
||||
fesa::results::FieldLocation::nodal,
|
||||
{},
|
||||
{1},
|
||||
{0.0}
|
||||
});
|
||||
return fail();
|
||||
} catch (const std::invalid_argument&) {
|
||||
}
|
||||
|
||||
try {
|
||||
frame.add_field_output({
|
||||
"bad-shape",
|
||||
fesa::results::FieldLocation::nodal,
|
||||
{"ux", "uy"},
|
||||
{1},
|
||||
{0.0}
|
||||
});
|
||||
return fail();
|
||||
} catch (const std::invalid_argument&) {
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user