46 void Foam::sampledSets::lineUniform::calcSamples
48 DynamicList<point>& samplingPts,
49 DynamicList<label>& samplingCells,
50 DynamicList<label>& samplingFaces,
51 DynamicList<label>& samplingSegments,
52 DynamicList<scalar>& samplingCurveDist
55 label sampleSegmentI = 0, sampleI = 0;
58 while (sampleI < nPoints_)
60 const point pt = (1 - sampleT)*start_ + sampleT*end_;
64 if (sampleCellI == -1)
66 if (++ sampleI < nPoints_)
68 sampleT = scalar(sampleI)/(nPoints_ - 1);
73 passiveParticle sampleParticle(
mesh(), pt, sampleCellI);
77 samplingPts.append(sampleParticle.position());
78 samplingCells.append(sampleParticle.cell());
79 samplingFaces.append(-1);
80 samplingSegments.append(sampleSegmentI);
81 samplingCurveDist.append(sampleT*
mag(end_ - start_));
83 if (++ sampleI < nPoints_)
85 sampleT = scalar(sampleI)/(nPoints_ - 1);
86 sampleParticle.track((end_ - start_)/(nPoints_ - 1), 0);
89 while (sampleI < nPoints_ && !sampleParticle.onBoundaryFace());
97 void Foam::sampledSets::lineUniform::genSamples()
99 DynamicList<point> samplingPts;
100 DynamicList<label> samplingCells;
101 DynamicList<label> samplingFaces;
102 DynamicList<label> samplingSegments;
103 DynamicList<scalar> samplingCurveDist;
114 samplingPts.shrink();
115 samplingCells.shrink();
116 samplingFaces.shrink();
117 samplingSegments.shrink();
118 samplingCurveDist.shrink();
142 start_(dict.
lookup(
"start")),
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
label findCell(const point &location, const label seedCelli=-1, const bool useTreeSearch=true) const
Find cell containing location.
A class for handling words, derived from string.
addToRunTimeSelectionTable(sampledSet, arcUniform, word)
vector point
Point is a vector.
prefixOSstream Pout(cout, "Pout")
virtual bool write()
Sample and write.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
defineTypeNameAndDebug(arcUniform, 0)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.