Nektar++
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
Nektar::MovingFrameFar Class Reference

#include <MovingFrameFar.h>

Inheritance diagram for Nektar::MovingFrameFar:
[legend]

Public Member Functions

 ~MovingFrameFar () override
 
- Public Member Functions inherited from Nektar::IncBaseCondition
virtual ~IncBaseCondition ()
 
void Update (const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &Adv, std::map< std::string, NekDouble > &params)
 
void Initialise (const LibUtilities::SessionReaderSharedPtr &pSession)
 

Static Public Member Functions

static IncBaseConditionSharedPtr create (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)
 

Static Public Attributes

static std::string className
 

Protected Member Functions

void v_Initialise (const LibUtilities::SessionReaderSharedPtr &pSession) override
 
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) override
 
 MovingFrameFar (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)
 
- Protected Member Functions inherited from Nektar::IncBaseCondition
 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)
 
virtual void v_Initialise (const LibUtilities::SessionReaderSharedPtr &pSession)
 
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 ExtrapolateArray (const int numCalls, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &array)
 
void RollOver (Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &input)
 
void AddVisPressureBCs (const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &N, std::map< std::string, NekDouble > &params)
 
void AddRigidBodyAcc (Array< OneD, Array< OneD, NekDouble > > &N, std::map< std::string, NekDouble > &params, int npts0)
 
void RigidBodyVelocity (Array< OneD, Array< OneD, NekDouble > > &velocities, std::map< std::string, NekDouble > &params, int npts0)
 
void InitialiseCoords (std::map< std::string, NekDouble > &params)
 
void SetNumPointsOnPlane0 (int &npointsPlane0)
 

Protected Attributes

std::vector< LibUtilities::Equationm_definedVels
 
- Protected Attributes inherited from Nektar::IncBaseCondition
int m_spacedim
 
int m_bnddim
 bounday dimensionality More...
 
int m_nbnd
 
int m_numCalls
 
int m_intSteps
 
std::map< int, SpatialDomains::BoundaryConditionShPtrm_BndConds
 
std::map< int, MultiRegions::ExpListSharedPtrm_BndExp
 
int m_npoints
 
Array< OneD, Array< OneD, NekDouble > > m_coords
 
MultiRegions::ExpListSharedPtr m_bndElmtExps
 
MultiRegions::ExpListSharedPtr m_field
 
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_viscous
 
int m_pressure
 
std::string classname
 

Friends

class MemoryManager< MovingFrameFar >
 

Additional Inherited Members

- Static Protected Attributes inherited from Nektar::IncBaseCondition
static NekDouble StifflyStable_Betaq_Coeffs [3][3]
 
static NekDouble StifflyStable_Alpha_Coeffs [3][3]
 
static NekDouble StifflyStable_Gamma0_Coeffs [3]
 

Detailed Description

Definition at line 48 of file MovingFrameFar.h.

Constructor & Destructor Documentation

◆ ~MovingFrameFar()

Nektar::MovingFrameFar::~MovingFrameFar ( )
override

Definition at line 65 of file MovingFrameFar.cpp.

66{
67}

◆ MovingFrameFar()

Nektar::MovingFrameFar::MovingFrameFar ( 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 
)
protected

Definition at line 45 of file MovingFrameFar.cpp.

52 : IncBaseCondition(pSession, pFields, cond, exp, nbnd, spacedim, bnddim)
53{
54 classname = "MovingFrameFar";
55 for (size_t i = 0; i < m_spacedim; ++i)
56 {
57 m_BndConds[i] = cond[i];
58 if (cond[i]->GetUserDefined() == classname)
59 {
60 m_BndExp[i] = exp[i];
61 }
62 }
63}
std::map< int, MultiRegions::ExpListSharedPtr > m_BndExp
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)
std::map< int, SpatialDomains::BoundaryConditionShPtr > m_BndConds

References Nektar::IncBaseCondition::classname, Nektar::IncBaseCondition::m_BndConds, Nektar::IncBaseCondition::m_BndExp, and Nektar::IncBaseCondition::m_spacedim.

Member Function Documentation

◆ create()

static IncBaseConditionSharedPtr Nektar::MovingFrameFar::create ( 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 
)
inlinestatic

Definition at line 53 of file MovingFrameFar.h.

59 {
62 pSession, pFields, cond, exp, nbnd, spacedim, bnddim);
63 p->Initialise(pSession);
64 return p;
65 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< IncBaseCondition > IncBaseConditionSharedPtr

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and CellMLToNektar.cellml_metadata::p.

