Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F69620268
test_configuration.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
Tue, Jul 2, 17:01
Size
1 KB
Mime Type
text/x-c
Expires
Thu, Jul 4, 17:01 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
18732261
Attached To
rSPECMICP SpecMiCP / ReactMiCP
test_configuration.cpp
View Options
#include <catch.hpp>
#include "utils/io/yaml.hpp"
#include "dfpm/meshes/mesh1d.hpp"
#include "dfpm/io/configuration.hpp"
TEST_CASE
(
"Configuration"
,
"[meshes],[io],[configuration]"
)
{
SECTION
(
"Uniform mesh"
)
{
YAML
::
Node
conf
=
specmicp
::
io
::
parse_yaml_file
(
"unif_mesh.yaml"
);
specmicp
::
mesh
::
Mesh1DPtr
the_mesh
=
specmicp
::
io
::
configure_mesh
(
conf
);
REQUIRE
(
the_mesh
->
nb_nodes
()
==
50
);
}
SECTION
(
"Ramp mesh"
)
{
YAML
::
Node
conf
=
specmicp
::
io
::
parse_yaml_file
(
"ramp_mesh.yaml"
);
specmicp
::
mesh
::
Mesh1DPtr
the_mesh
=
specmicp
::
io
::
configure_mesh
(
conf
);
REQUIRE
(
the_mesh
->
get_dx
(
0
)
==
1.0
);
REQUIRE
(
the_mesh
->
get_dx
(
the_mesh
->
nb_nodes
()
-
2
)
==
5.0
);
}
SECTION
(
"Uniform axisymmetric mesh"
)
{
YAML
::
Node
conf
=
specmicp
::
io
::
parse_yaml_file
(
"unif_axisym.yaml"
);
specmicp
::
mesh
::
Mesh1DPtr
the_mesh
=
specmicp
::
io
::
configure_mesh
(
conf
);
REQUIRE
(
the_mesh
->
get_dx
(
0
)
==
1.0
);
REQUIRE
(
the_mesh
->
nb_nodes
()
==
10
);
}
}
Event Timeline
Log In to Comment