47 void Foam::patchCloudSet::calcSamples
49 DynamicList<point>& samplingPts,
50 DynamicList<label>& samplingCells,
51 DynamicList<label>& samplingFaces,
52 DynamicList<label>& samplingSegments,
53 DynamicList<scalar>& samplingCurveDist
58 Info<<
"patchCloudSet : sampling on patches :" <<
endl;
71 Info<<
" " << pp.name() <<
" size " << pp.size() <<
endl;
84 patchFaces[sz++] = pp.start()+i;
88 const boundBox patchBb(pp.points(), pp.meshPoints(),
false);
90 bb.min() =
min(bb.min(), patchBb.min());
91 bb.max() =
max(bb.max(), patchBb.max());
100 bb.min() -=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
101 bb.max() +=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
104 indexedOctree<treeDataFace> patchTree
123 List<mappedPatchBase::nearInfo> nearest(sampleCoords_.size());
125 forAll(sampleCoords_, sampleI)
127 const point& sample = sampleCoords_[sampleI];
132 if (patchFaces.size())
134 nearInfo = patchTree.findNearest(sample,
sqr(searchDist_));
145 nearest[sampleI].second().first() =
Foam::sqr(GREAT);
151 nearInfo.setIndex(patchFaces[nearInfo.index()]);
153 nearest[sampleI].second().first() =
magSqr 176 Info<<
"Dumping mapping as lines from supplied points to" 177 <<
" nearest patch face to file " << str.name() <<
endl;
183 if (nearest[i].first().hit())
189 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
204 label facei = nearInfo.index();
206 samplingPts.append(nearInfo.hitPoint());
207 samplingCells.append(
mesh().faceOwner()[facei]);
208 samplingFaces.append(facei);
209 samplingSegments.append(0);
210 samplingCurveDist.append(1.0 * sampleI);
219 samplingPts.append(sampleCoords_[sampleI]);
220 samplingCells.append(-1);
221 samplingFaces.append(-1);
222 samplingSegments.append(0);
223 samplingCurveDist.append(1.0 * sampleI);
230 void Foam::patchCloudSet::genSamples()
233 DynamicList<point> samplingPts;
234 DynamicList<label> samplingCells;
235 DynamicList<label> samplingFaces;
236 DynamicList<label> samplingSegments;
237 DynamicList<scalar> samplingCurveDist;
248 samplingPts.shrink();
249 samplingCells.shrink();
250 samplingFaces.shrink();
251 samplingSegments.shrink();
252 samplingCurveDist.shrink();
275 const scalar searchDist
279 sampleCoords_(sampleCoords),
281 searchDist_(searchDist)
301 sampleCoords_(dict.
lookup(
"points")),
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
#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.
static const Vector< scalar > max
const double e
Elementary charge.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool master(const label communicator=0)
Am I the master process.
PointIndexHit< point > pointIndexHit
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.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
Macros for easy insertion into run-time selection tables.
static const Vector< scalar > min
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.
cachedRandom rndGen(label(0), -1)
List< label > labelList
A List of labels.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
virtual ~patchCloudSet()
Destructor.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
patchCloudSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const List< point > &sampleCoords, const labelHashSet &patchSet, const scalar searchDist)
Construct from components.
word name(const complex &)
Return a string representation of a complex.
label size() const
Return the number of elements in the UPtrList.
vector point
Point is a vector.
Mesh consisting of general polyhedral cells.
List< wordRe > wordReList
A List of wordRe (word or regular expression)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.