coordSet Class Reference

Holds list of sampling positions. More...

Inheritance diagram for coordSet:
Collaboration diagram for coordSet:

Public Types

enum class  axisType {
  XYZ , X , Y , Z ,
  DISTANCE , DEFAULT
}
 Enumeration defining the output format for coordinates. More...
 

Public Member Functions

 coordSet ()
 Construct null. More...
 
 coordSet (const labelList &segments, const word &positionName=word::null, const pointField &positions=pointField::null(), const word &distanceName=word::null, const scalarField &distances=scalarField::null(), const word &axis=axisTypeNames_[axisType::DEFAULT])
 Construct from components. More...
 
 coordSet (const bool contiguous, const word &positionName, const pointField &positions, const word &axis=axisTypeNames_[axisType::DEFAULT])
 Construct from positions. More...
 
 coordSet (const bool contiguous, const word &distanceName, const scalarField &distances, const word &axis=axisTypeNames_[axisType::DEFAULT])
 Construct from distances. More...
 
label size () const
 Return the size. More...
 
const labelListsegments () const
 Return the segments. More...
 
word axis () const
 Return the axis name. More...
 
bool hasScalarAxis () const
 Is the coordinate axis a scalar? More...
 
bool hasPointAxis () const
 Is the coordinate axis a point? More...
 
scalar scalarCoord (const label index) const
 Get scalar coordinate (axis is x, y, z or distance) More...
 
tmp< scalarFieldscalarCoords () const
 Get scalar coordinates (axis is x, y, z or distance) More...
 
word scalarName () const
 Return the name of the scalar coordinates. More...
 
point pointCoord (const label index) const
 Get vector coordinate (axis is xyz) More...
 
tmp< pointFieldpointCoords () const
 Get vector coordinate (axis is xyz) More...
 
word pointName () const
 Return the name of the point coordinates. More...
 
labelList vertices () const
 Return a list of isolated vertices. These are the points that are. More...
 
labelPairList edges () const
 Return a list of edges. These are adjacent pairs of points which. More...
 
labelListList lines () const
 Return a list of lines. These are lists of points which are in the. More...
 
Tuple2< coordSet, labelListgather () const
 Combine coordinate sets onto the master. Return both the combined. More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > gather (const Field< Type > &values, const labelList &order)
 

Static Public Member Functions

template<class Type >
static tmp< Field< Type > > gather (const Field< Type > &values, const labelList &order)
 Combine a field using the ordering obtained from the coordinate set. More...
 

Static Public Attributes

static const NamedEnum< axisType, 6 > axisTypeNames_
 String representation of axis enums. More...
 

Protected Attributes

labelList segments_
 Connected segments. More...
 
word positionName_
 Name of the positions. More...
 
autoPtr< pointFieldpositions_
 Point positions. More...
 
word distanceName_
 Name of the distances. More...
 
autoPtr< scalarFielddistances_
 Scalar distances. More...
 
axisType axis_
 Axis. More...
 

Detailed Description

Holds list of sampling positions.

Source files

Definition at line 50 of file coordSet.H.

Member Enumeration Documentation

◆ axisType

enum axisType
strong

Enumeration defining the output format for coordinates.

Enumerator
XYZ 
DISTANCE 
DEFAULT 

Definition at line 57 of file coordSet.H.

Constructor & Destructor Documentation

◆ coordSet() [1/4]

coordSet ( )

Construct null.

Definition at line 52 of file coordSet.C.

Referenced by sampledSet::setSamples().

Here is the caller graph for this function:

◆ coordSet() [2/4]

coordSet ( const labelList segments,
const word positionName = word::null,
const pointField positions = pointField::null(),
const word distanceName = word::null,
const scalarField distances = scalarField::null(),
const word axis = axisTypeNames_[axisType::DEFAULT] 
)

Construct from components.

Definition at line 63 of file coordSet.C.

◆ coordSet() [3/4]

coordSet ( const bool  contiguous,
const word positionName,
const pointField positions,
const word axis = axisTypeNames_[axisType::DEFAULT] 
)

Construct from positions.

Definition at line 92 of file coordSet.C.

◆ coordSet() [4/4]

coordSet ( const bool  contiguous,
const word distanceName,
const scalarField distances,
const word axis = axisTypeNames_[axisType::DEFAULT] 
)

Construct from distances.

Definition at line 114 of file coordSet.C.

Member Function Documentation

◆ size()

label size ( ) const
inline

Return the size.

Definition at line 135 of file coordSet.H.

References coordSet::segments_, and List< T >::size().

Referenced by points::calcSamples(), ensightSetWriter::write(), and rawSetWriter::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ segments()

const labelList& segments ( ) const
inline

Return the segments.

Definition at line 141 of file coordSet.H.

References coordSet::segments_.

Referenced by gnuplotSetWriter::write(), rawSetWriter::write(), and setWriter::writeTable().

Here is the caller graph for this function:

◆ axis()

word axis ( ) const
inline

Return the axis name.

Definition at line 147 of file coordSet.H.

References coordSet::axis_, and coordSet::axisTypeNames_.

Referenced by sampledSet::sampledSet(), and gnuplotSetWriter::write().

Here is the caller graph for this function:

◆ hasScalarAxis()

bool hasScalarAxis ( ) const

Is the coordinate axis a scalar?

