48 positionName_(
word::null),
50 distanceName_(
word::null),
59 const word& positionName,
61 const word& distanceName,
67 positionName_(positionName),
74 distanceName_(distanceName),
81 axis_(axisTypeNames_[axis])
88 const word& positionName,
110 const word& distanceName,
137 (axis_ == axisType::X && positions_.valid())
139 || (axis_ == axisType::Z && positions_.valid())
140 || (axis_ == axisType::DISTANCE && distances_.valid())
141 || (axis_ == axisType::DEFAULT && distances_.valid());
151 (axis_ == axisType::XYZ && positions_.valid())
152 || (axis_ == axisType::DEFAULT && positions_.valid());
162 <<
"Scalar coordinate requested from coordinate set with "
166 return positions_()[index].x();
168 return positions_()[index].y();
170 return positions_()[index].z();
171 case axisType::DISTANCE:
172 return distances_()[index];
173 case axisType::DEFAULT:
174 if (distances_.valid())
return distances_()[index];
176 <<
"Scalar coordinate requested from coordinate set with "
177 << axisTypeNames_[axis_] <<
" axis, but with no valid distances"
192 <<
"Scalar coordinate requested from coordinate set with "
196 return positions_().component(
point::X);
198 return positions_().component(
point::Y);
200 return positions_().component(
point::Z);
201 case axisType::DISTANCE:
203 case axisType::DEFAULT:
204 if (distances_.valid())
return distances_();
206 <<
"Scalar coordinate requested from coordinate set with "
207 << axisTypeNames_[axis_] <<
" axis, but with no valid distances"
222 <<
"Scalar name requested from coordinate set with "
232 case axisType::DISTANCE:
233 return distanceName_;
234 case axisType::DEFAULT:
235 if (distances_.valid())
return distanceName_;
237 <<
"Scalar coordinate requested from coordinate set with "
238 << axisTypeNames_[axis_] <<
" axis, but with no valid distances"
252 return positions_()[index];
256 case axisType::DISTANCE:
258 <<
"Point coordinate requested from coordinate set with "
261 case axisType::DEFAULT:
262 if (positions_.valid())
return positions_()[index];
264 <<
"Point coordinate requested from coordinate set with "
265 << axisTypeNames_[axis_] <<
" axis, but with no valid point"
283 case axisType::DISTANCE:
285 <<
"Point coordinate requested from coordinate set with "
288 case axisType::DEFAULT:
289 if (positions_.valid())
return positions_();
291 <<
"Point coordinate requested from coordinate set with "
292 << axisTypeNames_[axis_] <<
" axis, but with no valid points"
303 if (!positions_.valid())
306 <<
"Positions requested from coordinate set with no valid points"
319 return positionName_;
323 case axisType::DISTANCE:
325 <<
"Point name requested from coordinate set with "
328 case axisType::DEFAULT:
329 if (positions_.valid())
return positionName_;
331 <<
"Point name requested from coordinate set with "
332 << axisTypeNames_[axis_] <<
" axis, but with no valid point"
348 const label s = segments_[pointi];
351 (pointi == 0 ||
s != segments_[pointi - 1])
352 && (pointi == size() - 1 ||
s != segments_[pointi + 1])
370 for (
label pointi = 0; pointi < size() - 1; ++ pointi)
372 if (segments_[pointi] == segments_[pointi + 1])
374 edges[nEdges ++] =
labelPair(pointi, pointi + 1);
396 || segments_[pointi] != segments_[pointi + 1]
411 return linesNonDynamic;
419 if (positions_.valid())
427 if (distances_.valid())
440 if (positions_.valid())
443 ListListOps::combine<List<point>>
451 if (distances_.valid())
454 ListListOps::combine<scalarList>
463 ListListOps::combine<labelList>
480 if (distances_.valid())
488 allSegments[a] < allSegments[
b] ? true
489 : allSegments[a] > allSegments[
b] ? false
490 : allDistances[a] < allDistances[
b];
501 return allSegments[a] < allSegments[
b];
509 if (positions_.valid())
514 if (distances_.valid())
#define forAll(list, i)
Loop across all elements in list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
static const Field< scalar > & null()
Return a null field.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void resize(const label)
Alias for setSize(const label)
void size(const label)
Override size to be inconsistent with allocated storage.
Initialise the NamedEnum HashTable from the static list of names.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
A 2-tuple for storing two objects of different types.
const Type2 & second() const
Return second.
const Type1 & first() const
Return first.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
Holds list of sampling positions.
word distanceName_
Name of the distances.
bool hasPointAxis() const
Is the coordinate axis a point?
labelListList lines() const
Return a list of lines. These are lists of points which are in the.
labelList vertices() const
Return a list of isolated vertices. These are the points that are.
Tuple2< coordSet, labelList > gather() const
Combine coordinate sets onto the master. Return both the combined.
labelPairList edges() const
Return a list of edges. These are adjacent pairs of points which.
autoPtr< pointField > positions_
Point positions.
static const NamedEnum< axisType, 6 > axisTypeNames_
String representation of axis enums.
axisType
Enumeration defining the output format for coordinates.
labelList segments_
Connected segments.
word positionName_
Name of the positions.
coordSet()
Construct null.
tmp< scalarField > scalarCoords() const
Get scalar coordinates (axis is x, y, z or distance)
point pointCoord(const label index) const
Get vector coordinate (axis is xyz)
word scalarName() const
Return the name of the scalar coordinates.
autoPtr< scalarField > distances_
Scalar distances.
word pointName() const
Return the name of the point coordinates.
tmp< pointField > pointCoords() const
Get vector coordinate (axis is xyz)
bool hasScalarAxis() const
Is the coordinate axis a scalar?
scalar scalarCoord(const label index) const
Get scalar coordinate (axis is x, y, z or distance)
const pointField & positions() const
Get the positions.
A class for managing temporary objects.
A class for handling words, derived from string.
static const word null
An empty word.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
errorManipArg< error, int > exit(error &err, const int errNo=1)
Pair< label > labelPair
Label pair.
pointField vertices(const blockVertexList &bvl)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
int order(const scalar s)
bool contiguous()
contiguous
vectorField pointField
pointField is a vectorField.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< label > labelField
Specialisation of Field<T> for label.
bool isNull(const T &t)
Return true if t is a reference to the nullObject of type T.
void stableSort(UList< T > &)
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
PtrList< volScalarField > & Y