aslBCond.h
Go to the documentation of this file.
/*
* Advanced Simulation Library <http://asl.org.il>
*
* Copyright 2015 Avtech Scientific <http://avtechscientific.com>
*
*
* This file is part of Advanced Simulation Library (ASL).
*
* ASL is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, version 3 of the License.
*
* ASL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with ASL. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ASLBCOND_H
#define ASLBCOND_H
#include "aslNumMethod.h"
#include <data/aslBlocks.h>
#include <acl/aclMath/aclVectorOfElementsDef.h>
namespace acl
{
class ExpressionContainer;
}
namespace asl
{
class VectorTemplate;
template <typename V> class DataWithGhostNodes;
typedef DataWithGhostNodes<acl::VectorOfElementsData> DataWithGhostNodesACLData;
typedef std::shared_ptr<DataWithGhostNodesACLData> SPDataWithGhostNodesACLData;
typedef DataWithGhostNodes<acl::VectorOfElements> DataWithGhostNodesACL;
typedef std::shared_ptr<DataWithGhostNodesACL> SPDataWithGhostNodesACL;
class TemplateVE;
class DistanceFunction;
typedef std::shared_ptr<DistanceFunction> SPDistanceFunction;
class AbstractDataWithGhostNodes;
typedef std::shared_ptr<AbstractDataWithGhostNodes> SPAbstractDataWithGhostNodes;
class BCond: public NumMethod
{
protected:
Block block;
const VectorTemplate * const templ;
std::vector<int> indices;
std::vector<int> directions;
std::vector<double> fractions;
std::vector<int> neighbourIndices;
acl::SPVectorOfElementsData indicesACL;
acl::SPVectorOfElementsData neighbourIndicesACL;
acl::SPVectorOfElementsData directionsACL;
acl::SPVectorOfElementsData fractionsACL;
void loadIndicesToACL();
void loadNeighbourIndicesToACL();
void loadDirectionsToACL();
void loadfractionsACL();
public:
BCond(const Block & b);
BCond(const Block & b, const VectorTemplate * const t);
void addPoint(AVec<int> a,int d=0,double fr=0);
const Block & getBlock();
inline const VectorTemplate * getVT();
};
typedef std::shared_ptr<BCond> SPBCond;
class BCondWithMap:public NumMethod
{
protected:
bool pointsListFlag;
acl::VectorOfElements currentPoint;
const VectorTemplate * const templ;
Block bl;
SPAbstractDataWithGhostNodes map;
SPDistanceFunction mapDF;
SPAbstractDataWithGhostNodes computationalDomain;
SPDistanceFunction computationalDomainDF;
unique_ptr<TemplateVE> mapTVE;
unique_ptr<TemplateVE> cDomainTVE;
virtual void initMapInfrastructure(acl::ExpressionContainer & ec);
acl::VectorOfElements isGhostNode(unsigned int i);
acl::VectorOfElements isComputationNode(unsigned int i);
acl::VectorOfElements isComputationNode(const vector<unsigned int> & ii);
acl::VectorOfElements isGhostNode();
acl::VectorOfElements isComputationNode();
BCondWithMap(SPAbstractDataWithGhostNodes m, const VectorTemplate * const vt);
BCondWithMap(SPDistanceFunction m, const Block & b, const VectorTemplate * const vt);
BCondWithMap(SPAbstractDataWithGhostNodes m,
SPAbstractDataWithGhostNodes cd,
const VectorTemplate * const vt);
BCondWithMap(SPAbstractDataWithGhostNodes m,
SPDistanceFunction cd,
const VectorTemplate * const vt);
BCondWithMap(SPDistanceFunction m,
SPDistanceFunction cd,
const Block & b,
const VectorTemplate * const vt);
public:
inline const VectorTemplate * getVT();
};
class BCondConnector:public NumMethod
{
protected:
Block block1;
Block block2;
std::vector<int> indices1;
std::vector<int> directions1;
std::vector<int> indices2;
std::vector<int> directions2;
acl::SPVectorOfElementsData indices1ACL;
acl::SPVectorOfElementsData directions1ACL;
acl::SPVectorOfElementsData indices2ACL;
acl::SPVectorOfElementsData directions2ACL;
void loadIndicesToACL();
void loadDirectionsToACL();
public:
BCondConnector(const Block & b1, const Block & b2);
void addGhostPoint(AVec<int> a1,AVec<int> a2);
void addGhostPoint(AVec<int> a1,int d1,AVec<int> a2,int d2);
const Block & getBlock1();
const Block & getBlock2();
};
class BCondSlice:public NumMethod
{
protected:
Block block;
const VectorTemplate * const templ;
int pointB;
int pointE;
AVec<int> sliceDimentions;
AVec<int> sliceIncrements;
int direction;
public:
BCondSlice(const Block & b);
BCondSlice(const Block & b, const VectorTemplate * const t);
void addGhostSlice(AVec<int> pB,AVec<int> pE, int dir);
const Block & getBlock();
};
class BCondConnectorSlice:public NumMethod
{
protected:
Block block1;
Block block2;
const VectorTemplate * const templ;
int point1B;
int point1E;
AVec<int> sliceDimentions1;
AVec<int> sliceIncrements1;
int direction1;
int point2B;
int point2E;
AVec<int> sliceDimentions2;
AVec<int> sliceIncrements2;
int direction2;
public:
BCondConnectorSlice(const Block & b1, const Block & b2, const VectorTemplate *const t);
void addGhostSlice1(AVec<int> pB,AVec<int> pE, int dir);
void addGhostSlice2(AVec<int> pB,AVec<int> pE, int dir);
const Block & getBlock1();
const Block & getBlock2();
};
class BCondDynamic:public NumMethod
{
protected:
Block block;
const VectorTemplate * const templ;
acl::SPVectorOfElementsData pointsACL;
acl::SPVectorOfElementsData normalsACL;
public:
BCondDynamic(const Block & b);
BCondDynamic(const Block & b, const VectorTemplate * const t);
const Block & getBlock();
inline const VectorTemplate * getVT();
};
enum SlicesNames {X0, XE, Y0, YE, Z0, ZE};
void addSliceX0(BCond &);
void addSliceXE(BCond &);
void addSliceY0(BCond &);
void addSliceYE(BCond &);
void addSliceZ0(BCond &);
void addSliceZE(BCond &);
void addSlices(BCond &, const vector<SlicesNames> &);
void addSliceX(BCond &, int x);
void addSliceY(BCond &, int y);
void addSliceZ(BCond &, int z);
void addSliceX0(BCondSlice &);
void addSliceXE(BCondSlice &);
void addSliceY0(BCondSlice &);
void addSliceYE(BCondSlice &);
void addSliceZ0(BCondSlice &);
void addSliceZE(BCondSlice &);
// --------------------------- Implementation ----------------------
inline const VectorTemplate * BCond::getVT()
{
return templ;
}
inline const VectorTemplate * BCondWithMap::getVT()
{
return templ;
}
}
#endif //ASLBCOND_H
acl::ExpressionContainer
Definition: aclExpressionContainer.h:44
acl::VectorOfElements
The class represents several Element.
Definition: aclVectorOfElementsDef.h:92
asl::AVec< int >
asl::BCondConnector
Virtual class describes general interface for boundary conditions which connect two datas.
Definition: aslBCond.h:190
asl::BCondConnector::directions1ACL
acl::SPVectorOfElementsData directions1ACL
Definition: aslBCond.h:201
asl::BCondConnector::getBlock1
const Block & getBlock1()
asl::BCondConnector::BCondConnector
BCondConnector(const Block &b1, const Block &b2)
asl::BCondConnector::loadDirectionsToACL
void loadDirectionsToACL()
asl::BCondConnector::addGhostPoint
void addGhostPoint(AVec< int > a1, int d1, AVec< int > a2, int d2)
asl::BCondConnector::getBlock2
const Block & getBlock2()
asl::BCondConnector::block2
Block block2
Definition: aslBCond.h:193
asl::BCondConnector::indices1
std::vector< int > indices1
Definition: aslBCond.h:195
asl::BCondConnector::directions2
std::vector< int > directions2
Definition: aslBCond.h:198
asl::BCondConnector::block1
Block block1
Definition: aslBCond.h:192
asl::BCondConnector::indices1ACL
acl::SPVectorOfElementsData indices1ACL
Definition: aslBCond.h:200
asl::BCondConnector::directions1
std::vector< int > directions1
Definition: aslBCond.h:196
asl::BCondConnector::addGhostPoint
void addGhostPoint(AVec< int > a1, AVec< int > a2)
asl::BCondConnector::directions2ACL
acl::SPVectorOfElementsData directions2ACL
Definition: aslBCond.h:203
asl::BCondConnector::loadIndicesToACL
void loadIndicesToACL()
asl::BCondConnector::indices2
std::vector< int > indices2
Definition: aslBCond.h:197
asl::BCondConnector::indices2ACL
acl::SPVectorOfElementsData indices2ACL
Definition: aslBCond.h:202
asl::BCondConnectorSlice
Virtual class describes general interface for boundary conditions which connect two datas.
Definition: aslBCond.h:259
asl::BCondConnectorSlice::direction1
int direction1
Definition: aslBCond.h:269
asl::BCondConnectorSlice::sliceDimentions1
AVec< int > sliceDimentions1
Definition: aslBCond.h:267
asl::BCondConnectorSlice::point2B
int point2B
Definition: aslBCond.h:271
asl::BCondConnectorSlice::sliceIncrements1
AVec< int > sliceIncrements1
Definition: aslBCond.h:268
asl::BCondConnectorSlice::addGhostSlice2
void addGhostSlice2(AVec< int > pB, AVec< int > pE, int dir)
asl::BCondConnectorSlice::point1B
int point1B
Definition: aslBCond.h:265
asl::BCondConnectorSlice::sliceIncrements2
AVec< int > sliceIncrements2
Definition: aslBCond.h:274
asl::BCondConnectorSlice::sliceDimentions2
AVec< int > sliceDimentions2
Definition: aslBCond.h:273
asl::BCondConnectorSlice::getBlock1
const Block & getBlock1()
asl::BCondConnectorSlice::direction2
int direction2
Definition: aslBCond.h:275
asl::BCondConnectorSlice::block1
Block block1
Definition: aslBCond.h:261
asl::BCondConnectorSlice::addGhostSlice1
void addGhostSlice1(AVec< int > pB, AVec< int > pE, int dir)
asl::BCondConnectorSlice::BCondConnectorSlice
BCondConnectorSlice(const Block &b1, const Block &b2, const VectorTemplate *const t)
asl::BCondConnectorSlice::point2E
int point2E
Definition: aslBCond.h:272
asl::BCondConnectorSlice::block2
Block block2
Definition: aslBCond.h:262
asl::BCondConnectorSlice::templ
const VectorTemplate *const templ
Definition: aslBCond.h:263
asl::BCondConnectorSlice::point1E
int point1E
Definition: aslBCond.h:266
asl::BCondConnectorSlice::getBlock2
const Block & getBlock2()
asl::BCondDynamic
Virtual class describes general interface for boundary conditions.
Definition: aslBCond.h:293
asl::BCondDynamic::getBlock
const Block & getBlock()
asl::BCondDynamic::getVT
const VectorTemplate * getVT()
asl::BCondDynamic::templ
const VectorTemplate *const templ
Definition: aslBCond.h:296
asl::BCondDynamic::BCondDynamic
BCondDynamic(const Block &b, const VectorTemplate *const t)
asl::BCondDynamic::normalsACL
acl::SPVectorOfElementsData normalsACL
Definition: aslBCond.h:299
asl::BCondDynamic::block
Block block
Definition: aslBCond.h:295
asl::BCondDynamic::pointsACL
acl::SPVectorOfElementsData pointsACL
Definition: aslBCond.h:298
asl::BCondDynamic::BCondDynamic
BCondDynamic(const Block &b)
asl::BCond
Virtual class describes general interface for boundary conditions.
Definition: aslBCond.h:59
asl::BCond::neighbourIndices
std::vector< int > neighbourIndices
Definition: aslBCond.h:67
asl::BCond::BCond
BCond(const Block &b, const VectorTemplate *const t)
asl::BCond::fractions
std::vector< double > fractions
Definition: aslBCond.h:66
asl::BCond::indices
std::vector< int > indices
Definition: aslBCond.h:64
asl::BCond::neighbourIndicesACL
acl::SPVectorOfElementsData neighbourIndicesACL
Definition: aslBCond.h:70
asl::BCond::loadfractionsACL
void loadfractionsACL()
asl::BCond::directions
std::vector< int > directions
Definition: aslBCond.h:65
asl::BCond::loadDirectionsToACL
void loadDirectionsToACL()
asl::BCond::block
Block block
Definition: aslBCond.h:61
asl::BCond::BCond
BCond(const Block &b)
asl::BCond::loadIndicesToACL
void loadIndicesToACL()
asl::BCond::directionsACL
acl::SPVectorOfElementsData directionsACL
Definition: aslBCond.h:71
asl::BCond::addPoint
void addPoint(AVec< int > a, int d=0, double fr=0)
asl::BCond::loadNeighbourIndicesToACL
void loadNeighbourIndicesToACL()
asl::BCond::templ
const VectorTemplate *const templ
Definition: aslBCond.h:62
asl::BCond::getVT
const VectorTemplate * getVT()
Definition: aslBCond.h:341
asl::BCond::indicesACL
acl::SPVectorOfElementsData indicesACL
Definition: aslBCond.h:69
asl::BCond::getBlock
const Block & getBlock()
asl::BCond::fractionsACL
acl::SPVectorOfElementsData fractionsACL
Definition: aslBCond.h:72
asl::BCondSlice
Virtual class describes general interface for boundary conditions.
Definition: aslBCond.h:228
asl::BCondSlice::sliceIncrements
AVec< int > sliceIncrements
Definition: aslBCond.h:236
asl::BCondSlice::sliceDimentions
AVec< int > sliceDimentions
Definition: aslBCond.h:235
asl::BCondSlice::BCondSlice
BCondSlice(const Block &b)
asl::BCondSlice::pointE
int pointE
Definition: aslBCond.h:234
asl::BCondSlice::getBlock
const Block & getBlock()
asl::BCondSlice::BCondSlice
BCondSlice(const Block &b, const VectorTemplate *const t)
asl::BCondSlice::addGhostSlice
void addGhostSlice(AVec< int > pB, AVec< int > pE, int dir)
asl::BCondSlice::templ
const VectorTemplate *const templ
Definition: aslBCond.h:231
asl::BCondSlice::direction
int direction
Definition: aslBCond.h:237
asl::BCondSlice::block
Block block
Definition: aslBCond.h:230
asl::BCondSlice::pointB
int pointB
Definition: aslBCond.h:233
asl::BCondWithMap
Virtual class describes general interface for boundary conditions.
Definition: aslBCond.h:101
asl::BCondWithMap::isGhostNode
acl::VectorOfElements isGhostNode(unsigned int i)
returns expression corresponding to check if the node in i^th direction is ghost one
asl::BCondWithMap::mapTVE
unique_ptr< TemplateVE > mapTVE
Definition: aslBCond.h:117
asl::BCondWithMap::getVT
const VectorTemplate * getVT()
Definition: aslBCond.h:346
asl::BCondWithMap::currentPoint
acl::VectorOfElements currentPoint
Definition: aslBCond.h:105
asl::BCondWithMap::cDomainTVE
unique_ptr< TemplateVE > cDomainTVE
Definition: aslBCond.h:118
asl::BCondWithMap::BCondWithMap
BCondWithMap(SPDistanceFunction m, SPDistanceFunction cd, const Block &b, const VectorTemplate *const vt)
asl::BCondWithMap::BCondWithMap
BCondWithMap(SPDistanceFunction m, const Block &b, const VectorTemplate *const vt)
asl::BCondWithMap::isComputationNode
acl::VectorOfElements isComputationNode(const vector< unsigned int > &ii)
returns expression corresponding to check if nodes in directions ii are computation ones
asl::BCondWithMap::map
SPAbstractDataWithGhostNodes map
boundary description for the particular BC
Definition: aslBCond.h:111
asl::BCondWithMap::BCondWithMap
BCondWithMap(SPAbstractDataWithGhostNodes m, SPAbstractDataWithGhostNodes cd, const VectorTemplate *const vt)
asl::BCondWithMap::templ
const VectorTemplate *const templ
Definition: aslBCond.h:106
asl::BCondWithMap::pointsListFlag
bool pointsListFlag
flag whether the point list to be generated or not
Definition: aslBCond.h:104
asl::BCondWithMap::BCondWithMap
BCondWithMap(SPAbstractDataWithGhostNodes m, const VectorTemplate *const vt)
asl::BCondWithMap::isComputationNode
acl::VectorOfElements isComputationNode(unsigned int i)
returns expression corresponding to check if the node in i^th direction is computation one
asl::BCondWithMap::computationalDomain
SPAbstractDataWithGhostNodes computationalDomain
Computational domain which contains all boundaries and the particular boundary as well.
Definition: aslBCond.h:114
asl::BCondWithMap::bl
Block bl
block
Definition: aslBCond.h:109
asl::BCondWithMap::mapDF
SPDistanceFunction mapDF
Definition: aslBCond.h:112
asl::BCondWithMap::BCondWithMap
BCondWithMap(SPAbstractDataWithGhostNodes m, SPDistanceFunction cd, const VectorTemplate *const vt)
asl::BCondWithMap::computationalDomainDF
SPDistanceFunction computationalDomainDF
Definition: aslBCond.h:115
asl::BCondWithMap::isGhostNode
acl::VectorOfElements isGhostNode()
returns expression corresponding to check if the current node is ghost one
asl::BCondWithMap::initMapInfrastructure
virtual void initMapInfrastructure(acl::ExpressionContainer &ec)
initialize mapTVE and cDomainTVE
asl::BCondWithMap::isComputationNode
acl::VectorOfElements isComputationNode()
returns expression corresponding to check if the current node is computation one
asl::Block
Definition: aslBlocks.h:57
asl::NumMethod
Definition: aslNumMethod.h:35
asl::VectorTemplate
Defines set of vectros with several properties.
Definition: aslTemplates.h:88
asl::addSliceY
void addSliceY(BCond &, int y)
asl::addSliceXE
void addSliceXE(BCond &)
asl::addSliceZ
void addSliceZ(BCond &, int z)
asl::addSliceZ0
void addSliceZ0(BCond &)
asl::addSliceYE
void addSliceYE(BCond &)
asl::addSliceX
void addSliceX(BCond &, int x)
asl::addSliceX0
void addSliceX0(BCond &)
asl::addSliceY0
void addSliceY0(BCond &)
asl::SlicesNames
SlicesNames
defines names of walls of a box
Definition: aslBCond.h:309
asl::addSliceZE
void addSliceZE(BCond &)
asl::Y0
@ Y0
Definition: aslBCond.h:309
asl::X0
@ X0
Definition: aslBCond.h:309
asl::ZE
@ ZE
Definition: aslBCond.h:309
asl::Z0
@ Z0
Definition: aslBCond.h:309
asl::YE
@ YE
Definition: aslBCond.h:309
asl::XE
@ XE
Definition: aslBCond.h:309
asl::SPDistanceFunction
std::shared_ptr< DistanceFunction > SPDistanceFunction
Definition: aslGeomInc.h:44
acl
Advanced Computational Language.
Definition: acl.h:41
acl::SPVectorOfElementsData
shared_ptr< VectorOfElementsData > SPVectorOfElementsData
Definition: aclVectorOfElementsDef.h:105
asl
Advanced Simulation Library.
Definition: aslDataInc.h:31
asl::DataWithGhostNodesACLData
DataWithGhostNodes< acl::VectorOfElementsData > DataWithGhostNodesACLData
Definition: aslGenerators.h:45
asl::addSlices
void addSlices(BCond &, const vector< SlicesNames > &)
asl::SPAbstractDataWithGhostNodes
std::shared_ptr< AbstractDataWithGhostNodes > SPAbstractDataWithGhostNodes
Definition: aslGenerators.h:50
asl::SPBCond
std::shared_ptr< BCond > SPBCond
Definition: aslBCond.h:88
asl::DataWithGhostNodesACL
DataWithGhostNodes< acl::VectorOfElements > DataWithGhostNodesACL
Definition: aslGenerators.h:48
asl::SPDataWithGhostNodesACL
std::shared_ptr< DataWithGhostNodesACL > SPDataWithGhostNodesACL
Definition: aslGenerators.h:49
asl::SPDataWithGhostNodesACLData
std::shared_ptr< DataWithGhostNodesACLData > SPDataWithGhostNodesACLData
Definition: aslGenerators.h:47
aslNumMethod.h