Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FilterSampler.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File FilterSampler.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: Base clase for filters performing operations on samples
33 // of the field.
34 //
35 ///////////////////////////////////////////////////////////////////////////////
36 
37 #ifndef NEKTAR_SOLVERUTILS_FILTERS_FILTERSAMPLER_H
38 #define NEKTAR_SOLVERUTILS_FILTERS_FILTERSAMPLER_H
39 
41 
42 namespace Nektar
43 {
44 namespace SolverUtils
45 {
46 class FilterSampler : public Filter
47 {
48 public:
50 
53  const ParamMap &pParams);
55 
56 protected:
57  SOLVER_UTILS_EXPORT virtual void v_Initialise(
59  const NekDouble &time);
60  SOLVER_UTILS_EXPORT virtual void v_Update(
62  const NekDouble &time);
63  SOLVER_UTILS_EXPORT virtual void v_Finalise(
65  const NekDouble &time);
68  const NekDouble &time) = 0;
71  const NekDouble &time)
72  {
73  // Do nothing by default
74  }
75  SOLVER_UTILS_EXPORT virtual std::string v_GetFileSuffix() = 0;
76 
77  void OutputField(
79  int dump = -1);
80 
82  unsigned int m_numSamples;
83  unsigned int m_outputFrequency;
84  unsigned int m_sampleFrequency;
85  unsigned int m_index;
86  unsigned int m_outputIndex;
87  std::string m_outputFile;
90  std::vector<Array<OneD, NekDouble> > m_outFields;
91  std::vector<std::string> m_variables;
92 };
93 }
94 }
95 
96 #endif /* NEKTAR_SOLVERUTILS_FILTERS_FILTERSAMPLER_H */
std::vector< Array< OneD, NekDouble > > m_outFields
Definition: FilterSampler.h:90
virtual SOLVER_UTILS_EXPORT void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
virtual SOLVER_UTILS_EXPORT std::string v_GetFileSuffix()=0
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
std::map< std::string, std::string > FieldMetaDataMap
Definition: FieldIO.h:53
void OutputField(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, int dump=-1)
LibUtilities::FieldMetaDataMap m_fieldMetaData
Definition: FilterSampler.h:89
std::vector< std::string > m_variables
Definition: FilterSampler.h:91
virtual SOLVER_UTILS_EXPORT void v_ProcessSample(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)=0
virtual SOLVER_UTILS_EXPORT void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
LibUtilities::FieldIOSharedPtr m_fld
Definition: FilterSampler.h:88
boost::shared_ptr< FieldIO > FieldIOSharedPtr
Definition: FieldIO.h:225
double NekDouble
std::map< std::string, std::string > ParamMap
Definition: Filter.h:67
SOLVER_UTILS_EXPORT FilterSampler(const LibUtilities::SessionReaderSharedPtr &pSession, const ParamMap &pParams)
virtual SOLVER_UTILS_EXPORT ~FilterSampler()
#define SOLVER_UTILS_EXPORT
virtual SOLVER_UTILS_EXPORT void v_PrepareOutput(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
Definition: FilterSampler.h:69
virtual SOLVER_UTILS_EXPORT void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)