68 label segmenti = 0, samplei = 0, pointi0 =
labelMax, pointi = 0;
73 for (
label pointj = pointi0; pointj < pointi; ++ pointj)
92 a.second() != -1 && b.second() != -1
93 ? a.first() < b.first() ? a : b
94 : a.second() != -1 ? a : b;
99 if (procAndCelli.
second() == -1)
138 particles.
first()->store(particles, td);
142 particles.
move(particles, td);
149 samplingPositions.
size() - samplingSegments.
size(),
158 const label samplei0 = samplei;
162 pointi += samplei - samplei0;
170 void Foam::sampledSets::points::calcSamplesUnordered
180 const point& pt = points_[i];
181 const label celli = searchEngine().findCell(pt);
185 samplingPositions.
append(pt);
186 samplingSegments.
append(i);
187 samplingCells.
append(celli);
194 void Foam::sampledSets::points::calcSamplesOrdered
196 DynamicList<point>& samplingPositions,
197 DynamicList<scalar>& samplingDistances,
198 DynamicList<label>& samplingSegments,
199 DynamicList<label>& samplingCells,
200 DynamicList<label>& samplingFaces
218 void Foam::sampledSets::points::genSamples()
220 DynamicList<point> samplingPositions;
221 DynamicList<scalar> samplingDistances;
222 DynamicList<label> samplingSegments;
223 DynamicList<label> samplingCells;
224 DynamicList<label> samplingFaces;
248 samplingPositions.shrink();
249 samplingDistances.shrink();
250 samplingSegments.shrink();
251 samplingCells.shrink();
252 samplingFaces.shrink();
289 points_(
dict.lookup(
"points")),
290 ordered_(
dict.lookup(
"ordered"))
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
void addParticle(ParticleType *pPtr)
Transfer particle to cloud.
void move(TrackCloudType &cloud, typename ParticleType::trackingData &td)
Move the particles.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
Template class for intrusive linked lists.
void size(const label)
Override size to be inconsistent with allocated storage.
const Type & second() const
Return second.
const Type & first() const
Return first.
T * first()
Return the first entry.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
label size() const
Return the size.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
label findCell(const point &location, const label seedCelli=-1, const bool useTreeSearch=true) const
Find cell containing location.
Mesh consisting of general polyhedral cells.
A Cloud of sampledSet particles.
Particle for generating line-type sampled sets.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
const meshSearch & searchEngine() const
Access the search engine.
const polyMesh & mesh() const
Access the mesh.
Specified point samples. Optionally ordered into a continuous path. Ordering is an optimisation; it e...
virtual ~points()
Destructor.
static void calcSamples(const polyMesh &mesh, const meshSearch &searchEngine, const pointField &points, DynamicList< point > &samplingPositons, DynamicList< scalar > &samplingDistances, DynamicList< label > &samplingSegments, DynamicList< label > &samplingCells, DynamicList< label > &samplingFaces)
Calculate all the sampling points.
points(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
Set of sets to sample. Call sampledSets.write() to sample&write files.
A class for handling words, derived from string.
defineTypeNameAndDebug(arcUniform, 0)
addToRunTimeSelectionTable(sampledSet, arcUniform, word)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
vectorField pointField
pointField is a vectorField.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
dimensioned< scalar > mag(const dimensioned< Type > &)
static const label labelMax
word name(const complex &)
Return a string representation of a complex.