sampledSet Class Reference

Holds list of sampling points which is filled at construction time. Various implementations of this base class to e.g. get sampling points at uniform distance along a line (uniformSet) or directly specified (cloudSet) More...

Inheritance diagram for sampledSet:
[legend]
Collaboration diagram for sampledSet:
[legend]

Classes

class  iNew
 Class used for the read-construction of. More...
 

Public Member Functions

 TypeName ("sampledSet")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, sampledSet, word,(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict),(name, mesh, searchEngine, dict))
 
 sampledSet (const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const coordSet::coordFormat axisType)
 Construct from components. More...
 
 sampledSet (const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis)
 Construct from components. More...
 
 sampledSet (const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
 Construct from dictionary. More...
 
autoPtr< sampledSetclone () const
 Clone. More...
 
virtual ~sampledSet ()=default
 Destructor. More...
 
const polyMeshmesh () const
 
const meshSearchsearchEngine () const
 
const labelListsegments () const
 
const labelListcells () const
 
const labelListfaces () const
 
Ostreamwrite (Ostream &) const
 Output for debugging. More...
 
autoPtr< coordSetgather (labelList &indexSet, labelList &allSegments) const
 Helper: gather onto master and sort. More...
 
- Public Member Functions inherited from coordSet
 coordSet (const word &name, const coordFormat axisType)
 Construct from components. More...
 
 coordSet (const word &name, const word &axis)
 Construct from components. More...
 
 coordSet (const word &name, const word &axis, const List< point > &points, const scalarList &curveDist)
 Copy construct from components. More...
 
 coordSet (const word &name, const word &axis, List< point > &&points, scalarList &&curveDist)
 Move construct from components. More...
 
const wordname () const
 
word axis () const
 
void setPoints (const List< point > &newPoints)
 Set the points. More...
 
void setPoints (List< point > &&newPoints)
 Set the points. More...
 
const scalarListcurveDist () const
 Return the cumulative distance. More...
 
void setCurveDist (const scalarList &curveDist)
 Set the cumulative distance. More...
 
void setCurveDist (scalarList &&curveDist)
 Set the cumulative distance. More...
 
bool hasVectorAxis () const
 Is axis specification a vector. More...
 
scalar scalarCoord (const label index) const
 Get coordinate of point according to axis specification. More...
 
vector vectorCoord (const label index) const
 Get point according to axis="xyz" specification. More...
 
Ostreamwrite (Ostream &os) const
 Write to stream. More...
 
- Public Member Functions inherited from Field< vector >
constexpr Field () noexcept
 Default construct. More...
 
 Field (const label len)
 Construct given size. More...
 
 Field (const label len, const vector &val)
 Construct given size and initial value. More...
 
 Field (const label len, const Foam::zero)
 Construct given size and initial values of zero. More...
 
 Field (const Foam::one, const vector &val)
 Construct with length=1, copying the value as the only content. More...
 
 Field (const Foam::one, vector &&val)
 Construct with length=1, moving the value as the only content. More...
 
 Field (const Foam::one, const Foam::zero)
 Construct with length=1, initializing content to zero. More...
 
 Field (const Field< vector > &fld)
 Copy construct. More...
 
 Field (const UList< vector > &list)
 Copy construct from UList<Type> More...
 
 Field (const IndirectListBase< vector, Addr > &list)
 Copy construct from IndirectList. More...
 
 Field (Field< vector > &&fld)
 Move construct from Field. More...
 
 Field (List< vector > &&list)
 Move construct from List. More...
 
 Field (DynamicList< vector, SizeMin > &&list)
 Move construct from DynamicList. More...
 
 Field (const UList< vector > &mapF, const labelUList &mapAddressing)
 Construct by 1 to 1 mapping from the given field. More...
 
 Field (const tmp< Field< vector >> &tmapF, const labelUList &mapAddressing)
 Construct by 1 to 1 mapping from the given tmp field. More...
 
 Field (const UList< vector > &mapF, const labelListList &mapAddressing, const scalarListList &weights)
 Construct by interpolative mapping from the given field. More...
 
 Field (const tmp< Field< vector >> &tmapF, const labelListList &mapAddressing, const scalarListList &weights)
 Construct by interpolative mapping from the given tmp field. More...
 
 Field (const UList< vector > &mapF, const FieldMapper &map, const bool applyFlip=true)
 Construct by mapping from the given field. More...
 
 Field (const UList< vector > &mapF, const FieldMapper &map, const vector &defaultValue, const bool applyFlip=true)
 Construct by mapping from the given field. More...
 
 Field (const UList< vector > &mapF, const FieldMapper &map, const UList< vector > &defaultValues, const bool applyFlip=true)
 Construct by mapping from the given field. More...
 
 Field (const tmp< Field< vector >> &tmapF, const FieldMapper &map, const bool applyFlip=true)
 Construct by mapping from the given tmp field. More...
 
 Field (const tmp< Field< vector >> &tmapF, const FieldMapper &map, const vector &defaultValue, const bool applyFlip=true)
 
 Field (const tmp< Field< vector >> &tmapF, const FieldMapper &map, const UList< vector > &defaultValues, const bool applyFlip=true)
 
 Field (Field< vector > &fld, bool reuse)
 Copy construct or re-use as specified. More...
 
 Field (const tmp< Field< vector >> &tfld)
 Copy or move construct from tmp. More...
 
 Field (Istream &is)
 Construct from Istream. More...
 
 Field (const word &keyword, const dictionary &dict, const label len)
 Construct from a dictionary entry. More...
 
tmp< Field< vector > > clone () const
 Clone. More...
 
void map (const UList< vector > &mapF, const labelUList &mapAddressing)
 1 to 1 map from the given field More...
 
void map (const tmp< Field< vector >> &tmapF, const labelUList &mapAddressing)
 1 to 1 map from the given tmp field More...
 
void map (const UList< vector > &mapF, const labelListList &mapAddressing, const scalarListList &weights)
 Interpolative map from the given field. More...
 
void map (const tmp< Field< vector >> &tmapF, const labelListList &mapAddressing, const scalarListList &weights)
 Interpolative map from the given tmp field. More...
 
void map (const UList< vector > &mapF, const FieldMapper &map, const bool applyFlip=true)
 Map from the given field. More...
 
void map (const tmp< Field< vector >> &tmapF, const FieldMapper &map, const bool applyFlip=true)
 Map from the given tmp field. More...
 
void autoMap (const FieldMapper &map, const bool applyFlip=true)
 Map from self. More...
 
void rmap (const UList< vector > &mapF, const labelUList &mapAddressing)
 1 to 1 reverse-map from the given field More...
 
void rmap (const tmp< Field< vector >> &tmapF, const labelUList &mapAddressing)
 1 to 1 reverse-map from the given tmp field More...
 
void rmap (const UList< vector > &mapF, const labelUList &mapAddressing, const UList< scalar > &weights)
 Interpolative reverse map from the given field. More...
 
void rmap (const tmp< Field< vector >> &tmapF, const labelUList &mapAddressing, const UList< scalar > &weights)
 Interpolative reverse map from the given tmp field. More...
 
void negate ()
 Negate this field (negative). More...
 
tmp< Field< cmptType > > component (const direction) const
 Return a component field of the field. More...
 
void replace (const direction, const UList< cmptType > &)
 Replace a component field of the field. More...
 
void replace (const direction, const tmp< Field< cmptType >> &)
 Replace a component field of the field. More...
 
void replace (const direction, const cmptType &)
 Replace a component field of the field. More...
 
VSForm block (const label start) const
 
tmp< Field< vector > > T () const
 Return the field transpose (only defined for second rank tensors) More...
 
void writeEntry (const word &keyword, Ostream &os) const
 Write the field as a dictionary entry. More...
 
SubField< vectorslice (const label pos, label len=-1)
 Return SubField slice (non-const access) - no range checking. More...
 
const SubField< vectorslice (const label pos, label len=-1) const
 Return SubField slice (const access) - no range checking. More...
 
SubField< vectorslice (const labelRange &range)
 Return SubField slice (non-const access) - with range checking. More...
 
const SubField< vectorslice (const labelRange &range) const
 Return SubField slice (const access) - with range checking. More...
 
void operator= (const Field< vector > &)
 Copy assignment. More...
 
void operator= (const tmp< Field< vector >> &)
 
void operator= (const UList< vector > &rhs)
 
void operator= (const SubField< vector > &rhs)
 
void operator= (const IndirectListBase< vector, Addr > &rhs)
 Copy assign from IndirectList. More...
 
void operator= (Field< vector > &&rhs)
 Move assignment. More...
 
void operator= (List< vector > &&rhs)
 
void operator= (DynamicList< vector, SizeMin > &&rhs)
 
void operator= (const vector &val)
 Value assignment. More...
 
void operator= (const Foam::zero)
 
void operator= (const VectorSpace< Form, Cmpt, nCmpt > &)
 
void operator= (const tmp< Field > &rhs)
 
void operator+= (const UList< vector > &)
 
void operator+= (const tmp< Field< vector >> &)
 
void operator+= (const vector &)
 
void operator-= (const UList< vector > &)
 
void operator-= (const tmp< Field< vector >> &)
 
void operator-= (const vector &)
 
void operator*= (const UList< scalar > &)
 
void operator*= (const tmp< Field< scalar >> &)
 
void operator*= (const scalar &)
 
void operator/= (const UList< scalar > &)
 
void operator/= (const tmp< Field< scalar >> &)
 
void operator/= (const scalar &)
 

Static Public Member Functions

static autoPtr< sampledSetNew (const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
 Return a reference to the selected sampledSet. More...
 
- Static Public Member Functions inherited from Field< vector >
static const Field< vector > & null ()
 Return nullObject reference Field. More...
 
static autoPtr< Field< vector > > New (Istream &is)
 Return a pointer to a new Field created on freestore. More...
 
static tmp< Field< vector > > NewCalculatedType (const Field< Type2 > &f)
 

Protected Member Functions

void checkDimensions () const
 Check for consistent sizing. More...
 
label getBoundaryCell (const label) const
 Returns cell next to boundary face. More...
 
label getNeighbourCell (const label) const
 Returns the neighbour cell or the owner if face in on the boundary. More...
 
label pointInCell (const point &p, const label samplei) const
 Return the cell in which the point on the sample line. More...
 
scalar calcSign (const label facei, const point &sample) const
 Calculates inproduct of face normal and vector sample-face centre. More...
 
label findNearFace (const label celli, const point &sample, const scalar smallDist) const
 Returns face label (or -1) of face which is close to sample. More...
 
point pushIn (const point &sample, const label facei) const
 Moves sample in direction of -n to it is 'inside' of facei. More...
 
bool getTrackingPoint (const point &samplePt, const point &bPoint, const label bFacei, const scalar smallDist, point &trackPt, label &trackCelli, label &trackFacei) const
 Calculates start of tracking given samplePt and first boundary. More...
 
void setSamples (const List< point > &samplingPts, const labelList &samplingCells, const labelList &samplingFaces, const labelList &samplingSegments, const scalarList &samplingCurveDist)
 Set sample data. Copy list contents. More...
 
void setSamples (List< point > &&samplingPts, labelList &&samplingCells, labelList &&samplingFaces, labelList &&samplingSegments, scalarList &&samplingCurveDist)
 Set sample data. Move list contents. More...
 

Protected Attributes

labelList segments_
 Segment numbers. More...
 
labelList cells_
 Cell numbers. More...
 
labelList faces_
 Face numbers (-1 if not known) More...
 
- Protected Attributes inherited from coordSet
const word name_
 Name. More...
 
const coordFormat axis_
 Axis write type. More...
 
scalarList curveDist_
 Cumulative distance "distance" write specifier. More...
 

Additional Inherited Members

- Public Types inherited from coordSet
enum  coordFormat {
  XYZ, X, Y, Z,
  DISTANCE
}
 Enumeration defining the output format for coordinates. More...
 
- Public Types inherited from Field< vector >
typedef pTraits< vector >::cmptType cmptType
 Component type. More...
 
typedef SubField< vectorsubField
 Declare type of subField. More...
 
- Static Public Attributes inherited from coordSet
static const Enum< coordFormatcoordFormatNames
 String representation of coordFormat enum. More...
 

Detailed Description

Holds list of sampling points which is filled at construction time. Various implementations of this base class to e.g. get sampling points at uniform distance along a line (uniformSet) or directly specified (cloudSet)

Each 'sampledSet' has a name and a specifier of how the axis should be write (x/y/z component or all 3 components)

For a dictionary specification:

Property Description Required Default
axis x, y, z, xyz, distance yes
Source files

Definition at line 83 of file sampledSet.H.

Constructor & Destructor Documentation

◆ sampledSet() [1/3]

sampledSet ( const word name,
const polyMesh mesh,
const meshSearch searchEngine,
const coordSet::coordFormat  axisType 
)

Construct from components.

Definition at line 466 of file sampledSet.C.

◆ sampledSet() [2/3]

sampledSet ( const word name,
const polyMesh mesh,
const meshSearch searchEngine,
const word axis 
)

Construct from components.

Definition at line 483 of file sampledSet.C.

◆ sampledSet() [3/3]

sampledSet ( const word name,
const polyMesh mesh,
const meshSearch searchEngine,
const dictionary dict 
)

Construct from dictionary.

Definition at line 500 of file sampledSet.C.

◆ ~sampledSet()

virtual ~sampledSet ( )
virtualdefault

Destructor.

Member Function Documentation

◆ checkDimensions()

void checkDimensions ( ) const
protected

Check for consistent sizing.

Definition at line 48 of file sampledSet.C.

References Foam::abort(), sampledSet::cells_, coordSet::curveDist_, sampledSet::faces_, Foam::FatalError, FatalErrorInFunction, and sampledSet::segments_.

Here is the call graph for this function:

◆ getBoundaryCell()

Foam::label getBoundaryCell ( const label  facei) const
protected

Returns cell next to boundary face.

Definition at line 70 of file sampledSet.C.

References polyMesh::faceOwner(), and mesh.

Here is the call graph for this function:

◆ getNeighbourCell()

Foam::label getNeighbourCell ( const label  facei) const
protected

Returns the neighbour cell or the owner if face in on the boundary.

Definition at line 76 of file sampledSet.C.

References polyMesh::faceNeighbour(), polyMesh::faceOwner(), and mesh.

Here is the call graph for this function:

◆ pointInCell()

Foam::label pointInCell ( const point p,
const label  samplei 
) const
protected

Return the cell in which the point on the sample line.

resides if found otherwise return -1

Definition at line 90 of file sampledSet.C.

References cells, Foam::expressions::patchExpr::debug, Foam::endl(), polyMesh::faceOwner(), mesh, Foam::nl, p, polyMesh::pointInCell(), and WarningInFunction.

Here is the call graph for this function:

◆ calcSign()

Foam::scalar calcSign ( const label  facei,
const point sample 
) const
protected

Calculates inproduct of face normal and vector sample-face centre.

<0 if sample inside.

Definition at line 162 of file sampledSet.C.

References primitiveMesh::faceCentres(), Foam::mag(), mesh, n, and Foam::normalised().

Here is the call graph for this function:

◆ findNearFace()

Foam::label findNearFace ( const label  celli,
const point sample,
const scalar  smallDist 
) const
protected

Returns face label (or -1) of face which is close to sample.

Definition at line 186 of file sampledSet.C.

References primitiveMesh::cells(), f(), polyMesh::faces(), forAll, PointHit< PointType >::hit(), PointHit< PointType >::hitPoint(), Foam::mag(), mesh, PointHit< PointType >::missPoint(), and points.

Here is the call graph for this function:

◆ pushIn()

Foam::point pushIn ( const point sample,
const label  facei 
) const
protected

Moves sample in direction of -n to it is 'inside' of facei.

Definition at line 221 of file sampledSet.C.

References Foam::abort(), primitiveMesh::cellCentres(), Foam::constant::electromagnetic::e, Foam::endl(), primitiveMesh::faceCentres(), polyMesh::faceOwner(), Foam::FatalError, FatalErrorInFunction, polyMesh::findTetFacePt(), and mesh.

Here is the call graph for this function:

◆ getTrackingPoint()

bool getTrackingPoint ( const point samplePt,
const point bPoint,
const label  bFacei,
const scalar  smallDist,
point trackPt,
label &  trackCelli,
label &  trackFacei 
) const
protected

Calculates start of tracking given samplePt and first boundary.

intersection (bPoint, bFacei) (bFacei == -1 if no boundary intersection) Returns true if trackPt is valid sampling point. Sets trackPt, trackFacei, trackCelli (-1 if no tracking point found)

Definition at line 286 of file sampledSet.C.

References DebugInFunction, Foam::endl(), polyMesh::findCell(), Foam::mag(), mesh, Foam::nl, polyMesh::pointInCell(), and Foam::sign().

Here is the call graph for this function:

◆ setSamples() [1/2]

void setSamples ( const List< point > &  samplingPts,
const labelList samplingCells,
const labelList samplingFaces,
const labelList samplingSegments,
const scalarList samplingCurveDist 
)
protected

Set sample data. Copy list contents.

Definition at line 382 of file sampledSet.C.

◆ setSamples() [2/2]

void setSamples ( List< point > &&  samplingPts,
labelList &&  samplingCells,
labelList &&  samplingFaces,
labelList &&  samplingSegments,
scalarList &&  samplingCurveDist 
)
protected

Set sample data. Move list contents.

Definition at line 402 of file sampledSet.C.

◆ TypeName()

TypeName ( "sampledSet"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
sampledSet  ,
word  ,
(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict ,
(name, mesh, searchEngine, dict  
)

◆ clone()

autoPtr<sampledSet> clone ( ) const
inline

Clone.

Definition at line 256 of file sampledSet.H.

References NotImplemented.

◆ New()

Foam::autoPtr< Foam::sampledSet > New ( const word name,
const polyMesh mesh,
const meshSearch searchEngine,
const dictionary dict 
)
static

Return a reference to the selected sampledSet.

Definition at line 519 of file sampledSet.C.

References dict, Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, dictionary::get(), mesh, Foam::name(), and dictionary::optionalSubDict().

Referenced by sampledSet::iNew::operator()(), and streamLineBase::sampledSetPoints().

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

◆ mesh()

const polyMesh& mesh ( ) const
inline

Definition at line 281 of file sampledSet.H.

◆ searchEngine()

const meshSearch& searchEngine ( ) const
inline

Definition at line 286 of file sampledSet.H.

◆ segments()

const labelList& segments ( ) const
inline

Definition at line 291 of file sampledSet.H.

References sampledSet::segments_.

◆ cells()

const labelList& cells ( ) const
inline

Definition at line 296 of file sampledSet.H.

References sampledSet::cells_.

Referenced by streamLine::track(), and wallBoundedStreamLine::track().

Here is the caller graph for this function:

◆ faces()

const labelList& faces ( ) const
inline

Definition at line 301 of file sampledSet.H.

References sampledSet::faces_.

◆ write()

Foam::Ostream & write ( Ostream os) const

Output for debugging.

Definition at line 554 of file sampledSet.C.

References forAll, Foam::nl, os(), and coordSet::write().

Here is the call graph for this function:

◆ gather()

Foam::autoPtr< Foam::coordSet > gather ( labelList indexSet,
labelList allSegments 
) const

Helper: gather onto master and sort.

Returns
(on master) gathered set and overall sort order

Definition at line 422 of file sampledSet.C.

References Foam::endl(), globalIndex::gatherOp(), UPstream::master(), Foam::name(), autoPtr< T >::New(), Foam::sortedOrder(), and WarningInFunction.

Here is the call graph for this function:

Member Data Documentation

◆ segments_

labelList segments_
protected

Segment numbers.

Definition at line 99 of file sampledSet.H.

Referenced by sampledSet::checkDimensions(), and sampledSet::segments().

◆ cells_

labelList cells_
protected

Cell numbers.

Definition at line 102 of file sampledSet.H.

Referenced by sampledSet::cells(), and sampledSet::checkDimensions().

◆ faces_

labelList faces_
protected

Face numbers (-1 if not known)

Definition at line 105 of file sampledSet.H.

Referenced by sampledSet::checkDimensions(), and sampledSet::faces().


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