Nektar++
IncBoundaryConditions.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: IncBoundaryConditions.cpp
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: Base class for boundary conditions.
32//
33///////////////////////////////////////////////////////////////////////////////
34
37
38namespace Nektar
39{
40
41std::set<std::string> IncBoundaryConditions::m_BndType = {
42 "MovingFrameFar", "StaticWall", "TransMovingWall", "MovingFrameWall"};
43
45{
46}
47
48/**
49 * Initialize the partial slip boundary conditions
50 * The total points, unit normal vector, and the slip length are assigned
51 */
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
88 BndConds(m_spacedim + 1);
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 {
104 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}
125
127 const Array<OneD, const Array<OneD, NekDouble>> &fields,
128 const Array<OneD, const Array<OneD, NekDouble>> &Adv,
129 std::map<std::string, NekDouble> &params)
130{
131 for (auto &it : m_bounds)
132 {
133 it.second->Update(fields, Adv, params);
134 }
135}
136
137} // namespace Nektar
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
void Initialize(const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
static std::set< std::string > m_BndType
std::map< int, IncBaseConditionSharedPtr > m_bounds
void Update(const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &Adv, std::map< std::string, NekDouble > &params)
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
IncBCFactory & GetIncBCFactory()