GRINS-0.8.0
builder_helper.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #include "grins_config.h"
26 
27 #ifdef GRINS_HAVE_CPPUNIT
28 
29 #include <libmesh/ignore_warnings.h>
30 #include <cppunit/extensions/HelperMacros.h>
31 #include <cppunit/TestCase.h>
32 #include <libmesh/restore_warnings.h>
33 
34 // Testing headers
35 #include "test_comm.h"
36 #include "grins_test_paths.h"
37 #include "system_helper.h"
38 
39 // GRINS
40 #include "grins/builder_helper.h"
41 
42 // Ignore warnings from auto_ptr in CPPUNIT_TEST_SUITE_END()
43 #include <libmesh/ignore_warnings.h>
44 
45 namespace GRINSTesting
46 {
47  class BuilderHelperTest : public CppUnit::TestCase,
48  public SystemHelper,
49  public GRINS::BuilderHelper // So we can test proctected methods
50  {
51  public:
53 
55 
57 
58  public:
59 
60  void tearDown()
61  {
62  this->reset_all();
63  }
64 
66  {
67  std::string filename = std::string(GRINS_TEST_UNIT_INPUT_SRCDIR)+"/default_bc_builder.in";
68  this->setup_multiphysics_system(filename);
69 
70  // Now we can parse the variable sections and names
71  std::set<std::string> sections;
72  this->parse_var_sections(*_input,sections);
73 
74  // Make sure we have the right sections
75  CPPUNIT_ASSERT_EQUAL(4,(int)sections.size());
76  CPPUNIT_ASSERT( sections.find("Velocity") != sections.end() );
77  CPPUNIT_ASSERT( sections.find("Pressure") != sections.end() );
78  CPPUNIT_ASSERT( sections.find("Temperature") != sections.end() );
79  CPPUNIT_ASSERT( sections.find("SpeciesMassFractions") != sections.end() );
80  }
81  };
82 
83  CPPUNIT_TEST_SUITE_REGISTRATION( BuilderHelperTest );
84 
85 } // end namespace GRINSTesting
86 
87 #endif // GRINS_HAVE_CPPUNIT
CPPUNIT_TEST_SUITE_REGISTRATION(AntiochAirNASA9ThermoTest)
void setup_multiphysics_system(const std::string &filename)
Definition: system_helper.h:42
CPPUNIT_TEST(test_parse_var_sections)
This class contains common functions used by various Builders throughout GRINS.
Helper class for setting up basic GRINS::MultiphysicsSystem for unit testing.
Definition: system_helper.h:38
CPPUNIT_TEST_SUITE(BuilderHelperTest)
libMesh::UniquePtr< GetPot > _input
Definition: system_helper.h:62
static void parse_var_sections(const GetPot &input, std::set< std::string > &sections)
Parses the input file for [Variables] first-level subsections.

Generated on Tue Dec 19 2017 12:47:27 for GRINS-0.8.0 by  doxygen 1.8.9.1