Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79705824
test_solid_mechanics_model_fixture.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Aug 27, 20:27
Size
1 KB
Mime Type
text/x-c++
Expires
Thu, Aug 29, 20:27 (2 d)
Engine
blob
Format
Raw Data
Handle
20218272
Attached To
rAKA akantu
test_solid_mechanics_model_fixture.hh
View Options
/* -------------------------------------------------------------------------- */
#include "solid_mechanics_model.hh"
#include "test_gtest_utils.hh"
#include "communicator.hh"
/* -------------------------------------------------------------------------- */
#include <gtest/gtest.h>
#include <vector>
/* -------------------------------------------------------------------------- */
#ifndef __AKANTU_TEST_SOLID_MECHANICS_MODEL_FIXTURE_HH__
#define __AKANTU_TEST_SOLID_MECHANICS_MODEL_FIXTURE_HH__
using namespace akantu;
// This fixture uses very small meshes with a volume of 1.
template <typename type_> class TestSMMFixture : public ::testing::Test {
public:
static constexpr ElementType type = type_::value;
static constexpr size_t spatial_dimension =
ElementClass<type>::getSpatialDimension();
void SetUp() override {
mesh = std::make_unique<Mesh>(this->spatial_dimension);
#if defined(AKANTU_PARALLEL)
if(Communicator::getStaticCommunicator().whoAmI() == 0) {
#endif
mesh->read(this->mesh_file);
#if defined(AKANTU_PARALLEL)
}
mesh->distribute();
#endif
SCOPED_TRACE(aka::to_string(this->type).c_str());
model = std::make_unique<SolidMechanicsModel>(*mesh, _all_dimensions,
aka::to_string(this->type));
}
void TearDown() override {
model.reset(nullptr);
mesh.reset(nullptr);
}
protected:
std::string mesh_file{aka::to_string(this->type) + ".msh"};
std::unique_ptr<Mesh> mesh;
std::unique_ptr<SolidMechanicsModel> model;
};
template <typename type_> constexpr ElementType TestSMMFixture<type_>::type;
template <typename type_> constexpr size_t TestSMMFixture<type_>::spatial_dimension;
using gtest_element_types = gtest_list_t<TestElementTypes>;
TYPED_TEST_CASE(TestSMMFixture, gtest_element_types);
#endif /* __AKANTU_TEST_SOLID_MECHANICS_MODEL_FIXTURE_HH__ */
Event Timeline
Log In to Comment