◆ v_Initialise()

void Nektar::MovingFrameFar::v_Initialise ( const LibUtilities::SessionReaderSharedPtr pSession)
overrideprotectedvirtual

Reimplemented from Nektar::IncBaseCondition.

Definition at line 69 of file MovingFrameFar.cpp.

71{
73 m_definedVels.clear();
74 for (int k = 0; k < m_spacedim; ++k)
75 {
76 m_definedVels.push_back(
77 std::static_pointer_cast<
78 SpatialDomains::DirichletBoundaryCondition>(m_BndConds[k])
79 ->m_dirichletCondition);
80 }
81}
virtual void v_Initialise(const LibUtilities::SessionReaderSharedPtr &pSession)
std::vector< LibUtilities::Equation > m_definedVels

References Nektar::IncBaseCondition::m_BndConds, m_definedVels, Nektar::IncBaseCondition::m_spacedim, and Nektar::IncBaseCondition::v_Initialise().

◆ v_Update()

void Nektar::MovingFrameFar::v_Update ( const Array< OneD, const Array< OneD, NekDouble > > &  fields,
const Array< OneD, const Array< OneD, NekDouble > > &  Adv,
std::map< std::string, NekDouble > &  params 
)
overrideprotectedvirtual

Reimplemented from Nektar::IncBaseCondition.

Definition at line 83 of file MovingFrameFar.cpp.

87{
88 int nptsPlane0 = 0;
89 SetNumPointsOnPlane0(nptsPlane0);
90 if (0 == nptsPlane0)
91 {
92 return;
93 }
94 NekDouble time = 0.;
95 if (params.find("Time") != params.end())
96 {
97 time = params["Time"];
98 }
99 Array<OneD, NekDouble> vels(m_spacedim, 0.0);
100 for (int i = 0; i < m_spacedim; ++i)
101 {
102 vels[i] = m_definedVels[i].Evaluate(0., 0., 0., time);
103 }
104 if (params.find("Theta_z") != params.end())
105 {
106 NekDouble v0 = vels[0], v1 = vels[1];
107 NekDouble c = cos(params["Theta_z"]), s = sin(params["Theta_z"]);
108 vels[0] = v0 * c + v1 * s;
109 vels[1] = -v0 * s + v1 * c;
110 }
111 for (auto &it : m_BndExp)
112 {
113 int k = it.first;
114 if (it.second->GetExpType() == MultiRegions::e2DH1D)
115 {
116 Array<OneD, NekDouble> tmpvel =
117 it.second->GetPlane(0)->UpdatePhys();
118 Vmath::Fill(nptsPlane0, vels[k], tmpvel, 1);
119 it.second->GetPlane(0)->FwdTransBndConstrained(
120 tmpvel, it.second->GetPlane(0)->UpdateCoeffs());
121 }
122 else
123 {
124 Array<OneD, NekDouble> tmpvel = it.second->UpdatePhys();
125 Vmath::Fill(nptsPlane0, vels[k], tmpvel, 1);
126 it.second->FwdTransBndConstrained(tmpvel,
127 it.second->UpdateCoeffs());
128 }
129 }
130}
void SetNumPointsOnPlane0(int &npointsPlane0)
double NekDouble
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.hpp:54

References Nektar::MultiRegions::e2DH1D, Vmath::Fill(), Nektar::IncBaseCondition::m_BndExp, m_definedVels, Nektar::IncBaseCondition::m_spacedim, and Nektar::IncBaseCondition::SetNumPointsOnPlane0().

Friends And Related Function Documentation

◆ MemoryManager< MovingFrameFar >

friend class MemoryManager< MovingFrameFar >
friend

Definition at line 1 of file MovingFrameFar.h.

Member Data Documentation

◆ className

std::string Nektar::MovingFrameFar::className
static
Initial value:
=
"MovingFrameFar", MovingFrameFar::create,
"Far field boundary condition of moving reference frame")
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static IncBaseConditionSharedPtr create(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)
IncBCFactory & GetIncBCFactory()

Definition at line 67 of file MovingFrameFar.h.

◆ m_definedVels

std::vector<LibUtilities::Equation> Nektar::MovingFrameFar::m_definedVels
protected

Definition at line 79 of file MovingFrameFar.h.

Referenced by v_Initialise(), and v_Update().