ASL 0.1.7
Advanced Simulation Library
Loading...
Searching...
No Matches
aslBCond.h
Go to the documentation of this file.
1/*
2 * Advanced Simulation Library <http://asl.org.il>
3 *
4 * Copyright 2015 Avtech Scientific <http://avtechscientific.com>
5 *
6 *
7 * This file is part of Advanced Simulation Library (ASL).
8 *
9 * ASL is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU Affero General Public License as
11 * published by the Free Software Foundation, version 3 of the License.
12 *
13 * ASL is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with ASL. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23
24#ifndef ASLBCOND_H
25#define ASLBCOND_H
26
27#include "aslNumMethod.h"
28#include <data/aslBlocks.h>
30
31
32namespace acl
33{
34 class ExpressionContainer;
35}
36
37namespace asl
38{
39
40 class VectorTemplate;
41 template <typename V> class DataWithGhostNodes;
42 typedef DataWithGhostNodes<acl::VectorOfElementsData> DataWithGhostNodesACLData;
43 typedef std::shared_ptr<DataWithGhostNodesACLData> SPDataWithGhostNodesACLData;
44 typedef DataWithGhostNodes<acl::VectorOfElements> DataWithGhostNodesACL;
45 typedef std::shared_ptr<DataWithGhostNodesACL> SPDataWithGhostNodesACL;
46 class TemplateVE;
47 class DistanceFunction;
48 typedef std::shared_ptr<DistanceFunction> SPDistanceFunction;
49
50
51 class AbstractDataWithGhostNodes;
52 typedef std::shared_ptr<AbstractDataWithGhostNodes> SPAbstractDataWithGhostNodes;
53
55
58 class BCond: public NumMethod
59 {
60 protected:
62 const VectorTemplate * const templ;
63
64 std::vector<int> indices;
65 std::vector<int> directions;
66 std::vector<double> fractions;
67 std::vector<int> neighbourIndices;
68
73
78
79 public:
80 BCond(const Block & b);
81 BCond(const Block & b, const VectorTemplate * const t);
82 void addPoint(AVec<int> a,int d=0,double fr=0);
83 const Block & getBlock();
84 inline const VectorTemplate * getVT();
85
86 };
87
88 typedef std::shared_ptr<BCond> SPBCond;
89
91
101 {
102 protected:
106 const VectorTemplate * const templ;
107
116
117 unique_ptr<TemplateVE> mapTVE;
118 unique_ptr<TemplateVE> cDomainTVE;
119
123
128
133
136 acl::VectorOfElements isComputationNode(const vector<unsigned int> & ii);
141
151 BCondWithMap(SPDistanceFunction m, const Block & b, const VectorTemplate * const vt);
159 const VectorTemplate * const vt);
167 const VectorTemplate * const vt);
176 const Block & b,
177 const VectorTemplate * const vt);
178 public:
179 inline const VectorTemplate * getVT();
180 };
181
182
184
190 {
191 protected:
194
195 std::vector<int> indices1;
196 std::vector<int> directions1;
197 std::vector<int> indices2;
198 std::vector<int> directions2;
199
204
207 public:
208 BCondConnector(const Block & b1, const Block & b2);
210 void addGhostPoint(AVec<int> a1,int d1,AVec<int> a2,int d2);
211 const Block & getBlock1();
212 const Block & getBlock2();
213 };
214
215
217
228 {
229 protected:
231 const VectorTemplate * const templ;
232
238
239 public:
240 BCondSlice(const Block & b);
241 BCondSlice(const Block & b, const VectorTemplate * const t);
242 void addGhostSlice(AVec<int> pB,AVec<int> pE, int dir);
243 const Block & getBlock();
244 };
245
247
259 {
260 protected:
263 const VectorTemplate * const templ;
264
270
276
277 public:
278 BCondConnectorSlice(const Block & b1, const Block & b2, const VectorTemplate *const t);
279 void addGhostSlice1(AVec<int> pB,AVec<int> pE, int dir);
280 void addGhostSlice2(AVec<int> pB,AVec<int> pE, int dir);
281 const Block & getBlock1();
282 const Block & getBlock2();
283 };
284
286
293 {
294 protected:
296 const VectorTemplate * const templ;
297
300
301 public:
302 BCondDynamic(const Block & b);
303 BCondDynamic(const Block & b, const VectorTemplate * const t);
304 const Block & getBlock();
305 inline const VectorTemplate * getVT();
306 };
307
309 enum SlicesNames {X0, XE, Y0, YE, Z0, ZE};
310
320
321 void addSlices(BCond &, const vector<SlicesNames> &);
322
325 void addSliceX(BCond &, int x);
326 void addSliceY(BCond &, int y);
327 void addSliceZ(BCond &, int z);
329
339
340// --------------------------- Implementation ----------------------
342 {
343 return templ;
344 }
345
347 {
348 return templ;
349 }
350
351}
352
353#endif //ASLBCOND_H
The class represents several Element.
Virtual class describes general interface for boundary conditions which connect two datas.
Definition aslBCond.h:190
const Block & getBlock1()
acl::SPVectorOfElementsData directions1ACL
Definition aslBCond.h:201
BCondConnector(const Block &b1, const Block &b2)
void addGhostPoint(AVec< int > a1, int d1, AVec< int > a2, int d2)
std::vector< int > indices2
Definition aslBCond.h:197
acl::SPVectorOfElementsData indices1ACL
Definition aslBCond.h:200
std::vector< int > directions2
Definition aslBCond.h:198
void addGhostPoint(AVec< int > a1, AVec< int > a2)
acl::SPVectorOfElementsData directions2ACL
Definition aslBCond.h:203
std::vector< int > indices1
Definition aslBCond.h:195
std::vector< int > directions1
Definition aslBCond.h:196
const Block & getBlock2()
acl::SPVectorOfElementsData indices2ACL
Definition aslBCond.h:202
Virtual class describes general interface for boundary conditions which connect two datas.
Definition aslBCond.h:259
AVec< int > sliceDimentions1
Definition aslBCond.h:267
AVec< int > sliceIncrements1
Definition aslBCond.h:268
void addGhostSlice2(AVec< int > pB, AVec< int > pE, int dir)
const Block & getBlock1()
const VectorTemplate *const templ
Definition aslBCond.h:263
void addGhostSlice1(AVec< int > pB, AVec< int > pE, int dir)
AVec< int > sliceDimentions2
Definition aslBCond.h:273
BCondConnectorSlice(const Block &b1, const Block &b2, const VectorTemplate *const t)
const Block & getBlock2()
AVec< int > sliceIncrements2
Definition aslBCond.h:274
Virtual class describes general interface for boundary conditions.
Definition aslBCond.h:293
const VectorTemplate *const templ
Definition aslBCond.h:296
const VectorTemplate * getVT()
BCondDynamic(const Block &b, const VectorTemplate *const t)
acl::SPVectorOfElementsData normalsACL
Definition aslBCond.h:299
const Block & getBlock()
acl::SPVectorOfElementsData pointsACL
Definition aslBCond.h:298
BCondDynamic(const Block &b)
Virtual class describes general interface for boundary conditions.
Definition aslBCond.h:59
BCond(const Block &b, const VectorTemplate *const t)
std::vector< int > directions
Definition aslBCond.h:65
acl::SPVectorOfElementsData neighbourIndicesACL
Definition aslBCond.h:70
void loadfractionsACL()
std::vector< int > neighbourIndices
Definition aslBCond.h:67
std::vector< int > indices
Definition aslBCond.h:64
void loadDirectionsToACL()
Block block
Definition aslBCond.h:61
BCond(const Block &b)
const VectorTemplate *const templ
Definition aslBCond.h:62
void loadIndicesToACL()
acl::SPVectorOfElementsData directionsACL
Definition aslBCond.h:71
void addPoint(AVec< int > a, int d=0, double fr=0)
void loadNeighbourIndicesToACL()
const VectorTemplate * getVT()
Definition aslBCond.h:341
acl::SPVectorOfElementsData indicesACL
Definition aslBCond.h:69
acl::SPVectorOfElementsData fractionsACL
Definition aslBCond.h:72
std::vector< double > fractions
Definition aslBCond.h:66
const Block & getBlock()
Virtual class describes general interface for boundary conditions.
Definition aslBCond.h:228
BCondSlice(const Block &b)
BCondSlice(const Block &b, const VectorTemplate *const t)
AVec< int > sliceDimentions
Definition aslBCond.h:235
const Block & getBlock()
const VectorTemplate *const templ
Definition aslBCond.h:231
void addGhostSlice(AVec< int > pB, AVec< int > pE, int dir)
AVec< int > sliceIncrements
Definition aslBCond.h:236
Virtual class describes general interface for boundary conditions.
Definition aslBCond.h:101
acl::VectorOfElements isGhostNode(unsigned int i)
returns expression corresponding to check if the node in i^th direction is ghost one
const VectorTemplate * getVT()
Definition aslBCond.h:346
acl::VectorOfElements currentPoint
Definition aslBCond.h:105
BCondWithMap(SPDistanceFunction m, SPDistanceFunction cd, const Block &b, const VectorTemplate *const vt)
BCondWithMap(SPDistanceFunction m, const Block &b, const VectorTemplate *const vt)
acl::VectorOfElements isComputationNode(const vector< unsigned int > &ii)
returns expression corresponding to check if nodes in directions ii are computation ones
unique_ptr< TemplateVE > mapTVE
Definition aslBCond.h:117
SPAbstractDataWithGhostNodes map
boundary description for the particular BC
Definition aslBCond.h:111
BCondWithMap(SPAbstractDataWithGhostNodes m, SPAbstractDataWithGhostNodes cd, const VectorTemplate *const vt)
bool pointsListFlag
flag whether the point list to be generated or not
Definition aslBCond.h:104
BCondWithMap(SPAbstractDataWithGhostNodes m, const VectorTemplate *const vt)
acl::VectorOfElements isComputationNode(unsigned int i)
returns expression corresponding to check if the node in i^th direction is computation one
unique_ptr< TemplateVE > cDomainTVE
Definition aslBCond.h:118
SPAbstractDataWithGhostNodes computationalDomain
Computational domain which contains all boundaries and the particular boundary as well.
Definition aslBCond.h:114
Block bl
block
Definition aslBCond.h:109
SPDistanceFunction mapDF
Definition aslBCond.h:112
BCondWithMap(SPAbstractDataWithGhostNodes m, SPDistanceFunction cd, const VectorTemplate *const vt)
SPDistanceFunction computationalDomainDF
Definition aslBCond.h:115
acl::VectorOfElements isGhostNode()
returns expression corresponding to check if the current node is ghost one
virtual void initMapInfrastructure(acl::ExpressionContainer &ec)
initialize mapTVE and cDomainTVE
const VectorTemplate *const templ
Definition aslBCond.h:106
acl::VectorOfElements isComputationNode()
returns expression corresponding to check if the current node is computation one
Defines set of vectros with several properties.
void addSliceY(BCond &, int y)
void addSliceXE(BCond &)
void addSliceZ(BCond &, int z)
void addSliceZ0(BCond &)
void addSliceYE(BCond &)
void addSliceX(BCond &, int x)
void addSliceX0(BCond &)
void addSliceY0(BCond &)
SlicesNames
defines names of walls of a box
Definition aslBCond.h:309
void addSliceZE(BCond &)
@ Y0
Definition aslBCond.h:309
@ XE
Definition aslBCond.h:309
@ Z0
Definition aslBCond.h:309
@ YE
Definition aslBCond.h:309
@ ZE
Definition aslBCond.h:309
@ X0
Definition aslBCond.h:309
std::shared_ptr< DistanceFunction > SPDistanceFunction
Definition aslGeomInc.h:45
Advanced Computational Language.
Definition acl.h:41
shared_ptr< VectorOfElementsData > SPVectorOfElementsData
Advanced Simulation Library.
Definition aslDataInc.h:31
DataWithGhostNodes< acl::VectorOfElementsData > DataWithGhostNodesACLData
std::shared_ptr< BCond > SPBCond
Definition aslBCond.h:88
void addSlices(BCond &, const vector< SlicesNames > &)
std::shared_ptr< AbstractDataWithGhostNodes > SPAbstractDataWithGhostNodes
DataWithGhostNodes< acl::VectorOfElements > DataWithGhostNodesACL
std::shared_ptr< DataWithGhostNodesACL > SPDataWithGhostNodesACL
std::shared_ptr< DataWithGhostNodesACLData > SPDataWithGhostNodesACLData