Go to the documentation of this file.
34 #include "indirectPrimitivePatch.H"
58 Info<<
"patchSeedSet : sampling on patches :" <<
endl;
71 Info<<
" " << pp.
name() <<
" size " << pp.size() <<
endl;
87 if (!rndGenPtr_.valid())
89 rndGenPtr_.reset(
new Random(0));
94 if (selectedLocations_.size())
120 patchBb.
min() -=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
121 patchBb.
max() +=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
139 const scalar globalDistSqr
153 forAll(selectedLocations_, sampleI)
155 const point& sample = selectedLocations_[sampleI];
166 nearest[sampleI].second().first() =
Foam::sqr(GREAT);
167 nearest[sampleI].second().second() =
174 nearest[sampleI].second().first() =
magSqr(fc-sample);
175 nearest[sampleI].second().second() =
185 Pstream::listCombineScatter(nearest);
192 if (nearest[sampleI].first().hit())
194 label procI = nearest[sampleI].second().second();
195 label index = nearest[sampleI].first().index();
197 if (procI == Pstream::myProcNo())
199 newPatchFaces.
append(pp.addressing()[index]);
207 Pout<<
"Found " << newPatchFaces.size()
208 <<
" out of " << selectedLocations_.size()
209 <<
" on local processor" <<
endl;
219 if (maxPoints_ < totalSize)
226 for (
label iter = 0; iter < 4; iter++)
235 subset.setSize(myMaxPoints);
258 (void)
mesh().tetBasePtIs();
270 polyMesh::FACE_DIAG_TRIS
277 const point& cc =
mesh().cellCentres()[cellI];
287 samplingCells.
append(cellI);
288 samplingFaces.
append(faceI);
289 samplingSegments.
append(0);
316 samplingSegments.
shrink();
317 samplingCurveDist.
shrink();
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Simple random number generator.
const Field< PointType > & points() const
Return reference to global points.
A class for handling words, derived from string.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
const point & max() const
Maximum describing the bounding box.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
Standard boundBox + extra functionality for use in octree.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool hit() const
Is there a hit.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
patchSeedSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList patchFaces(const polyBoundaryMesh &patches, const wordList &names)
Mesh consisting of general polyhedral cells.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
label facePoint(const int facei, const block &block, const label i, const label j)
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
const Point & rawPoint() const
Return point with no checking.
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.
treeBoundBox extend(Random &, const scalar s) const
Return slightly wider bounding box.
const Point & hitPoint() const
Return hit point.
A patch is a list of labels that address the faces in the global face list.
void setCapacity(const label)
Alter the size of the underlying storage.
A List with indirect addressing.
Non-pointer based hierarchical recursive searching.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
const point & min() const
Minimum describing the bounding box.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
void genSamples()
Uses calcSamples to obtain samples. Copies them into *this.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Macros for easy insertion into run-time selection tables.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
label start() const
Return start label of this patch in the polyMesh face list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
ListType subset(const UList< T > &select, const T &value, const ListType &)
Extract elements of List when select is a certain value.
virtual ~patchSeedSet()
Destructor.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void setSamples(const List< point > &samplingPts, const labelList &samplingCells, const labelList &samplingFaces, const labelList &samplingSegments, const scalarList &samplingCurveDist)
Sets sample data.
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...
Encapsulation of data needed to search for faces.
const dimensionedScalar e
Elementary charge.
label readLabel(Istream &is)
A List with indirect addressing.
void findNearest(const label nodeI, const linePointRef &ln, treeBoundBox &tightest, label &nearestShapeI, point &linePoint, point &nearestPoint, const FindNearestOp &fnOp) const
Find nearest point to line.
void calcSamples(DynamicList< point > &samplingPts, DynamicList< label > &samplingCells, DynamicList< label > &samplingFaces, DynamicList< label > &samplingSegments, DynamicList< scalar > &samplingCurveDist)
Samples all points in sampleCoords.
A 2-tuple for storing two objects of different types.
vector point
Point is a vector.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool usePatchGroups=true) const
Return the set of patch IDs corresponding to the given names.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
defineTypeNameAndDebug(combustionModel, 0)
const word & name() const
Return name.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
cachedRandom rndGen(label(0), -1)
word name(const complex &)
Return a string representation of a complex.
label toGlobal(const label i) const
From local to global.
A list of faces which address into the list of points.