48 void Foam::patchSeedSet::calcSamples
50 DynamicList<point>& samplingPts,
51 DynamicList<label>& samplingCells,
52 DynamicList<label>& samplingFaces,
53 DynamicList<label>& samplingSegments,
54 DynamicList<scalar>& samplingCurveDist
59 Info<<
"patchSeedSet : sampling on patches :" <<
endl;
72 Info<<
" " << pp.name() <<
" size " << pp.size() <<
endl;
83 patchFaces[sz++] = pp.start()+i;
92 if (maxPoints_ < totalSize)
95 label myMaxPoints =
label(scalar(sz)/totalSize*maxPoints_);
97 rndGenPtr_.reset(
new Random(123456));
98 Random& rndGen = rndGenPtr_();
101 for (
label iter = 0; iter < 4; iter++)
105 label j = rndGen.integer(0, subset.size()-1);
106 Swap(subset[i], subset[j]);
110 subset.setSize(myMaxPoints);
113 patchFaces = UIndirectList<label>(patchFaces,
subset)();
117 Pout<<
"In random mode : selected " << patchFaces.size()
118 <<
" faces out of " << sz <<
endl;
124 globalIndex globalSampleNumbers(patchFaces.size());
126 samplingPts.setCapacity(patchFaces.size());
127 samplingCells.setCapacity(patchFaces.size());
128 samplingFaces.setCapacity(patchFaces.size());
129 samplingSegments.setCapacity(patchFaces.size());
130 samplingCurveDist.setCapacity(patchFaces.size());
137 label facei = patchFaces[i];
152 info.hitPoint() + 1
e-1*(cc-info.hitPoint())
157 samplingPts.append(info.rawPoint());
159 samplingCells.append(celli);
160 samplingFaces.append(facei);
161 samplingSegments.append(0);
162 samplingCurveDist.append(globalSampleNumbers.toGlobal(i));
167 void Foam::patchSeedSet::genSamples()
170 DynamicList<point> samplingPts;
171 DynamicList<label> samplingCells;
172 DynamicList<label> samplingFaces;
173 DynamicList<label> samplingSegments;
174 DynamicList<scalar> samplingCurveDist;
185 samplingPts.shrink();
186 samplingCells.shrink();
187 samplingFaces.shrink();
188 samplingSegments.shrink();
189 samplingCurveDist.shrink();
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const double e
Elementary charge.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
PointIndexHit< point > pointIndexHit
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Macros for easy insertion into run-time selection tables.
patchSeedSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
A class for handling words, derived from string.
void append(const T &)
Append an element at the end of the list.
const vectorField & cellCentres() const
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.
List< label > labelList
A List of labels.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
label readLabel(Istream &is)
prefixOSstream Pout(cout,"Pout")
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
virtual ~patchSeedSet()
Destructor.
defineTypeNameAndDebug(combustionModel, 0)
static pointIndexHit facePoint(const polyMesh &, const label facei, const polyMesh::cellDecomposition)
Get a point on the face given a face decomposition method:
const labelList & tetBasePtIs() const
Return the tetBasePtIs.
vector point
Point is a vector.
ListType subset(const UList< T > &select, const T &value, const ListType &)
Extract elements of List when select is a certain value.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Mesh consisting of general polyhedral cells.
List< wordRe > wordReList
A List of wordRe (word or regular expression)
virtual const labelList & faceOwner() const
Return face owner.
label size() const
Return the number of elements in the UPtrList.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.