Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FilterAeroForces.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File FilterAeroForces.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: Outputs values at specific points during time-stepping.
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERUTILS_FILTERS_FILTERFORCES_H
37 #define NEKTAR_SOLVERUTILS_FILTERS_FILTERFORCES_H
38 
41 #include <GlobalMapping/Mapping.h>
42 
43 namespace Nektar
44 {
45 namespace SolverUtils
46 {
47 class FilterAeroForces : public Filter
48 {
49 public:
51 
52  /// Creates an instance of this class
55  const std::map<std::string, std::string> &pParams)
56  {
58  AllocateSharedPtr(pSession, pParams);
59  //p->InitObject();
60  return p;
61  }
62 
63  ///Name of the class
64  static std::string className;
65 
68  const std::map<std::string, std::string> &pParams);
69 
71 
74  Array<OneD, NekDouble> &Aeroforces,
75  const NekDouble &time);
76 
77 protected:
78  virtual void v_Initialise(
80  const NekDouble &time);
81  virtual void v_Update(
83  const NekDouble &time);
84  virtual void v_Finalise(
86  const NekDouble &time);
87  virtual bool v_IsTimeDependent();
88 
89 private:
90  /// ID's of boundary regions where we want the forces
91  vector<unsigned int> m_boundaryRegionsIdList;
92  /// Determines if a given Boundary Region is in
93  /// m_boundaryRegionsIdList
95  unsigned int m_index;
96  unsigned int m_outputFrequency;
97  /// if using a homogeneous1D expansion, determine if should output
98  /// all planes or just the average
101  std::string m_outputFile;
102  std::ofstream m_outputStream;
104  std::string m_BoundaryString;
107  /// number of planes for homogeneous1D expansion
110  // Time when we start calculating the forces
112  // Directions on which the forces will be projected
114  // Arrays storing the last forces that were calculated
118 
121 
122  void CalculateForces(
124  const NekDouble &time);
125 
128  const NekDouble &time);
129 };
130 
131 typedef boost::shared_ptr<FilterAeroForces> FilterAeroForcesSharedPtr;
132 }
133 }
134 
135 #endif /* NEKTAR_SOLVERUTILS_FILTERS_FILTERCHECKPOINT_H */
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
SOLVER_UTILS_EXPORT FilterAeroForces(const LibUtilities::SessionReaderSharedPtr &pSession, const std::map< std::string, std::string > &pParams)
virtual SOLVER_UTILS_EXPORT ~FilterAeroForces()
virtual void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
virtual void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
vector< bool > m_boundaryRegionIsInList
Determines if a given Boundary Region is in m_boundaryRegionsIdList.
vector< unsigned int > m_boundaryRegionsIdList
ID's of boundary regions where we want the forces.
boost::shared_ptr< FilterAeroForces > FilterAeroForcesSharedPtr
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
static std::string className
Name of the class.
GlobalMapping::MappingSharedPtr m_mapping
Array< OneD, Array< OneD, NekDouble > > m_directions
SOLVER_UTILS_EXPORT void GetForces(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, Array< OneD, NekDouble > &Aeroforces, const NekDouble &time)
boost::shared_ptr< Filter > FilterSharedPtr
A shared pointer to a Driver object.
Definition: Filter.h:50
void CalculateForces(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
double NekDouble
GLOBAL_MAPPING_EXPORT typedef boost::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:51
virtual void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
int m_nPlanes
number of planes for homogeneous1D expansion
#define SOLVER_UTILS_EXPORT
Array< OneD, Array< OneD, NekDouble > > m_Ftplane
Array< OneD, Array< OneD, NekDouble > > m_Fpplane
boost::shared_ptr< Basis > BasisSharedPtr
Array< OneD, Array< OneD, NekDouble > > m_Fvplane
static FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::map< std::string, std::string > &pParams)
Creates an instance of this class.
bool m_outputAllPlanes
if using a homogeneous1D expansion, determine if should output all planes or just the average ...
void CalculateForcesMapping(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
LibUtilities::BasisSharedPtr m_homogeneousBasis