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

#include <IncBoundaryConditions.h>

Public Member Functions

 IncBoundaryConditions ()
 
void Initialize (const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
 
void Update (const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &Adv, std::map< std::string, NekDouble > &params)
 

Protected Attributes

std::map< int, IncBaseConditionSharedPtrm_bounds
 
int m_spacedim
 
int m_bnd_dim
 

Static Protected Attributes

static std::set< std::string > m_BndType
 

Detailed Description

Definition at line 49 of file IncBoundaryConditions.h.

Constructor & Destructor Documentation

◆ IncBoundaryConditions()

Nektar::IncBoundaryConditions::IncBoundaryConditions ( )

Definition at line 44 of file IncBoundaryConditions.cpp.

45{
46}

Member Function Documentation

◆ Initialize()

void Nektar::IncBoundaryConditions::Initialize ( const LibUtilities::SessionReaderSharedPtr  pSession,
Array< OneD, MultiRegions::ExpListSharedPtr pFields 
)

Initialize the partial slip boundary conditions The total points, unit normal vector, and the slip length are assigned

Definition at line 52 of file IncBoundaryConditions.cpp.

55{
56 switch (pFields[0]->GetExpType())
57 {
59 {
60 m_spacedim = 2;
61 m_bnd_dim = 2;
62 }
63 break;
65 {
66 m_spacedim = 3;
67 m_bnd_dim = 2;
68 }
69 break;
71 {
72 m_spacedim = 3;
73 m_bnd_dim = 1;
74 }
75 break;
77 {
78 m_spacedim = 3;
79 m_bnd_dim = 3;
80 }
81 break;
82 default:
83 ASSERTL0(0, "Dimension not supported");
84 break;
85 }
86
87 Array<OneD, Array<OneD, const SpatialDomains::BoundaryConditionShPtr>>
88 BndConds(m_spacedim + 1);
89 Array<OneD, Array<OneD, MultiRegions::ExpListSharedPtr>> BndExp(m_spacedim +
90 1);
91
92 for (int i = 0; i < m_spacedim; ++i)
93 {
94 BndConds[i] = pFields[i]->GetBndConditions();
95 BndExp[i] = pFields[i]->GetBndCondExpansions();
96 }
97 int npress = pFields.size() - 1;
98 BndConds[m_spacedim] = pFields[npress]->GetBndConditions();
99 BndExp[m_spacedim] = pFields[npress]->GetBndCondExpansions();
100
101 for (size_t n = 0; n < BndExp[0].size(); ++n)
102 {
103 Array<OneD, SpatialDomains::BoundaryConditionShPtr> cond(
104 BndConds.size());
105 Array<OneD, MultiRegions::ExpListSharedPtr> exp(BndConds.size());
106 std::string bndtype;
107 for (int k = 0; k < BndConds.size(); ++k)
108 {
109 cond[k] = BndConds[k][n];
110 exp[k] = BndExp[k][n];
111 if (bndtype.size() == 0 &&
112 m_BndType.find(cond[k]->GetUserDefined()) != m_BndType.end())
113 {
114 bndtype = cond[k]->GetUserDefined();
115 }
116 }
117 if (bndtype.size())
118 {
120 bndtype, pSession, pFields, cond, exp, n, m_spacedim,
121 m_bnd_dim);
122 }
123 }
124}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
static std::set< std::string > m_BndType
std::map< int, IncBaseConditionSharedPtr > m_bounds
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
IncBCFactory & GetIncBCFactory()

References ASSERTL0, Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::MultiRegions::e2D, Nektar::MultiRegions::e3D, Nektar::MultiRegions::e3DH1D, Nektar::MultiRegions::e3DH2D, Nektar::GetIncBCFactory(), m_bnd_dim, m_BndType, m_bounds, and m_spacedim.

◆ Update()

void Nektar::IncBoundaryConditions::Update ( const Array< OneD, const Array< OneD, NekDouble > > &  fields,
const Array< OneD, const Array< OneD, NekDouble > > &  Adv,
std::map< std::string, NekDouble > &  params 
)

Definition at line 126 of file IncBoundaryConditions.cpp.

130{
131 for (auto &it : m_bounds)
132 {
133 it.second->Update(fields, Adv, params);
134 }
135}

References m_bounds.

Member Data Documentation

◆ m_bnd_dim

int Nektar::IncBoundaryConditions::m_bnd_dim
protected

Definition at line 65 of file IncBoundaryConditions.h.

Referenced by Initialize().

◆ m_BndType

std::set< std::string > Nektar::IncBoundaryConditions::m_BndType
staticprotected
Initial value:
= {
"MovingFrameFar", "StaticWall", "TransMovingWall", "MovingFrameWall"}

Definition at line 63 of file IncBoundaryConditions.h.

Referenced by Initialize().

◆ m_bounds

std::map<int, IncBaseConditionSharedPtr> Nektar::IncBoundaryConditions::m_bounds
protected

Definition at line 62 of file IncBoundaryConditions.h.

Referenced by Initialize(), and Update().

◆ m_spacedim

int Nektar::IncBoundaryConditions::m_spacedim
protected

Definition at line 64 of file IncBoundaryConditions.h.

Referenced by Initialize().