25 #include "grins_config.h"
27 #ifdef GRINS_HAVE_CPPUNIT
29 #include <cppunit/extensions/HelperMacros.h>
30 #include <cppunit/TestCase.h>
34 #include "grins_test_paths.h"
67 std::string filename = std::string(GRINS_TEST_UNIT_INPUT_SRCDIR)+
"/default_bc_builder.in";
68 GetPot input(filename);
70 std::map<std::string,std::set<GRINS::BoundaryID> > bc_id_map;
74 CPPUNIT_ASSERT_EQUAL(3,(
int)bc_id_map.size());
75 CPPUNIT_ASSERT( bc_id_map.find(
"Hot") != bc_id_map.end() );
76 CPPUNIT_ASSERT( bc_id_map.find(
"Together") != bc_id_map.end() );
77 CPPUNIT_ASSERT( bc_id_map.find(
"Cold") != bc_id_map.end() );
81 std::set<GRINS::BoundaryID> bc_ids = bc_id_map[
"Hot"];
82 CPPUNIT_ASSERT_EQUAL(1,(
int)bc_ids.size());
83 CPPUNIT_ASSERT(bc_ids.find(0) != bc_ids.end());
88 std::set<GRINS::BoundaryID> bc_ids = bc_id_map[
"Together"];
89 CPPUNIT_ASSERT_EQUAL(2,(
int)bc_ids.size());
90 CPPUNIT_ASSERT(bc_ids.find(1) != bc_ids.end());
91 CPPUNIT_ASSERT(bc_ids.find(2) != bc_ids.end());
96 std::set<GRINS::BoundaryID> bc_ids = bc_id_map[
"Cold"];
97 CPPUNIT_ASSERT_EQUAL(1,(
int)bc_ids.size());
98 CPPUNIT_ASSERT(bc_ids.find(3) != bc_ids.end());
104 std::string filename = std::string(GRINS_TEST_UNIT_INPUT_SRCDIR)+
"/default_bc_builder.in";
107 std::map<std::string,std::set<GRINS::BoundaryID> > bc_id_map;
116 std::string filename = std::string(GRINS_TEST_UNIT_INPUT_SRCDIR)+
"/default_bc_builder.in";
120 std::set<std::string> sections;
124 CPPUNIT_ASSERT_EQUAL(4,(
int)sections.size());
125 CPPUNIT_ASSERT( sections.find(
"Velocity") != sections.end() );
126 CPPUNIT_ASSERT( sections.find(
"Pressure") != sections.end() );
127 CPPUNIT_ASSERT( sections.find(
"Temperature") != sections.end() );
128 CPPUNIT_ASSERT( sections.find(
"SpeciesMassFractions") != sections.end() );
133 std::string filename = std::string(GRINS_TEST_UNIT_INPUT_SRCDIR)+
"/default_bc_builder.in";
136 libMesh::boundary_id_type invalid_bid =
137 std::numeric_limits<libMesh::boundary_id_type>::max();
139 libMesh::boundary_id_type master_id = invalid_bid;
140 libMesh::boundary_id_type slave_id = invalid_bid;
146 CPPUNIT_ASSERT_EQUAL(1,(
int)master_id);
147 CPPUNIT_ASSERT_EQUAL(2,(
int)slave_id);
152 std::string filename = std::string(GRINS_TEST_UNIT_INPUT_SRCDIR)+
"/default_bc_builder.in";
157 libMesh::RealVectorValue offset =
160 libMesh::Real tol = std::numeric_limits<libMesh::Real>::epsilon()*10;
161 CPPUNIT_ASSERT_DOUBLES_EQUAL(1.21,offset(0),tol);
162 CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0,offset(1),tol);
168 const std::string& var_to_find )
170 CPPUNIT_ASSERT( std::find( var_names.begin(), var_names.end(), var_to_find ) != var_names.end() );
179 #endif // GRINS_HAVE_CPPUNIT
void parse_and_build_bc_id_map(const GetPot &input, std::map< std::string, std::set< BoundaryID > > &bc_id_map)
CPPUNIT_TEST(test_parse_and_build_bc_id_map)
CPPUNIT_TEST_SUITE_REGISTRATION(AntiochAirNASA9ThermoTest)
void setup_multiphysics_system(const std::string &filename)
void test_parse_var_sections()
CPPUNIT_TEST_SUITE(DefaultBCBuilderTest)
void parse_var_sections(const GetPot &input, std::set< std::string > §ions)
void parse_periodic_master_slave_ids(const GetPot &input, const std::string §ion, libMesh::boundary_id_type &master_id, libMesh::boundary_id_type &slave_id) const
void verify_bc_ids_with_mesh(const MultiphysicsSystem &system, const std::map< std::string, std::set< BoundaryID > > &bc_id_map) const
libMesh::RealVectorValue parse_periodic_offset(const GetPot &input, const std::string §ion) const
void test_parse_periodic_offset()
Manages runtime construction of Dirichlet boundary conditions.
Helper class for setting up basic GRINS::MultiphysicsSystem for unit testing.
GRINS::MultiphysicsSystem * _system
void test_parse_periodic_master_slave_ids()
void test_for_var_name(const std::vector< std::string > &var_names, const std::string &var_to_find)
void test_parse_and_build_bc_id_map()
static std::string bc_section()
Outer section name for boundary conditions section in input file.
libMesh::UniquePtr< GetPot > _input
void test_verify_bc_ids_with_mesh()