Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CFSBndCond.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: CFSBndCond.cpp
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 #include "CFSBndCond.h"
37 
38 using namespace std;
39 
40 namespace Nektar
41 {
43 {
44  typedef Loki::SingletonHolder<CFSBndCondFactory,
45  Loki::CreateUsingNew,
46  Loki::NoDestroy,
47  Loki::SingleThreaded> Type;
48  return Type::Instance();
49 }
50 
51 CFSBndCond::CFSBndCond(const LibUtilities::SessionReaderSharedPtr& pSession,
53  const Array<OneD, Array<OneD, NekDouble> >& pTraceNormals,
54  const int pSpaceDim,
55  const int bcRegion,
56  const int cnt)
57  : m_session(pSession),
58  m_fields(pFields),
59  m_traceNormals(pTraceNormals),
60  m_spacedim(pSpaceDim),
61  m_bcRegion(bcRegion),
62  m_offset(cnt)
63 {
65  m_session->LoadParameter("Gamma", m_gamma, 1.4);
66  m_session->LoadParameter("rhoInf", m_rhoInf, 1.225);
67  m_session->LoadParameter("pInf", m_pInf, 101325);
68  m_session->LoadParameter("uInf", m_velInf[0], 0.1);
69  if (m_spacedim >= 2)
70  {
71  m_session->LoadParameter("vInf", m_velInf[1], 0.0);
72  }
73  if (m_spacedim == 3)
74  {
75  m_session->LoadParameter("wInf", m_velInf[2], 0.0);
76  }
77 
78  // Create auxiliary object to convert variables
80  m_session, m_spacedim);
81 }
82 
83 /**
84  * @param bcRegion id of the boundary region
85  * @param cnt
86  * @param Fwd
87  * @param physarray
88  * @param time
89  */
92  Array<OneD, Array<OneD, NekDouble> > &physarray,
93  const NekDouble &time)
94 {
95  v_Apply(Fwd, physarray, time);
96 }
97 
98 }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
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
STL namespace.
LibUtilities::SessionReaderSharedPtr m_session
Session reader.
Definition: CFSBndCond.h:84
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
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
virtual void v_Apply(Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray, const NekDouble &time)=0
NekDouble m_rhoInf
Definition: CFSBndCond.h:96
Provides a generic Factory class.
Definition: NekFactory.hpp:116