Page MenuHomec4science

test_configuration.cpp
No OneTemporary

File Metadata

Created
Tue, Jul 2, 17:01

test_configuration.cpp

#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