Go to the documentation of this file.
50 "void polyMeshGenCells::calculateOwnersAndNeighbours() const"
51 ) <<
"Owners and neighbours are already allocated" <<
abort(
FatalError);
87 const label nThreads = 3 * omp_get_num_procs();
90 const label nThreads = 1;
99 # pragma omp parallel num_threads(nThreads) reduction(+ : nInternalFaces)
103 const label threadI = omp_get_thread_num();
105 const label threadI(0);
108 const label startingFace = threadI * chunkSize;
109 const label endFace =
113 dot.setSize(nThreads);
115 for(
label faceI=startingFace;faceI<endFace;++faceI)
122 # pragma omp for schedule(static)
130 const label faceI =
c[fI];
132 const label threadNo = faceI / chunkSize;
134 if( threadNo == threadI )
136 if( own[faceI] == -1 )
140 else if( nei[faceI] == -1 )
148 Serr <<
"Owner " << own[faceI] <<
endl;
149 Serr <<
"Neighbour " << nei[faceI] <<
endl;
150 Serr <<
"Current cell " << cellI <<
endl;
153 "void polyMeshGenCells::"
154 "calculateOwnersAndNeighbours()"
156 <<
" appears in more than 2 cells!!"
170 # pragma omp critical
172 for(
label i=0;i<nThreads;++i)
175 dataForOtherThreads[i][threadI];
182 if( own[faceI] == -1 )
186 else if( own[faceI] > cellI )
188 if( nei[faceI] == -1 )
190 nei[faceI] = own[faceI];
197 Serr <<
"Owner " << own[faceI] <<
endl;
198 Serr <<
"Neighbour " << nei[faceI] <<
endl;
199 Serr <<
"Current cell " << cellI <<
endl;
202 "void polyMeshGenCells::"
203 "calculateOwnersAndNeighbours()"
205 <<
" appears in more than 2 cells!!"
209 else if( nei[faceI] == -1 )
217 Serr <<
"Owner " << own[faceI] <<
endl;
218 Serr <<
"Neighbour " << nei[faceI] <<
endl;
219 Serr <<
"Current cell " << cellI <<
endl;
222 "void polyMeshGenCells::"
223 "calculateOwnersAndNeighbours()"
225 <<
" appears in more than 2 cells!!"
240 if( omp_in_parallel() )
243 "inline label polyMeshGenCells::calculateAddressingData() const"
244 ) <<
"Calculating addressing inside a parallel region."
268 addressingDataPtr_(NULL)
284 addressingDataPtr_(NULL)
312 addressingDataPtr_(NULL)
332 if( omp_in_parallel() )
335 "inline label polyMeshGenCells::addressingData() const"
336 ) <<
"Calculating addressing inside a parallel region."
356 Warning <<
"Cell subset " << selName <<
" already exists!" <<
endl;
363 std::map<label, meshSubset>::const_iterator it=
cellSubsets_.begin();
391 std::map<label, meshSubset>::const_iterator it =
395 Warning <<
"Subset " << setI <<
" is not a cell subset" <<
endl;
399 return it->second.name();
404 std::map<label, meshSubset>::const_iterator it;
407 if( it->second.name() == selName )
418 Info <<
"Starting creating cells" <<
endl;
426 if( own[faceI] >= nCells )
427 nCells = own[faceI] + 1;
429 if( nei[faceI] >= nCells )
430 nCells = nei[faceI] + 1;
435 ++nFacesInCell[own[faceI]];
438 if( nei[faceI] != -1 )
439 ++nFacesInCell[nei[faceI]];
448 cells_[own[faceI]][nFacesInCell[own[faceI]]++] = faceI;
449 if( nei[faceI] != -1 )
450 cells_[nei[faceI]][nFacesInCell[nei[faceI]]++] = faceI;
480 std::map<label, meshSubset>::const_iterator setIt;
487 setIt->second.name(),
497 setIt->second.containedElements(containedElements);
499 forAll(containedElements, i)
500 set.
insert(containedElements[i]);
const labelList & neighbour() const
void calculateAddressingData() const
calculate mesh addressing
const labelList & owner() const
owner and neighbour cells for faces
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const polyMeshGenAddressing & addressingData() const
addressing which may be needed
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
void setSize(const label nElmts)
set the number of used elements
A class for handling words, derived from string.
List< Key > toc() const
Return the table of contents.
#define forAll(list, i)
Loop across all elements in list.
Template functions to aid in the implementation of demand driven data.
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
virtual bool write() const
Write using setting from DB.
void calculateOwnersAndNeighbours() const
calculate owner and neighbour
Ostream & endl(Ostream &os)
Add newline and flush stream.
void clearOut() const
clear all pointer data
wordList names() const
Return the list of names of the IOobjects.
IOList< label > labelIOList
Label container classes.
word cellSubsetName(const label) const
label nInternalFaces() const
return number of internal faces
std::map< label, meshSubset > cellSubsets_
cell subsets
void deleteDemandDrivenData(DataPtr &dataPtr)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
void clearAddressingData() const
clear addressing data
label addCellSubset(const word &)
OSstream Serr(cerr, "Serr")
wordList patchNames(nPatches)
labelIOList * neighbourPtr_
IOobject * lookup(const word &name) const
Lookup a given name and return IOobject ptr if found else NULL.
polyMeshGenAddressing * addressingDataPtr_
primitive mesh which calculates addressing
errorManip< error > abort(error &err)
A collection of cell labels.
List of IOobjects with searching and retrieving facilities.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void removeCellSubset(const label)
label nIntFaces_
number of internal faces, owner and neighbour
label size() const
return the number of used elements
faceListPMG faces_
list of faces
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const word & constant() const
Return constant name.
bool insert(const Key &key)
Insert a new entry.
cellListPMG cells_
list of cells
const dimensionedScalar c
Speed of light in a vacuum.
const Time & runTime_
reference to the Time registry
polyMeshGenCells(const polyMeshGenCells &)
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
void clearOut() const
clear all pointer data
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
A cell is defined as a list of faces with extra functionality.
Pair< label > labelPair
Label pair.
Database for solution data, solver performance and other reduced data.
label cellSubsetIndex(const word &) const