24 #ifndef ASLDATAWITHGHOSTNODES_H
25 #define ASLDATAWITHGHOSTNODES_H
38 class AbstractDataWithGhostNodes:
public AbstractData
43 unsigned int ghostBorder;
45 bool bordersDataAcces;
46 inline AbstractDataWithGhostNodes();
47 inline AbstractDataWithGhostNodes(
const Block & b,
int nGN = 1,
bool bDA =
true);
49 inline int getSubContainerOffset()
const;
50 inline unsigned int getSubContainerSize()
const;
51 inline const Block & getInternalBlock()
const;
52 inline const unsigned int getGhostBorder()
const;
57 template <
typename V>
class DataWithGhostNodes:
public AbstractDataWithGhostNodes
62 inline DataWithGhostNodes();
63 inline DataWithGhostNodes(
const Block & b,
int nGN = 1,
bool bDA =
true);
64 inline DataWithGhostNodes(DataWrapper<V> & d,
int nGN = 1);
68 inline void setContainer(
const V & cont);
69 inline V & getContainer();
82 SPDataWithGhostNodesACLData
clone(SPDataWithGhostNodesACLData d);
86 SPDataWithGhostNodesACLData
clone(SPDataWithGhostNodesACLData d,
unsigned int n);
93 AbstractDataWithGhostNodes::AbstractDataWithGhostNodes()
97 AbstractDataWithGhostNodes::AbstractDataWithGhostNodes(
const Block & b,
int nGN,
bool bDA):
98 AbstractData (
offset(b, nGN)),
101 bordersDataAcces(bDA)
106 template <
typename V> DataWithGhostNodes<V>::DataWithGhostNodes()
110 template <
typename V> DataWithGhostNodes<V>::DataWithGhostNodes(
const Block & b,
int nGN,
bool bDA):
111 AbstractDataWithGhostNodes (b,nGN,bDA),
116 template <
typename V> DataWithGhostNodes<V>::DataWithGhostNodes(DataWrapper<V> & d,
int nGN):
117 AbstractDataWithGhostNodes (
offset(d.getBlock(), -nGN), nGN, true),
122 const Block & AbstractDataWithGhostNodes::getInternalBlock()
const
124 return internalBlock;
127 const unsigned int AbstractDataWithGhostNodes::getGhostBorder()
const
132 inline int AbstractDataWithGhostNodes::getSubContainerOffset()
const
134 Block b(
offset(internalBlock, ghostBorder));
135 int nD(b.getSize().getSize());
136 return b.c2i(AVec<int>(
nD,ghostBorder));
139 inline unsigned int AbstractDataWithGhostNodes::getSubContainerSize()
const
141 const Block b(
offset(internalBlock, ghostBorder));
142 int nD(b.getSize().getSize());
143 int s(b.c2i(b.getSize()-AVec<int>(
nD,ghostBorder+1)) - b.c2i(AVec<int>(nD,ghostBorder))+1);
147 template <
class V >
inline void DataWithGhostNodes<V>::setContainer(
const V & cont)
149 dw.setContainer (cont);
152 template <
class V >
inline V & DataWithGhostNodes<V>::getContainer()
154 return dw.getContainer();
160 Block b(
offset(d->getBlock(),newGN));
162 nd(
new DataWithGhostNodes<V>(b, 0));
163 nd->setContainer(d->getContainer());
170 #endif // ASLDATAWITHGHOSTNODES_H
Advanced Simulation Library.
std::shared_ptr< DataWithGhostNodesACLData > SPDataWithGhostNodesACLData
std::shared_ptr< DataWithGhostNodes< V > > resizeGhostNodes(std::shared_ptr< DataWithGhostNodes< V >> d, unsigned int newGN)
The class represents several ElementData.
DataWithGhostNodes< acl::VectorOfElementsData > DataWithGhostNodesACLData
const Block offset(const Block &bl, int a=1)
const unsigned int nD(const AVec< T > a)
The class represents several Element.
SPDataWithGhostNodesACLData clone(SPDataWithGhostNodesACLData d, unsigned int n)
std::shared_ptr< AbstractDataWithGhostNodes > SPAbstractDataWithGhostNodes
DataWithGhostNodes< acl::VectorOfElements > DataWithGhostNodesACL
std::shared_ptr< DataWithGhostNodesACL > SPDataWithGhostNodesACL