Data Structures | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes
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:
Inheritance graph
[legend]
Collaboration diagram for sampledSet:
Collaboration graph
[legend]

Data Structures

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 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 ()
 Destructor. More...
 
const polyMeshmesh () const
 
const meshSearchsearchEngine () const
 
const labelListsegments () const
 
const labelListcells () const
 
const labelListfaces () const
 
Ostreamwrite (Ostream &) const
 Output for debugging. More...
 
- Public Member Functions inherited from coordSet
 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)
 Construct from components. More...
 
const wordname () const
 
word axis () const
 
const scalarListcurveDist () const
 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
 
- Public Member Functions inherited from Field
 Field ()
 Construct null. More...
 
 Field (const label)
 Construct given size. More...
 
 Field (const label, const Type &)
 Construct given size and initial value. More...
 
 Field (const UList< Type > &)
 Construct as copy of a UList<Type> More...
 
 Field (const Xfer< List< Type > > &)
 Construct by transferring the List contents. More...
 
 Field (const UList< Type > &mapF, const labelUList &mapAddressing)
 Construct by 1 to 1 mapping from the given field. More...
 
 Field (const tmp< Field< Type > > &tmapF, const labelUList &mapAddressing)
 Construct by 1 to 1 mapping from the given tmp field. More...
 
 Field (const UList< Type > &mapF, const labelListList &mapAddressing, const scalarListList &weights)
 Construct by interpolative mapping from the given field. More...
 
 Field (const tmp< Field< Type > > &tmapF, const labelListList &mapAddressing, const scalarListList &weights)
 Construct by interpolative mapping from the given tmp field. More...
 
 Field (const UList< Type > &mapF, const FieldMapper &map, const bool applyFlip=true)
 Construct by mapping from the given field. More...
 
 Field (const UList< Type > &mapF, const FieldMapper &map, const Type &defaultValue, const bool applyFlip=true)
 Construct by mapping from the given field. More...
 
 Field (const UList< Type > &mapF, const FieldMapper &map, const UList< Type > &defaultValues, const bool applyFlip=true)
 Construct by mapping from the given field. More...
 
 Field (const tmp< Field< Type > > &tmapF, const FieldMapper &map, const bool applyFlip=true)
 Construct by mapping from the given tmp field. More...
 
 Field (const tmp< Field< Type > > &tmapF, const FieldMapper &map, const Type &defaultValue, const bool applyFlip=true)
 Construct by mapping from the given tmp field. Supplied uniform. More...
 
 Field (const tmp< Field< Type > > &tmapF, const FieldMapper &map, const UList< Type > &defaultValues, const bool applyFlip=true)
 Construct by mapping from the given tmp field. Supplied values. More...
 
 Field (const Field< Type > &)
 Construct as copy. More...
 
 Field (Field< Type > &, bool reUse)
 Construct as copy or re-use as specified. More...
 
 Field (const Xfer< Field< Type > > &)
 Construct by transferring the Field contents. More...
 
 Field (const tmp< Field< Type > > &)
 Construct as copy of tmp<Field> More...
 
 Field (Istream &)
 Construct from Istream. More...
 
 Field (const word &keyword, const dictionary &, const label size)
 Construct from a dictionary entry. More...
 
tmp< Field< Type > > clone () const
 Clone. More...
 
void map (const UList< Type > &mapF, const labelUList &mapAddressing)
 1 to 1 map from the given field More...
 
void map (const tmp< Field< Type > > &tmapF, const labelUList &mapAddressing)
 1 to 1 map from the given tmp field More...
 
void map (const UList< Type > &mapF, const labelListList &mapAddressing, const scalarListList &weights)
 Interpolative map from the given field. More...
 
void map (const tmp< Field< Type > > &tmapF, const labelListList &mapAddressing, const scalarListList &weights)
 Interpolative map from the given tmp field. More...
 
void map (const UList< Type > &mapF, const FieldMapper &map, const bool applyFlip=true)
 Map from the given field. More...
 
void map (const tmp< Field< Type > > &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< Type > &mapF, const labelUList &mapAddressing)
 1 to 1 reverse-map from the given field More...
 
void rmap (const tmp< Field< Type > > &tmapF, const labelUList &mapAddressing)
 1 to 1 reverse-map from the given tmp field More...
 
void rmap (const UList< Type > &mapF, const labelUList &mapAddressing, const UList< scalar > &weights)
 Interpolative reverse map from the given field. More...
 
void rmap (const tmp< Field< Type > > &tmapF, const labelUList &mapAddressing, const UList< scalar > &weights)
 Interpolative reverse map from the given tmp field. More...
 
void negate ()
 Negate this field. 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...
 
tmp< Field< Type > > 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...
 
void operator= (const Field< Type > &)
 
void operator= (const UList< Type > &)
 
void operator= (const SubField< Type > &)
 
void operator= (const tmp< Field< Type > > &)
 
void operator= (const Type &)
 
template<class Form , class Cmpt , int nCmpt>
void operator= (const VectorSpace< Form, Cmpt, nCmpt > &)
 
void operator+= (const UList< Type > &)
 
void operator+= (const tmp< Field< Type > > &)
 
void operator-= (const UList< Type > &)
 
void operator-= (const tmp< Field< Type > > &)
 
void operator*= (const UList< scalar > &)
 
void operator*= (const tmp< Field< scalar > > &)
 
void operator/= (const UList< scalar > &)
 
void operator/= (const tmp< Field< scalar > > &)
 
void operator+= (const Type &)
 
void operator-= (const Type &)
 
void operator*= (const scalar &)
 
void operator/= (const scalar &)
 
template<class Type >
void operator= (const Field< Type > &rhs)
 
