Nektar++
IncBaseCondition.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: IncBaseCondition.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: Abstract base class for Extrapolate.
32// params {
33// "X", "Y", "Z", "Theta_x", "Theta_y", "Theta_z", "X0", "Y0",
34// "Z0", "U", "V", "W", "Omega_x", "Omega_y", "Omega_z", "A_x", "A_y",
35// "A_z", "DOmega_x", "DOmega_y", "DOmega_z"};
36// (x, y, z), (x0, y0, z0), (theta, omega, domega) vector in absolute frame
37// (U, V, W), (A_x, A_y, A_z) vector in body frame
38///////////////////////////////////////////////////////////////////////////////
39
40#ifndef NEKTAR_SOLVERS_INCBASECONDITION_H
41#define NEKTAR_SOLVERS_INCBASECONDITION_H
42
49
50namespace Nektar
51{
52
53class IncBaseCondition;
54typedef std::shared_ptr<IncBaseCondition> IncBaseConditionSharedPtr;
55
62
64
66{
67public:
68 virtual ~IncBaseCondition() = default;
69
71 {
72 v_Initialise(pSession);
73 }
74
75 void Update(const Array<OneD, const Array<OneD, NekDouble>> &fields,
76 const Array<OneD, const Array<OneD, NekDouble>> &Adv,
77 std::map<std::string, NekDouble> &params)
78 {
79 v_Update(fields, Adv, params);
80 };
81
82protected:
87 int spacedim, int bnddim);
88
89 virtual void v_Initialise(
91
92 virtual void v_Update(
93 [[maybe_unused]] const Array<OneD, const Array<OneD, NekDouble>>
94 &fields,
95 [[maybe_unused]] const Array<OneD, const Array<OneD, NekDouble>> &Adv,
96 [[maybe_unused]] std::map<std::string, NekDouble> &params)
97 {
98 }
99
100 void ExtrapolateArray(
101 const int numCalls,
103
105
107 const Array<OneD, const Array<OneD, NekDouble>> &fields,
109 std::map<std::string, NekDouble> &params);
110
112 std::map<std::string, NekDouble> &params, int npts0);
113
115 std::map<std::string, NekDouble> &params, int npts0);
116 void InitialiseCoords(std::map<std::string, NekDouble> &params);
117 void SetNumPointsOnPlane0(int &npointsPlane0);
118
120 /// bounday dimensionality
123
126 std::map<int, SpatialDomains::BoundaryConditionShPtr> m_BndConds;
127 std::map<int, MultiRegions::ExpListSharedPtr> m_BndExp;
134
138 std::string classname;
139};
140
141} // namespace Nektar
142
143#endif
#define SOLVER_UTILS_EXPORT
std::map< int, MultiRegions::ExpListSharedPtr > m_BndExp
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_viscous
MultiRegions::ExpListSharedPtr m_field
static NekDouble StifflyStable_Alpha_Coeffs[3][3]
int m_bnddim
bounday dimensionality
void InitialiseCoords(std::map< std::string, NekDouble > &params)
IncBaseCondition(const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, Array< OneD, SpatialDomains::BoundaryConditionShPtr > cond, Array< OneD, MultiRegions::ExpListSharedPtr > exp, int nbnd, int spacedim, int bnddim)
void ExtrapolateArray(const int numCalls, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &array)
virtual void v_Update(const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &Adv, std::map< std::string, NekDouble > &params)
void RigidBodyVelocity(Array< OneD, Array< OneD, NekDouble > > &velocities, std::map< std::string, NekDouble > &params, int npts0)
MultiRegions::ExpListSharedPtr m_bndElmtExps
void RollOver(Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &input)
void AddRigidBodyAcc(Array< OneD, Array< OneD, NekDouble > > &N, std::map< std::string, NekDouble > &params, int npts0)
virtual void v_Initialise(const LibUtilities::SessionReaderSharedPtr &pSession)
static NekDouble StifflyStable_Betaq_Coeffs[3][3]
void Update(const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &Adv, std::map< std::string, NekDouble > &params)
static NekDouble StifflyStable_Gamma0_Coeffs[3]
void SetNumPointsOnPlane0(int &npointsPlane0)
std::map< int, SpatialDomains::BoundaryConditionShPtr > m_BndConds
void Initialise(const LibUtilities::SessionReaderSharedPtr &pSession)
virtual ~IncBaseCondition()=default
void AddVisPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &N, std::map< std::string, NekDouble > &params)
Array< OneD, Array< OneD, NekDouble > > m_coords
Provides a generic Factory class.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< IncBaseCondition > IncBaseConditionSharedPtr
IncBCFactory & GetIncBCFactory()
LibUtilities::NekFactory< std::string, IncBaseCondition, const LibUtilities::SessionReaderSharedPtr, Array< OneD, MultiRegions::ExpListSharedPtr >, Array< OneD, SpatialDomains::BoundaryConditionShPtr >, Array< OneD, MultiRegions::ExpListSharedPtr >, int, int, int > IncBCFactory
double NekDouble