Nektar++
FilterInterfaces.hpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: FilterInterfaces.hpp
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: Interface class for solvers that support fluid physics
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SOLVERUTILS_FILTERS_FILTERINTERFACES_HPP
36 #define NEKTAR_SOLVERUTILS_FILTERS_FILTERINTERFACES_HPP
37 
38 #include <boost/numeric/ublas/matrix.hpp>
39 #include <boost/numeric/ublas/vector.hpp>
40 
43 
44 namespace Nektar
45 {
46 namespace SolverUtils
47 {
48 
50 {
51 public:
52  virtual ~FluidInterface() = default;
53 
54  /// Extract array with velocity from physfield
56  const Array<OneD, const Array<OneD, NekDouble>> &physfield,
57  Array<OneD, Array<OneD, NekDouble>> &velocity);
58 
60 
61  /// Extract array with density from physfield
63  const Array<OneD, const Array<OneD, NekDouble>> &physfield,
64  Array<OneD, NekDouble> &density);
65 
66  /// Extract array with pressure from physfield
68  const Array<OneD, const Array<OneD, NekDouble>> &physfield,
70 
71  // gave access and set to the moving frame velocity
72  // for Moving reference frame formulation
74  const Array<OneD, NekDouble> &vFrameVels);
75 
77  Array<OneD, NekDouble> &vFrameVels);
78 
79  // gave access and set to the projection matrix that transfers
80  // between stationary inertial frame and moving reference frame
82  const boost::numeric::ublas::matrix<NekDouble> &vProjMat);
83 
85  boost::numeric::ublas::matrix<NekDouble> &vProjMat);
86 
87  // gave access and set the angle between moving frame and stationary
88  // inertial frame
90  const Array<OneD, NekDouble> &vFrameTheta);
91 
93  Array<OneD, NekDouble> &vFrameTheta);
94 
95 protected:
97  const Array<OneD, const Array<OneD, NekDouble>> &physfield,
98  Array<OneD, Array<OneD, NekDouble>> &velocity) = 0;
101  const Array<OneD, const Array<OneD, NekDouble>> &physfield,
102  Array<OneD, NekDouble> &density) = 0;
104  const Array<OneD, const Array<OneD, NekDouble>> &physfield,
107  const Array<OneD, NekDouble> &vFrameVels)
108  {
109  boost::ignore_unused(vFrameVels);
110  }
112  Array<OneD, NekDouble> &vFrameVels)
113  {
114  boost::ignore_unused(vFrameVels);
115  }
117  const boost::numeric::ublas::matrix<NekDouble> &vProjMat)
118  {
119  boost::ignore_unused(vProjMat);
120  }
122  boost::numeric::ublas::matrix<NekDouble> &vProjMat)
123  {
124  boost::ignore_unused(vProjMat);
125  }
127  const Array<OneD, NekDouble> &vFrameTheta)
128  {
129  boost::ignore_unused(vFrameTheta);
130  }
132  Array<OneD, NekDouble> &vFrameTheta)
133  {
134  boost::ignore_unused(vFrameTheta);
135  }
136 };
137 
138 /**
139  *
140  */
142  const Array<OneD, const Array<OneD, NekDouble>> &physfield,
143  Array<OneD, Array<OneD, NekDouble>> &velocity)
144 {
145  v_GetVelocity(physfield, velocity);
146 }
147 
148 /**
149  *
150  */
152 {
153  return v_HasConstantDensity();
154 }
155 
156 /**
157  *
158  */
160  const Array<OneD, const Array<OneD, NekDouble>> &physfield,
161  Array<OneD, NekDouble> &density)
162 {
163  v_GetDensity(physfield, density);
164 }
165 
166 /**
167  *
168  */
170  const Array<OneD, const Array<OneD, NekDouble>> &physfield,
172 {
173  v_GetPressure(physfield, pressure);
174 }
175 
176 /**
177  *
178  */
180  const Array<OneD, NekDouble> &vFrameVels)
181 {
182  v_SetMovingFrameVelocities(vFrameVels);
183 }
184 
185 /**
186  *
187  */
189  Array<OneD, NekDouble> &vFrameVels)
190 {
191  v_GetMovingFrameVelocities(vFrameVels);
192 }
193 
194 /**
195  *
196  */
198  const boost::numeric::ublas::matrix<NekDouble> &vProjMat)
199 {
201 }
202 
203 /**
204  *
205  */
207  boost::numeric::ublas::matrix<NekDouble> &vProjMat)
208 {
210 }
211 
212 /**
213  *
214  */
216  const Array<OneD, NekDouble> &vFrameTheta)
217 {
218  v_SetMovingFrameAngles(vFrameTheta);
219 }
220 
222  Array<OneD, NekDouble> &vFrameTheta)
223 {
224  v_GetMovingFrameAngles(vFrameTheta);
225 }
226 
227 } // namespace SolverUtils
228 } // namespace Nektar
229 
230 #endif
#define SOLVER_UTILS_EXPORT
virtual SOLVER_UTILS_EXPORT void v_SetMovingFrameAngles(const Array< OneD, NekDouble > &vFrameTheta)
SOLVER_UTILS_EXPORT void SetMovingFrameProjectionMat(const boost::numeric::ublas::matrix< NekDouble > &vProjMat)
SOLVER_UTILS_EXPORT void GetMovingFrameVelocities(Array< OneD, NekDouble > &vFrameVels)
SOLVER_UTILS_EXPORT void SetMovingFrameVelocities(const Array< OneD, NekDouble > &vFrameVels)
virtual SOLVER_UTILS_EXPORT bool v_HasConstantDensity()=0
SOLVER_UTILS_EXPORT void SetMovingFrameAngles(const Array< OneD, NekDouble > &vFrameTheta)
virtual SOLVER_UTILS_EXPORT void v_GetMovingFrameVelocities(Array< OneD, NekDouble > &vFrameVels)
virtual SOLVER_UTILS_EXPORT void v_GetPressure(const Array< OneD, const Array< OneD, NekDouble >> &physfield, Array< OneD, NekDouble > &pressure)=0
SOLVER_UTILS_EXPORT bool HasConstantDensity()
virtual SOLVER_UTILS_EXPORT void v_SetMovingFrameVelocities(const Array< OneD, NekDouble > &vFrameVels)
virtual SOLVER_UTILS_EXPORT void v_GetDensity(const Array< OneD, const Array< OneD, NekDouble >> &physfield, Array< OneD, NekDouble > &density)=0
SOLVER_UTILS_EXPORT void GetPressure(const Array< OneD, const Array< OneD, NekDouble >> &physfield, Array< OneD, NekDouble > &pressure)
Extract array with pressure from physfield.
SOLVER_UTILS_EXPORT void GetDensity(const Array< OneD, const Array< OneD, NekDouble >> &physfield, Array< OneD, NekDouble > &density)
Extract array with density from physfield.
SOLVER_UTILS_EXPORT void GetVelocity(const Array< OneD, const Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &velocity)
Extract array with velocity from physfield.
virtual SOLVER_UTILS_EXPORT void v_GetMovingFrameAngles(Array< OneD, NekDouble > &vFrameTheta)
virtual SOLVER_UTILS_EXPORT void v_GetVelocity(const Array< OneD, const Array< OneD, NekDouble >> &physfield, Array< OneD, Array< OneD, NekDouble >> &velocity)=0
SOLVER_UTILS_EXPORT void GetMovingFrameAngles(Array< OneD, NekDouble > &vFrameTheta)
virtual SOLVER_UTILS_EXPORT void v_SetMovingFrameProjectionMat(const boost::numeric::ublas::matrix< NekDouble > &vProjMat)
SOLVER_UTILS_EXPORT void GetMovingFrameProjectionMat(boost::numeric::ublas::matrix< NekDouble > &vProjMat)
virtual SOLVER_UTILS_EXPORT void v_GetMovingFrameProjectionMat(boost::numeric::ublas::matrix< NekDouble > &vProjMat)
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2