Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F68443812
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
Thu, Jun 27, 10:24
Size
1 KB
Mime Type
text/x-c++
Expires
Sat, Jun 29, 10:24 (2 d)
Engine
blob
Format
Raw Data
Handle
18583970
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