Cantera  2.5.1
WallFactory.cpp
Go to the documentation of this file.
1 //! @file WallFactory.cpp
2 
3 // This file is part of Cantera. See License.txt in the top-level directory or
4 // at https://cantera.org/license.txt for license and copyright information.
5 
7 #include "cantera/zeroD/Wall.h"
8 
9 using namespace std;
10 namespace Cantera
11 {
12 
13 WallFactory* WallFactory::s_factory = 0;
14 std::mutex WallFactory::wall_mutex;
15 
16 WallFactory::WallFactory()
17 {
18  reg("Wall", []() { return new Wall(); });
19 
20  // only used by clib
21  reg_type("Wall", WallType);
22 }
23 
24 WallBase* WallFactory::newWall(const std::string& wallType)
25 {
26  return create(wallType);
27 }
28 
29 WallBase* WallFactory::newWall(int ir)
30 {
31  try {
32  return create(m_types.at(ir));
33  } catch (out_of_range&) {
34  throw CanteraError("WallFactory::newWall",
35  "unknown wall type!");
36  }
37 }
38 
39 }
Header file for base class WallBase.
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:264
WallBase * newWall(const std::string &model)
Create a Wall object of the specified type.
Definition: WallFactory.h:68
const int WallType
Magic numbers.
Definition: Wall.h:22