Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CFSBndCond.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: CFSBndCond.h
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Abstract base class for compressible solver boundary conditions.
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_BNDCOND_CFSBNDCOND
37 #define NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_BNDCOND_CFSBNDCOND
38 
39 #include <string>
40 
44 #include <MultiRegions/ExpList.h>
45 
46 namespace Nektar
47 {
48 // Forward declaration
49 class CFSBndCond;
50 
51 /// A shared pointer to a boundary condition object
52 typedef boost::shared_ptr<CFSBndCond> CFSBndCondSharedPtr;
53 
54 /// Declaration of the boundary condition factory
55 typedef LibUtilities::NekFactory<std::string, CFSBndCond,
59  const int,
60  const int,
61  const int> CFSBndCondFactory;
62 
63 /// Declaration of the boundary condition factory singleton
64 CFSBndCondFactory& GetCFSBndCondFactory();
65 
66 /**
67  * @class CFSBndCond
68  * @brief Encapsulates the user-defined boundary conditions for compressible
69  * flow solver.
70  */
71 class CFSBndCond
72 {
73  public:
74  virtual ~CFSBndCond() {}
75 
76  /// Apply the boundary condition
77  void Apply(
79  Array<OneD, Array<OneD, NekDouble> > &physarray,
80  const NekDouble &time = 0);
81 
82  protected:
83  /// Session reader
84  LibUtilities::SessionReaderSharedPtr m_session;
85  /// Array of fields
86  Array<OneD, MultiRegions::ExpListSharedPtr> m_fields;
87  /// Trace normals
88  Array<OneD, Array<OneD, NekDouble> > m_traceNormals;
89  /// Space dimension
91  /// Auxiliary object to convert variables
93 
94  /// Parameters of the flow
99 
100  /// Id of the boundary region
102  /// Offset
103  int m_offset;
104 
105  /// Constructor
106  CFSBndCond(const LibUtilities::SessionReaderSharedPtr& pSession,
107  const Array<OneD, MultiRegions::ExpListSharedPtr>& pFields,
108  const Array<OneD, Array<OneD, NekDouble> >& pTraceNormals,
109  const int pSpaceDim,
110  const int bcRegion,
111  const int cnt);
112 
113  virtual void v_Apply(
115  Array<OneD, Array<OneD, NekDouble> > &physarray,
116  const NekDouble &time)=0;
117 
118 };
119 }
120 
121 #endif
CFSBndCond(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, Array< OneD, NekDouble > > &pTraceNormals, const int pSpaceDim, const int bcRegion, const int cnt)
Constructor.
Definition: CFSBndCond.cpp:51
int m_spacedim
Space dimension.
Definition: CFSBndCond.h:90
void Apply(Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray, const NekDouble &time=0)
Apply the boundary condition.
Definition: CFSBndCond.cpp:90
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
Definition: CFSBndCond.h:84
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array of fields.
Definition: CFSBndCond.h:86
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
CFSBndCondFactory & GetCFSBndCondFactory()
Declaration of the boundary condition factory singleton.
Definition: CFSBndCond.cpp:42
NekDouble m_pInf
Definition: CFSBndCond.h:97
Encapsulates the user-defined boundary conditions for compressible flow solver.
Definition: CFSBndCond.h:71
double NekDouble
NekDouble m_gamma
Parameters of the flow.
Definition: CFSBndCond.h:95
LibUtilities::NekFactory< std::string, CFSBndCond, const LibUtilities::SessionReaderSharedPtr &, const Array< OneD, MultiRegions::ExpListSharedPtr > &, const Array< OneD, Array< OneD, NekDouble > > &, const int, const int, const int > CFSBndCondFactory
Declaration of the boundary condition factory.
Definition: CFSBndCond.h:61
VariableConverterSharedPtr m_varConv
Auxiliary object to convert variables.
Definition: CFSBndCond.h:92
Array< OneD, NekDouble > m_velInf
Definition: CFSBndCond.h:98
boost::shared_ptr< VariableConverter > VariableConverterSharedPtr
virtual void v_Apply(Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray, const NekDouble &time)=0
int m_offset
Offset.
Definition: CFSBndCond.h:103
boost::shared_ptr< CFSBndCond > CFSBndCondSharedPtr
A shared pointer to a boundary condition object.
Definition: CFSBndCond.h:49
NekDouble m_rhoInf
Definition: CFSBndCond.h:96
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Trace normals.
Definition: CFSBndCond.h:88
int m_bcRegion
Id of the boundary region.
Definition: CFSBndCond.h:101
virtual ~CFSBndCond()
Definition: CFSBndCond.h:74
Provides a generic Factory class.
Definition: NekFactory.hpp:116