Definition at line 138 of file coordSet.C.

References Y.

Referenced by gnuplotSetWriter::write(), setWriter::writeTable(), and setWriter::writeTableHeader().

Here is the caller graph for this function:

◆ hasPointAxis()

bool hasPointAxis ( ) const

Is the coordinate axis a point?

Definition at line 152 of file coordSet.C.

Referenced by ensightSetWriter::write(), vtkSetWriter::write(), setWriter::writeTable(), and setWriter::writeTableHeader().

Here is the caller graph for this function:

◆ scalarCoord()

Foam::scalar scalarCoord ( const label  index) const

Get scalar coordinate (axis is x, y, z or distance)

Definition at line 163 of file coordSet.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::patchToPatchTools::NaN(), and Y.

Referenced by setWriter::writeTable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scalarCoords()

Foam::tmp< Foam::scalarField > scalarCoords ( ) const

Get scalar coordinates (axis is x, y, z or distance)

Definition at line 193 of file coordSet.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Field< scalar >::null(), Vector< scalar >::X, Y, Vector< scalar >::Y, and Vector< scalar >::Z.

Referenced by gnuplotSetWriter::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scalarName()

Foam::word scalarName ( ) const

Return the name of the scalar coordinates.

Definition at line 223 of file coordSet.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, word::null, and Y.

Referenced by gnuplotSetWriter::write(), and setWriter::writeTableHeader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pointCoord()

Foam::point pointCoord ( const label  index) const

Get vector coordinate (axis is xyz)

Definition at line 254 of file coordSet.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::patchToPatchTools::NaN(), VectorSpace< Form, Cmpt, Ncmpts >::uniform(), and Y.

Referenced by setWriter::writeTable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pointCoords()

Foam::tmp< Foam::pointField > pointCoords ( ) const

Get vector coordinate (axis is xyz)

Definition at line 281 of file coordSet.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Field< vector >::null(), and Y.

Referenced by ensightSetWriter::write(), and vtkSetWriter::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pointName()

Foam::word pointName ( ) const

Return the name of the point coordinates.

Definition at line 308 of file coordSet.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, word::null, and Y.

Referenced by setWriter::writeTableHeader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vertices()

Foam::labelList vertices ( ) const

Return a list of isolated vertices. These are the points that are.

not adjacent to any points in the same segment.

Definition at line 335 of file coordSet.C.

References forAll, List< T >::resize(), s(), and Foam::vertices().

Referenced by ensightSetWriter::write(), and vtkSetWriter::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ edges()

Foam::labelPairList edges ( ) const

Return a list of edges. These are adjacent pairs of points which.

are in the same segment.

Definition at line 359 of file coordSet.C.

References List< T >::resize().

Referenced by ensightSetWriter::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lines()

Foam::labelListList lines ( ) const

Return a list of lines. These are lists of points which are in the.

same segment.

Definition at line 378 of file coordSet.C.

References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), forAll, and List< T >::transfer().

Referenced by vtkSetWriter::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gather() [1/3]

Combine coordinate sets onto the master. Return both the combined.

coordinate set, and an ordering to be used for gathering associated fields

Definition at line 409 of file coordSet.C.

References coordSet::axis_, b, coordSet::distanceName_, coordSet::distances_, Tuple2< Type1, Type2 >::first(), Pstream::gatherList(), Foam::identityMap(), UPstream::myProcNo(), UPstream::nProcs(), coordSet::positionName_, coordSet::positions_, List< T >::resize(), Tuple2< Type1, Type2 >::second(), coordSet::segments_, List< T >::size(), and Foam::stableSort().

Referenced by sampledSets::sampleType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gather() [2/3]

static tmp<Field<Type> > gather ( const Field< Type > &  values,
const labelList order 
)
static

Combine a field using the ordering obtained from the coordinate set.

gather operation

◆ gather() [3/3]

Foam::tmp<Foam::Field<Type> > gather ( const Field< Type > &  values,
const labelList order 
)

Definition at line 32 of file coordSetTemplates.C.

References Foam::ListListOps::combine(), Pstream::gatherList(), UPstream::myProcNo(), and UPstream::nProcs().

Here is the call graph for this function:

Member Data Documentation

◆ axisTypeNames_

◆ segments_

labelList segments_
protected

Connected segments.

Definition at line 77 of file coordSet.H.

Referenced by coordSet::gather(), coordSet::segments(), and coordSet::size().

◆ positionName_

word positionName_
protected

Name of the positions.

Definition at line 80 of file coordSet.H.

Referenced by coordSet::gather().

◆ positions_

autoPtr<pointField> positions_
protected

Point positions.

Definition at line 83 of file coordSet.H.

Referenced by coordSet::gather(), and sampledSet::positions().

◆ distanceName_

word distanceName_
protected

Name of the distances.

Definition at line 86 of file coordSet.H.

Referenced by coordSet::gather().

◆ distances_

autoPtr<scalarField> distances_
protected

Scalar distances.

Definition at line 89 of file coordSet.H.

Referenced by coordSet::gather().

◆ axis_

axisType axis_
protected

Axis.

Definition at line 92 of file coordSet.H.

Referenced by coordSet::axis(), coordSet::gather(), sampledSet::sampledSet(), and sampledSet::setSamples().


The documentation for this class was generated from the following files: