Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F94227520
test_fe_engine_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
Wed, Dec 4, 22:29
Size
1 KB
Mime Type
text/x-c++
Expires
Fri, Dec 6, 22:29 (1 d, 18 h)
Engine
blob
Format
Raw Data
Handle
22739160
Attached To
rAKA akantu
test_fe_engine_fixture.hh
View Options
/* -------------------------------------------------------------------------- */
#include "element_class.hh"
#include "fe_engine.hh"
#include "integrator_gauss.hh"
#include "shape_lagrange.hh"
#include "test_gtest_utils.hh"
/* -------------------------------------------------------------------------- */
#include <gtest/gtest.h>
/* -------------------------------------------------------------------------- */
#ifndef __AKANTU_TEST_FE_ENGINE_FIXTURE_HH__
#define __AKANTU_TEST_FE_ENGINE_FIXTURE_HH__
using namespace akantu;
template <typename type_> class TestFEMFixture : public ::testing::Test {
public:
static constexpr const ElementType type = type_::value;
static constexpr const size_t dim = ElementClass<type>::getSpatialDimension();
using FEM = FEEngineTemplate<IntegratorGauss, ShapeLagrange>;
void SetUp() override {
const auto dim = this->dim;
const auto type = this->type;
mesh = std::make_unique<Mesh>(dim);
std::stringstream meshfilename;
meshfilename << type << ".msh";
mesh->read(meshfilename.str());
lower = mesh->getLowerBounds();
upper = mesh->getUpperBounds();
nb_element = this->mesh->getNbElement(type);
fem = std::make_unique<FEM>(*mesh, dim, "my_fem");
fem->initShapeFunctions();
nb_quadrature_points_total = fem->getNbIntegrationPoints(type) * nb_element;
SCOPED_TRACE(aka::to_string(type));
}
void TearDown() override {
fem.reset(nullptr);
mesh.reset(nullptr);
}
protected:
std::unique_ptr<FEM> fem;
std::unique_ptr<Mesh> mesh;
UInt nb_element;
UInt nb_quadrature_points_total;
Vector<Real> lower;
Vector<Real> upper;
};
template <typename type_>
constexpr const ElementType TestFEMFixture<type_>::type;
template <typename type_>
constexpr const size_t TestFEMFixture<type_>::dim;
using types = gtest_list_t<TestElementTypes>;
TYPED_TEST_CASE(TestFEMFixture, types);
#endif /* __AKANTU_TEST_FE_ENGINE_FIXTURE_HH__ */
Event Timeline
Log In to Comment