Nektar++
FilterHistoryPoints.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: FilterHistoryPoints.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_SOLVERUTILS_FILTERS_FILTERHISTORYPOINTS_H
36#define NEKTAR_SOLVERUTILS_FILTERS_FILTERHISTORYPOINTS_H
37
41
42namespace Nektar::SolverUtils
43{
44
46{
47public:
49
50 /// Creates an instance of this class
53 const std::weak_ptr<EquationSystem> &pEquation,
54 const std::map<std::string, std::string> &pParams)
55 {
58 pSession, pEquation, pParams);
59 return p;
60 }
61
62 /// Name of the class
63 static std::string className;
64
67 const std::weak_ptr<EquationSystem> &pEquation,
68 const ParamMap &pParams);
70
71protected:
74 const NekDouble &time) override;
77 const NekDouble &time) override;
80 const NekDouble &time) override;
82 bool GetPoint(Array<OneD, NekDouble> gloCoord, int I);
83 SOLVER_UTILS_EXPORT void v_WriteData(const int &rank,
84 const Array<OneD, NekDouble> &data,
85 const int &numFields,
86 const NekDouble &time);
87
91 unsigned int m_index = 0;
92 unsigned int m_outputFrequency;
93 /// plane to take history point from if using a homogeneous1D expansion
95 std::vector<int> m_planeIDs;
98 std::string m_outputFile;
99 std::ofstream m_outputStream;
100 std::stringstream m_historyPointStream;
101 // List of history points that are local to this process
102 // Content of tuple:
103 // [0] = global coordinates
104 // [1] = local coordinates
105 // [2] = global index of history point
106 // [3] = expansion index of history point
107 std::list<std::tuple<Array<OneD, const NekDouble>,
110 std::map<LibUtilities::PtsType, Array<OneD, NekDouble>> m_pointDatMap;
111 std::map<LibUtilities::PtsType, Array<OneD, int>> m_pointNumMap;
112 unsigned int m_outputIndex = 0;
115};
116
117} // namespace Nektar::SolverUtils
118
119#endif /* NEKTAR_SOLVERUTILS_FILTERS_FILTERCHECKPOINT_H */
#define SOLVER_UTILS_EXPORT
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.
SOLVER_UTILS_EXPORT void v_WriteData(const int &rank, const Array< OneD, NekDouble > &data, const int &numFields, const NekDouble &time)
SOLVER_UTILS_EXPORT ~FilterHistoryPoints() override
Array< OneD, Array< OneD, const NekDouble > > m_historyPoints
bool GetPoint(Array< OneD, NekDouble > gloCoord, int I)
static std::string className
Name of the class.
std::map< LibUtilities::PtsType, Array< OneD, int > > m_pointNumMap
SOLVER_UTILS_EXPORT void v_Update(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
int m_outputPlane
plane to take history point from if using a homogeneous1D expansion
static FilterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< EquationSystem > &pEquation, const std::map< std::string, std::string > &pParams)
Creates an instance of this class.
SOLVER_UTILS_EXPORT void v_Finalise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
std::list< std::tuple< Array< OneD, const NekDouble >, Array< OneD, const NekDouble >, int, int > > m_historyList
SOLVER_UTILS_EXPORT bool v_IsTimeDependent() override
std::map< LibUtilities::PtsType, Array< OneD, NekDouble > > m_pointDatMap
SOLVER_UTILS_EXPORT FilterHistoryPoints(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< EquationSystem > &pEquation, const ParamMap &pParams)
SOLVER_UTILS_EXPORT void v_Initialise(const Array< OneD, const MultiRegions::ExpListSharedPtr > &pFields, const NekDouble &time) override
std::map< std::string, std::string > ParamMap
Definition: Filter.h:65
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Filter > FilterSharedPtr
A shared pointer to a Driver object.
Definition: Filter.h:51
double NekDouble