Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80142289
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
Fri, Aug 30, 03:03
Size
1 KB
Mime Type
text/x-c++
Expires
Sun, Sep 1, 03:03 (2 d)
Engine
blob
Format
Raw Data
Handle
20308795
Attached To
rAKA akantu
test_solid_mechanics_model_fixture.hh
View Options
/* -------------------------------------------------------------------------- */
#include "solid_mechanics_model.hh"
#include "test_gtest_utils.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;
template <typename type_> class TestSMMFixture : public ::testing::Test {
public:
static constexpr const ElementType type = type_::value;
static constexpr const size_t spatial_dimension =
ElementClass<type>::getSpatialDimension();
void SetUp() override {
const auto spatial_dimension = this->spatial_dimension;
mesh = std::make_unique<Mesh>(spatial_dimension);
mesh->read(this->makeMeshName());
std::stringstream element_type;
element_type << type;
model = std::make_unique<SolidMechanicsModel>(*mesh, _all_dimensions,
element_type.str());
}
virtual std::string makeMeshName() {
std::stringstream element_type;
element_type << type;
SCOPED_TRACE(element_type.str().c_str());
return element_type.str() + ".msh";
}
void TearDown() override {
model.reset(nullptr);
mesh.reset(nullptr);
}
protected:
std::unique_ptr<Mesh> mesh;
std::unique_ptr<SolidMechanicsModel> model;
};
using types = gtest_list_t<TestElementTypes>;
TYPED_TEST_CASE(TestSMMFixture, types);
#endif /* __AKANTU_TEST_SOLID_MECHANICS_MODEL_FIXTURE_HH__ */
Event Timeline
Log In to Comment