Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92200363
test_uniform_mesh_1d.cpp
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
Mon, Nov 18, 06:15
Size
1001 B
Mime Type
text/x-c
Expires
Wed, Nov 20, 06:15 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22392555
Attached To
rSPECMICP SpecMiCP / ReactMiCP
test_uniform_mesh_1d.cpp
View Options
#include "catch.hpp"
#include "dfpm/meshes/uniform_mesh1d.hpp"
using
namespace
specmicp
::
mesh
;
TEST_CASE
(
"Uniform mesh 1d"
,
"[ReactMiCP],[Mesh],[uniform],[1D]"
)
{
SECTION
(
"test uniform mesh 1d"
)
{
double
nb_node
=
5
;
double
dx
=
1
;
double
cross
=
2
;
UniformMesh1D
mesh
(
nb_node
,
dx
,
cross
);
REQUIRE
(
mesh
.
nb_nodes
()
==
nb_node
);
REQUIRE
(
mesh
.
nb_elements
()
==
nb_node
-
1
);
REQUIRE
(
mesh
.
get_dx
(
0
)
==
dx
);
REQUIRE
(
mesh
.
get_face_area
(
2
)
==
cross
);
REQUIRE
(
mesh
.
get_volume_element
(
2
)
==
dx
*
cross
);
int
check_nb_node
=
0
;
for
(
int
node:
mesh
.
range_nodes
())
{
++
check_nb_node
;}
REQUIRE
(
check_nb_node
==
nb_node
);
int
check_nb_element
=
0
;
for
(
int
element:
mesh
.
range_elements
())
{
++
check_nb_element
;}
REQUIRE
(
check_nb_element
==
mesh
.
nb_elements
());
int
check_nen
=
0
;
for
(
int
node:
mesh
.
range_nen
())
{
++
check_nen
;}
REQUIRE
(
check_nen
==
2
);
}
}
Event Timeline
Log In to Comment