feat(cpp-object-oriented-modular-refactoring): step 4 - model-element-google-style
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "fesa/analysis/analysis_model.hpp"
|
||||
#include "fesa/fem/dof_manager.hpp"
|
||||
#include "fesa/model/domain.hpp"
|
||||
#include "fesa/model/domain.h"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
@@ -33,8 +33,8 @@ LoadFixture makeFixture(
|
||||
std::vector<fesa::NodalLoad> loads) {
|
||||
const std::filesystem::path source{"models/load-assembly.inp"};
|
||||
fesa::ModelDefinition definition{};
|
||||
definition.sourcePath = source;
|
||||
definition.sourceContentIdentity = "fnv1a64:abcdef0123456789";
|
||||
definition.source_path = source;
|
||||
definition.source_content_identity = "fnv1a64:abcdef0123456789";
|
||||
for (std::size_t index = 0U; index < nodeCount; ++index) {
|
||||
const auto label = static_cast<std::int64_t>((index + 1U) * 10U);
|
||||
definition.nodes.push_back({
|
||||
@@ -42,7 +42,7 @@ LoadFixture makeFixture(
|
||||
{static_cast<double>(index), 0.0, 0.0},
|
||||
{source, index + 2U}});
|
||||
}
|
||||
definition.nodeSets = std::move(nodeSets);
|
||||
definition.node_sets = std::move(nodeSets);
|
||||
definition.steps = {{
|
||||
"Step-1",
|
||||
std::move(boundaries),
|
||||
@@ -53,7 +53,7 @@ LoadFixture makeFixture(
|
||||
1.0,
|
||||
{source, 20U}}};
|
||||
|
||||
auto domainResult = fesa::Domain::create(std::move(definition));
|
||||
auto domainResult = fesa::Domain::Create(std::move(definition));
|
||||
if (!domainResult.HasValue()) {
|
||||
throw std::runtime_error{"Load fixture Domain construction failed."};
|
||||
}
|
||||
@@ -81,8 +81,8 @@ LoadFixture makeShellFixture(
|
||||
std::vector<fesa::NodalLoad> loads) {
|
||||
const std::filesystem::path source{"models/shell-load-assembly.inp"};
|
||||
fesa::ModelDefinition definition{};
|
||||
definition.sourcePath = source;
|
||||
definition.sourceContentIdentity = "fnv1a64:1122334455667788";
|
||||
definition.source_path = source;
|
||||
definition.source_content_identity = "fnv1a64:1122334455667788";
|
||||
definition.nodes = {
|
||||
{{"Shell-1", 10, "10"}, {0.0, 0.0, 0.0}, {source, 2U}},
|
||||
{{"Shell-1", 20, "20"}, {1.0, 0.0, 0.0}, {source, 3U}},
|
||||
@@ -90,17 +90,17 @@ LoadFixture makeShellFixture(
|
||||
{{"Shell-1", 40, "40"}, {0.0, 1.0, 0.0}, {source, 5U}}};
|
||||
definition.materials = {
|
||||
{"Material", 1000.0, 0.25, {source, 6U}}};
|
||||
definition.shellSections = {
|
||||
definition.shell_sections = {
|
||||
{"ShellSection", 0.1, 0U, {source, 7U}}};
|
||||
definition.shellElements = {{
|
||||
definition.shell_elements = {{
|
||||
{"Shell-1", 1, "1"},
|
||||
fesa::ShellSourceElementType::s4,
|
||||
fesa::ShellSourceElementType::kS4,
|
||||
{0U, 1U, 2U, 3U},
|
||||
0U,
|
||||
0U,
|
||||
{source, 8U}}};
|
||||
for (std::size_t node = 0U; node < definition.nodes.size(); ++node) {
|
||||
definition.shellNodeInitialFrames.push_back({
|
||||
definition.shell_node_initial_frames.push_back({
|
||||
static_cast<fesa::EntityIndex>(node),
|
||||
{0.0, 0.0, 1.0},
|
||||
{1.0, 0.0, 0.0},
|
||||
@@ -116,7 +116,7 @@ LoadFixture makeShellFixture(
|
||||
1.0,
|
||||
{source, 20U}}};
|
||||
|
||||
auto domainResult = fesa::Domain::create(std::move(definition));
|
||||
auto domainResult = fesa::Domain::Create(std::move(definition));
|
||||
if (!domainResult.HasValue()) {
|
||||
throw std::runtime_error{"Shell load fixture Domain construction failed."};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user