Go to the documentation of this file.
56 const label levelLimiter = (1 << l);
58 (cpx >= levelLimiter) || (cpx < 0) ||
59 (cpy >= levelLimiter) || (cpy < 0) ||
60 (cpz >= levelLimiter) || (cpz < 0)
65 "void meshOctree::refineTreeForCoordinates("
66 "const meshOctreeCubeCoordinates& cc)"
73 for(
label i=(l-1);i>=0;--i)
75 const label levelLimiter = (1 << i);
79 if( cpx & levelLimiter )
81 if( cpy & levelLimiter )
83 if( cpz & levelLimiter )
134 const label levelLimiter = (1 << l);
136 (cpx >= levelLimiter) || (cpx < 0) ||
137 (cpy >= levelLimiter) || (cpy < 0) ||
138 (cpz >= levelLimiter) || (cpz < 0)
143 "void meshOctree::refineTreeForCoordinates("
144 "const meshOctreeCubeCoordinates& cc)"
151 for(
label i=(l-1);i>=0;--i)
153 const label levelLimiter = (1 << i);
157 if( cpx & levelLimiter )
159 if( cpy & levelLimiter )
161 if( cpz & levelLimiter )
213 Info <<
"Adding an additional layer of cells" <<
endl;
216 std::map<label, LongList<meshOctreeCubeBasic> > toProcs;
226 leaves[leafI]->neighbourRange(minCoord, maxCoord);
231 (maxCoord >= neiRange[procI].first()) &&
232 (minCoord <= neiRange[procI].second())
234 toProcs[neiProcs[procI]].append(*leaves[leafI]);
243 std::map<label, LongList<meshOctreeCubeBasic> >::iterator it;
244 for(it=toProcs.begin();it!=toProcs.end();++it)
246 Pout <<
"Sending " << it->second.size() <<
" cubes to proc "
247 << it->first <<
endl;
260 Pout <<
"Received " << receivedCoordinates.
size()
261 <<
" from other procs" <<
endl;
267 forAll(receivedCoordinates, ccI)
277 const label nei = neighbours[neiI];
287 receivedCoordinates[ccI].procNo(),
288 receivedCoordinates[ccI].cubeType()
313 const label neiLeaf = neighbours[i];
325 FatalError <<
"Leaf " << leafI <<
" with coordinates "
327 <<
" has no neighbour local at this processor"
332 Info <<
"Finished adding an additional layer of octree cubes" <<
endl;
void findAllLeafNeighbours(const meshOctreeCubeCoordinates &, DynList< label > &neighbourLeaves) const
find neighbour leaves over nodes, edges and faces
List< Pair< meshOctreeCubeCoordinates > > neiRange_
label posX() const
return x, y, z coordinates
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
void refineTreeForCoordinates(const meshOctreeCubeCoordinates &, const short procNo=Pstream::myProcNo(), const direction cubeType=meshOctreeCubeBasic::UNKNOWN)
refine the tree to add cubes transferred from other processors
#define forAll(list, i)
Loop across all elements in list.
void addLayerFromNeighbouringProcessors()
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static bool & parRun()
Is this a parallel run?
void setCubeType(const direction)
set cube type
Ostream & endl(Ostream &os)
Add newline and flush stream.
label size() const
Size of the active part of the list.
meshOctreeCube * subCube(const label) const
return a pointer to a child cubes at given position
label numberOfLeaves() const
return leaves of the octree
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool isLeaf() const
check if the cube is a leaf
void refineMissingCube(const triSurf &, const boundBox &, const label scI, meshOctreeSlot *slotPtr=NULL)
PtrList< coordinateSystem > coordinates(solidRegions.size())
void setProcNo(const short)
set processor number
LongList< meshOctreeCube * > leaves_
list of cubes which are leaves of the octree
errorManip< error > abort(error &err)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
direction level() const
return level
prefixOSstream Pout(cout, "Pout")
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void exchangeMap(const std::map< label, ListType > &m, LongList< T > &data, const Pstream::commsTypes commsType)
short procNo() const
return processor number
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
const meshOctreeCubeBasic & returnLeaf(const label) const
void createListOfLeaves()
create leaves
meshOctree & octree_
Reference to the octree.