template<class Type >
void operator= (const SubField< Type > &rhs)
 
template<class Type >
void operator= (const UList< Type > &rhs)
 
template<class Type >
void operator= (const tmp< Field > &rhs)
 
template<class Type >
void operator= (const Type &t)
 

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
static const Field< Type > & null ()
 Return a null field. More...
 
template<class Type2 >
static tmp< Field< Type > > NewCalculatedType (const Field< Type2 > &f)
 Return a pointer to a new calculatedFvPatchFieldField created on. More...
 

Static Public Attributes

static const scalar tol = 1e-6
 Tolerance when comparing points. Usually relative to difference. More...
 
- Static Public Attributes inherited from Field
static const char *const typeName
 

Protected Member Functions

label getBoundaryCell (const label) const
 Returns cell next to boundary face. More...
 
label getCell (const label faceI, const point &sample) const
 Returns cell using face and containing sample. 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 vector &offset, const point &samplePt, const point &bPoint, const label bFaceI, 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)
 Sets sample data. 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...
 

Private Attributes

const polyMeshmesh_
 Reference to mesh. More...
 
const meshSearchsearchEngine_
 Reference to mesh searching class. 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
typedef pTraits< Type >::cmptType cmptType
 Component type. More...
 
typedef SubField< Type > subField
 Declare type of subField. 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)

Source files

Definition at line 64 of file sampledSet.H.

Constructor & Destructor Documentation

◆ sampledSet() [1/2]

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

Construct from components.

Definition at line 398 of file sampledSet.C.

◆ sampledSet() [2/2]

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

Construct from dictionary.

Definition at line 415 of file sampledSet.C.

◆ ~sampledSet()

~sampledSet ( )
virtual

Destructor.

Definition at line 433 of file sampledSet.C.

Member Function Documentation

◆ getBoundaryCell()

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

Returns cell next to boundary face.

Definition at line 46 of file sampledSet.C.

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

Here is the call graph for this function:

◆ getCell()

Foam::label getCell ( const label  faceI,
const point sample 
) const
protected

Returns cell using face and containing sample.

Definition at line 53 of file sampledSet.C.

References Foam::abort(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), Foam::FatalError, FatalErrorInFunction, and mesh.

Referenced by midPointSet::genSamples(), and midPointAndFaceSet::genSamples().

Here is the call graph for this function:
Here is the caller 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 111 of file sampledSet.C.

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

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 138 of file sampledSet.C.

References primitiveMesh::cells(), f(), polyMesh::faces(), forAll, PointHit::hit(), PointHit::hitPoint(), Foam::mag(), mesh, PointHit::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 175 of file sampledSet.C.

References Foam::abort(), primitiveMesh::cellCentres(), Foam::endl(), primitiveMesh::faceCentres(), polyMesh::faceOwner(), Foam::FatalError, FatalErrorInFunction, polyMesh::findTetFacePt(), mesh, and particle< Type >::trackingCorrectionTol.

Here is the call graph for this function:

◆ getTrackingPoint()

bool getTrackingPoint ( const vector offset,
const point samplePt,
const point bPoint,
const label  bFaceI,
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 238 of file sampledSet.C.

References Foam::endl(), polyMesh::findCell(), Foam::Info, Foam::mag(), mesh, and Foam::sign().

Here is the call graph for this function:

◆ setSamples()

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

◆ 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 223 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 440 of file sampledSet.C.

References dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, dictionary::lookup(), mesh, Foam::name(), and Foam::nl.

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

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 248 of file sampledSet.H.

References sampledSet::mesh_.

Referenced by sampledSet::getBoundaryCell().

Here is the caller graph for this function:

◆ searchEngine()

const meshSearch& searchEngine ( ) const
inline

Definition at line 253 of file sampledSet.H.

References sampledSet::searchEngine_.

◆ segments()

const labelList& segments ( ) const
inline

Definition at line 258 of file sampledSet.H.

References sampledSet::segments_.

Referenced by sampledSets::combineSampledSets().

Here is the caller graph for this function:

◆ cells()

const labelList& cells ( ) const
inline

Definition at line 263 of file sampledSet.H.

References sampledSet::cells_.

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

Here is the caller graph for this function:

◆ faces()

const labelList& faces ( ) const
inline

Definition at line 268 of file sampledSet.H.

References sampledSet::faces_.

◆ write()

Foam::Ostream & write ( Ostream os) const

Output for debugging.

Definition at line 475 of file sampledSet.C.

References Foam::endl(), forAll, and coordSet::write().

Here is the call graph for this function:

Field Documentation

◆ mesh_

const polyMesh& mesh_
private

Reference to mesh.

Definition at line 71 of file sampledSet.H.

Referenced by sampledSet::mesh().

◆ searchEngine_

const meshSearch& searchEngine_
private

Reference to mesh searching class.

Definition at line 74 of file sampledSet.H.

Referenced by sampledSet::searchEngine().

◆ segments_

labelList segments_
protected

Segment numbers.

Definition at line 80 of file sampledSet.H.

Referenced by midPointSet::genSamples(), midPointAndFaceSet::genSamples(), and sampledSet::segments().

◆ cells_

labelList cells_
protected

Cell numbers.

Definition at line 83 of file sampledSet.H.

Referenced by sampledSet::cells(), and midPointAndFaceSet::genSamples().

◆ faces_

labelList faces_
protected

Face numbers (-1 if not known)

Definition at line 86 of file sampledSet.H.

Referenced by sampledSet::faces(), midPointSet::genSamples(), and midPointAndFaceSet::genSamples().

◆ tol

const scalar tol = 1e-6
static

Tolerance when comparing points. Usually relative to difference.

between start_ and end_

Definition at line 199 of file sampledSet.H.


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