Nektar++
FilterMovingBody.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File FilterMovingBody.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 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Outputs values at specific points during time-stepping.
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_INCNAVIERSTOKES_FILTERS_FILTERMOVINGBODY_H
36 #define NEKTAR_INCNAVIERSTOKES_FILTERS_FILTERMOVINGBODY_H
37 
41 
42 namespace Nektar
43 {
44 class FilterMovingBody;
45 
46 typedef std::shared_ptr<FilterMovingBody> FilterMovingBodySharedPtr;
47 typedef std::map<std::string, std::string> FilterParams;
48 typedef std::pair<std::string, FilterParams> FilterMap;
49 
51 {
52 public:
53  friend class MemoryManager<FilterMovingBody>;
54 
55  /// Creates an instance of this class
58  const std::weak_ptr<SolverUtils::EquationSystem> &pEquation,
59  const ParamMap &pParams)
60  {
63  pSession, pEquation, pParams);
64  return p;
65  }
66 
67  static std::string className;
68 
71  const std::weak_ptr<SolverUtils::EquationSystem> &pEquation,
72  const ParamMap &pParams);
74 
75  virtual void v_Initialise(
77  const NekDouble &time);
78 
79  virtual void v_Update(
81  const NekDouble &time)
82  {
83  }
84 
85  void UpdateForce(
88  Array<OneD, NekDouble> &Aeroforces, const NekDouble &time);
89 
90  void UpdateMotion(
93  Array<OneD, NekDouble> &MotionVars, const NekDouble &time);
94 
95  virtual void v_Finalise(
97  const NekDouble &time);
98 
99  virtual bool v_IsTimeDependent();
100 
101 private:
102  /// ID's of boundary regions where we want the forces
103  std::vector<unsigned int> m_boundaryRegionsIdList;
104  /// Determines if a given Boundary Region is in
105  /// m_boundaryRegionsIdList
106  std::vector<bool> m_boundaryRegionIsInList;
107  unsigned int m_index_f;
108  unsigned int m_index_m;
109  unsigned int m_outputFrequency;
110  /// plane to take history point from if using a homogeneous1D
111  /// expansion
112  unsigned int m_outputPlane;
115  std::string m_BoundaryString;
116  /// number of planes for homogeneous1D expansion
117  int m_planes;
119  std::string m_outputFile_fce;
120  std::string m_outputFile_mot;
121 };
122 
123 } // namespace Nektar
124 
125 #endif /* NEKTAR_SOLVERUTILS_FILTERS_FILTERCHECKPOINT_H */
virtual void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
virtual void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
static std::string className
void UpdateMotion(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, Array< OneD, NekDouble > &MotionVars, const NekDouble &time)
unsigned int m_outputPlane
plane to take history point from if using a homogeneous1D expansion
std::vector< unsigned int > m_boundaryRegionsIdList
ID's of boundary regions where we want the forces.
FilterMovingBody(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< SolverUtils::EquationSystem > &pEquation, const ParamMap &pParams)
static SolverUtils::FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< SolverUtils::EquationSystem > &pEquation, const ParamMap &pParams)
Creates an instance of this class.
Array< OneD, std::ofstream > m_outputStream
int m_planes
number of planes for homogeneous1D expansion
virtual void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
LibUtilities::BasisSharedPtr m_homogeneousBasis
std::vector< bool > m_boundaryRegionIsInList
Determines if a given Boundary Region is in m_boundaryRegionsIdList.
void UpdateForce(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, Array< OneD, NekDouble > &Aeroforces, const NekDouble &time)
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::map< std::string, std::string > ParamMap
Definition: Filter.h:67
std::shared_ptr< Basis > BasisSharedPtr
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Filter > FilterSharedPtr
A shared pointer to a Driver object.
Definition: Filter.h:50
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
std::shared_ptr< FilterMovingBody > FilterMovingBodySharedPtr
std::pair< std::string, FilterParams > FilterMap
std::map< std::string, std::string > FilterParams
double NekDouble