Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FilterFieldConvert.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File FilterFieldConvert.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_FILTERFIELDCONVERT_H
38 #define NEKTAR_SOLVERUTILS_FILTERS_FILTERFIELDCONVERT_H
39 
41 #include <FieldUtils/Module.h>
42 
43 using namespace Nektar::FieldUtils;
44 
45 namespace Nektar
46 {
47 namespace SolverUtils
48 {
49 class FilterFieldConvert : public Filter
50 {
51 public:
53 
54  /// Creates an instance of this class
57  const std::map<std::string, std::string> &pParams)
58  {
60  ::AllocateSharedPtr(pSession, pParams);
61  return p;
62  }
63 
64  ///Name of the class
65  static std::string className;
66 
69  const ParamMap &pParams);
71 
72 protected:
73  SOLVER_UTILS_EXPORT virtual void v_Initialise(
75  const NekDouble &time);
76  SOLVER_UTILS_EXPORT virtual void v_FillVariablesName(
78  SOLVER_UTILS_EXPORT virtual void v_Update(
80  const NekDouble &time);
81  SOLVER_UTILS_EXPORT virtual void v_Finalise(
83  const NekDouble &time);
86  const NekDouble &time)
87  {
88  // Do nothing by default
89  }
90  SOLVER_UTILS_EXPORT virtual void v_PrepareOutput(
92  const NekDouble &time);
94  {
95  return 1.0;
96  }
97  SOLVER_UTILS_EXPORT virtual std::string v_GetFileSuffix()
98  {
99  return "_fc";
100  }
101 
102  void OutputField(
104  int dump = -1);
105 
106  SOLVER_UTILS_EXPORT virtual bool v_IsTimeDependent();
107 
108  void CreateModules( vector<string> &modcmds);
109 
110  void CreateFields(
112 
113  void ClearFields();
114 
115  unsigned int m_numSamples;
116  unsigned int m_outputFrequency;
117  unsigned int m_sampleFrequency;
118  std::string m_outputFile;
119  std::string m_restartFile;
120  unsigned int m_index;
121  unsigned int m_outputIndex;
122  vector<ModuleSharedPtr> m_modules;
124  std::vector<Array<OneD, NekDouble> > m_outFields;
125  std::vector<std::string> m_variables;
127 };
128 }
129 }
130 
131 #endif /* NEKTAR_SOLVERUTILS_FILTERS_FILTERFIELDCONVERT_H */
LibUtilities::FieldMetaDataMap m_fieldMetaData
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
static std::string className
Name of the class.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::vector< Array< OneD, NekDouble > > m_outFields
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
std::map< std::string, std::string > FieldMetaDataMap
Definition: FieldIO.h:54
virtual SOLVER_UTILS_EXPORT std::string v_GetFileSuffix()
boost::shared_ptr< Field > FieldSharedPtr
Definition: Field.hpp:740
boost::shared_ptr< Filter > FilterSharedPtr
A shared pointer to a Driver object.
Definition: Filter.h:50
static FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::map< std::string, std::string > &pParams)
Creates an instance of this class.
virtual SOLVER_UTILS_EXPORT NekDouble v_GetScale()
double NekDouble
std::map< std::string, std::string > ParamMap
Definition: Filter.h:67
virtual SOLVER_UTILS_EXPORT void v_ProcessSample(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time)
#define SOLVER_UTILS_EXPORT