Nektar++
Loading...
Searching...
No Matches
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#include <set>
44
45namespace Nektar::SolverUtils
46{
47
49{
50public:
51 virtual ~FluidInterface() = default;
52
53 /// Extract array with velocity from physfield
55 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
57
59
60 /// Extract array with density from physfield
62 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
63 Array<OneD, NekDouble> &density);
64
65 /// Extract array with pressure from physfield
67 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
68 Array<OneD, NekDouble> &pressure);
69
70 // gave access and set to the moving frame velocity
71 // for Moving reference frame formulation
73 const Array<OneD, NekDouble> &vFrameVels);
74
76 Array<OneD, NekDouble> &vFrameVels);
77
78 // gave access and set the displacement and angles between moving frame and
79 // stationary one
81 const Array<OneD, NekDouble> &vFrameDisp);
82
84 Array<OneD, NekDouble> &vFrameDisp);
85
87 const Array<OneD, NekDouble> &vFramePivot);
88
90 Array<OneD, NekDouble> &vFramePivot);
91
92 SOLVER_UTILS_EXPORT void SetMovableDoFs(const std::set<int> &dirDoFs);
93
94 SOLVER_UTILS_EXPORT void GetMovableDoFs(std::set<int> &dirDoFs);
95
96 /// Set aerodynamic force and moment
98
99 /// Get aerodynamic force and moment
101
102protected:
104 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
105 Array<OneD, Array<OneD, NekDouble>> &velocity) = 0;
108 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
109 Array<OneD, NekDouble> &density) = 0;
111 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
112 Array<OneD, NekDouble> &pressure) = 0;
114 [[maybe_unused]] const Array<OneD, NekDouble> &vFrameVels)
115 {
116 }
118 [[maybe_unused]] Array<OneD, NekDouble> &vFrameVels)
119 {
120 return false;
121 }
123 [[maybe_unused]] const Array<OneD, NekDouble> &vFrameDisp)
124 {
125 }
127 [[maybe_unused]] Array<OneD, NekDouble> &vFrameDisp)
128 {
129 return false;
130 }
132 [[maybe_unused]] const Array<OneD, NekDouble> &vFramePivot)
133 {
134 }
136 [[maybe_unused]] Array<OneD, NekDouble> &vFramePivot)
137 {
138 }
139
141 [[maybe_unused]] Array<OneD, NekDouble> forces)
142 {
143 }
144
146 [[maybe_unused]] Array<OneD, NekDouble> forces)
147 {
148 }
150 [[maybe_unused]] const std::set<int> &dirDoFs)
151 {
152 }
154 [[maybe_unused]] std::set<int> &dirDoFs)
155 {
156 }
157};
158
159/**
160 *
161 */
163 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
165{
166 v_GetVelocity(physfield, velocity);
167}
168
169/**
170 *
171 */
173{
174 return v_HasConstantDensity();
175}
176
177/**
178 *
179 */
181 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
182 Array<OneD, NekDouble> &density)
183{
184 v_GetDensity(physfield, density);
185}
186
187/**
188 *
189 */
191 const Array<OneD, const Array<OneD, NekDouble>> &physfield,
192 Array<OneD, NekDouble> &pressure)
193{
194 v_GetPressure(physfield, pressure);
195}
196
197/**
198 *
199 */
201 const Array<OneD, NekDouble> &vFrameVels)
202{
203 v_SetMovingFrameVelocities(vFrameVels);
204}
205
206/**
207 *
208 */
210 Array<OneD, NekDouble> &vFrameVels)
211{
212 return v_GetMovingFrameVelocities(vFrameVels);
213}
214
215/**
216 *
217 */
219 const Array<OneD, NekDouble> &vFrameDisp)
220{
221 v_SetMovingFrameDisp(vFrameDisp);
222}
223
224/**
225 *
226 */
228 const Array<OneD, NekDouble> &vFramePivot)
229{
230 v_SetMovingFramePivot(vFramePivot);
231}
232
234 Array<OneD, NekDouble> &vFramePivot)
235{
236 v_GetMovingFramePivot(vFramePivot);
237}
238
240 Array<OneD, NekDouble> &vFrameDisp)
241{
242 return v_GetMovingFrameDisp(vFrameDisp);
243}
244
246{
247 v_SetAeroForce(forces);
248}
249
251{
252 v_GetAeroForce(forces);
253}
254inline void FluidInterface::SetMovableDoFs(const std::set<int> &dirDoFs)
255{
256 v_SetMovableDoFs(dirDoFs);
257}
258
259inline void FluidInterface::GetMovableDoFs(std::set<int> &dirDoFs)
260{
261 v_GetMovableDoFs(dirDoFs);
262}
263
264} // namespace Nektar::SolverUtils
265
266#endif
#define SOLVER_UTILS_EXPORT
virtual SOLVER_UTILS_EXPORT void v_GetDensity(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &density)=0
SOLVER_UTILS_EXPORT void SetAeroForce(Array< OneD, NekDouble > forces)
Set aerodynamic force and moment.
SOLVER_UTILS_EXPORT void SetMovableDoFs(const std::set< int > &dirDoFs)
virtual SOLVER_UTILS_EXPORT void v_SetMovableDoFs(const std::set< int > &dirDoFs)
SOLVER_UTILS_EXPORT void GetMovingFramePivot(Array< OneD, NekDouble > &vFramePivot)
SOLVER_UTILS_EXPORT void SetMovingFrameVelocities(const Array< OneD, NekDouble > &vFrameVels)
virtual SOLVER_UTILS_EXPORT bool v_HasConstantDensity()=0
SOLVER_UTILS_EXPORT bool GetMovingFrameVelocities(Array< OneD, NekDouble > &vFrameVels)
virtual SOLVER_UTILS_EXPORT bool v_GetMovingFrameDisp(Array< OneD, NekDouble > &vFrameDisp)
SOLVER_UTILS_EXPORT bool HasConstantDensity()
virtual SOLVER_UTILS_EXPORT void v_GetMovableDoFs(std::set< int > &dirDoFs)
virtual SOLVER_UTILS_EXPORT void v_SetMovingFrameVelocities(const Array< OneD, NekDouble > &vFrameVels)
SOLVER_UTILS_EXPORT void SetMovingFrameDisp(const Array< OneD, NekDouble > &vFrameDisp)
virtual SOLVER_UTILS_EXPORT void v_GetMovingFramePivot(Array< OneD, NekDouble > &vFramePivot)
SOLVER_UTILS_EXPORT void GetDensity(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &density)
Extract array with density from physfield.
virtual SOLVER_UTILS_EXPORT void v_GetAeroForce(Array< OneD, NekDouble > forces)
SOLVER_UTILS_EXPORT void GetAeroForce(Array< OneD, NekDouble > forces)
Get aerodynamic force and moment.
SOLVER_UTILS_EXPORT void GetMovableDoFs(std::set< int > &dirDoFs)
virtual SOLVER_UTILS_EXPORT void v_SetAeroForce(Array< OneD, NekDouble > forces)
virtual SOLVER_UTILS_EXPORT void v_SetMovingFramePivot(const Array< OneD, NekDouble > &vFramePivot)
virtual SOLVER_UTILS_EXPORT bool v_GetMovingFrameVelocities(Array< OneD, NekDouble > &vFrameVels)
SOLVER_UTILS_EXPORT void GetPressure(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure)
Extract array with pressure from physfield.
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 GetVelocity(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity)
Extract array with velocity from physfield.
SOLVER_UTILS_EXPORT void SetMovingFramePivot(const Array< OneD, NekDouble > &vFramePivot)
virtual SOLVER_UTILS_EXPORT void v_GetPressure(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &pressure)=0
SOLVER_UTILS_EXPORT bool GetMovingFrameDisp(Array< OneD, NekDouble > &vFrameDisp)
virtual SOLVER_UTILS_EXPORT void v_SetMovingFrameDisp(const Array< OneD, NekDouble > &vFrameDisp)