46 void Foam::sampledSets::points::calcSamplesUnordered
48 DynamicList<point>& samplingPts,
49 DynamicList<label>& samplingCells,
50 DynamicList<label>& samplingFaces,
51 DynamicList<label>& samplingSegments,
52 DynamicList<scalar>& samplingCurveDist
57 const point& pt = points_[i];
62 samplingPts.append(pt);
63 samplingCells.append(celli);
64 samplingFaces.append(-1);
65 samplingSegments.append(samplingSegments.size());
66 samplingCurveDist.append(scalar(i));
71 void Foam::sampledSets::points::calcSamplesOrdered
73 DynamicList<point>& samplingPts,
74 DynamicList<label>& samplingCells,
75 DynamicList<label>& samplingFaces,
76 DynamicList<label>& samplingSegments,
77 DynamicList<scalar>& samplingCurveDist
80 const label n = points_.size();
82 label sampleSegmentI = 0;
84 scalar sampleDist = 0;
88 const point pt = points_[sampleI];
92 if (sampleCellI == -1)
96 sampleDist +=
mag(points_[sampleI] - points_[sampleI - 1]);
101 passiveParticle sampleParticle(
mesh(), pt, sampleCellI);
105 samplingPts.append(sampleParticle.position());
106 samplingCells.append(sampleParticle.cell());
107 samplingFaces.append(-1);
108 samplingSegments.append(sampleSegmentI);
109 samplingCurveDist.append(sampleDist);
113 const vector s = points_[sampleI] - points_[sampleI - 1];
114 sampleDist +=
mag(s);
115 sampleParticle.track(s, 0);
118 while (sampleI < n && !sampleParticle.onBoundaryFace());
126 void Foam::sampledSets::points::genSamples()
128 DynamicList<point> samplingPts;
129 DynamicList<label> samplingCells;
130 DynamicList<label> samplingFaces;
131 DynamicList<label> samplingSegments;
132 DynamicList<scalar> samplingCurveDist;
157 samplingPts.shrink();
158 samplingCells.shrink();
159 samplingFaces.shrink();
160 samplingSegments.shrink();
161 samplingCurveDist.shrink();
185 points_(dict.
lookup(
"points")),
186 ordered_(dict.
lookup(
"ordered"))
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.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Vector< scalar > vector
A scalar version of the templated Vector.
virtual ~points()
Destructor.
Macros for easy insertion into run-time selection tables.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
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.
virtual bool write()
Sample and write.
points(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
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.