Data Structures | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
probes Class Reference

Set of locations to sample. More...

Inheritance diagram for probes:
Inheritance graph
[legend]
Collaboration diagram for probes:
Collaboration graph
[legend]

Data Structures

class  fieldGroup
 Class used for grouping field types. More...
 

Public Member Functions

 TypeName ("probes")
 Runtime type information. More...
 
 probes (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false, const bool findElements=true)
 Construct for given objectRegistry and dictionary. More...
 
virtual ~probes ()
 Destructor. More...
 
virtual const wordname () const
 Return name of the set of probes. More...
 
virtual const wordReListfieldNames () const
 Return names of fields to probe. More...
 
virtual const pointFieldprobeLocations () const
 Return locations to probe. More...
 
virtual const pointprobe (const label i) const
 Return location for probe i. More...
 
const labelListelements () const
 Cells to be probed (obtained from the locations) More...
 
virtual void execute ()
 Execute, currently does nothing. More...
 
virtual void end ()
 Execute at the final time-loop, currently does nothing. More...
 
virtual void timeSet ()
 Called when time was set at the end of the Time::operator++. More...
 
virtual void write ()
 Sample and write. More...
 
virtual void read (const dictionary &)
 Read the probes. More...
 
virtual void updateMesh (const mapPolyMesh &)
 Update for changes of mesh. More...
 
virtual void movePoints (const polyMesh &)
 Update for changes of mesh. More...
 
virtual void readUpdate (const polyMesh::readUpdateState state)
 Update for changes of mesh due to readUpdate. More...
 
template<class Type >
tmp< Field< Type > > sample (const GeometricField< Type, fvPatchField, volMesh > &) const
 Sample a volume field at all locations. More...
 
template<class Type >
tmp< Field< Type > > sample (const word &fieldName) const
 Sample a single vol field on all sample locations. More...
 
template<class Type >
tmp< Field< Type > > sampleSurfaceFields (const word &fieldName) const
 Sample a single scalar field on all sample locations. More...
 
template<class Type >
tmp< Field< Type > > sample (const GeometricField< Type, fvsPatchField, surfaceMesh > &) const
 Sample a surface field at all locations. More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sample (const GeometricField< Type, fvPatchField, volMesh > &vField) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sample (const word &fieldName) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sample (const GeometricField< Type, fvsPatchField, surfaceMesh > &sField) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sampleSurfaceFields (const word &fieldName) 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)
 

Protected Member Functions

void clearFieldGroups ()
 Clear old field groups. More...
 
label appendFieldGroup (const word &fieldName, const word &fieldType)
 Append fieldName to the appropriate group. More...
 
label classifyFields ()
 Classify field types, returns the number of fields. More...
 
virtual void findElements (const fvMesh &)
 Find cells and faces containing probes. More...
 
label prepare ()
 Classify field type and Open/close file streams,. More...
 
void readDict (const dictionary &dict)
 Read dictionary settings. More...
 

Protected Attributes

const word name_
 Name of this set of probes,. More...
 
const fvMeshmesh_
 Const reference to fvMesh. More...
 
const bool loadFromFiles_
 Load fields from files (not from objectRegistry) More...
 
wordReList fieldSelection_
 Names of fields to probe. More...
 
bool fixedLocations_
 Fixed locations, default = yes. More...
 
word interpolationScheme_
 Interpolation scheme name. More...
 
fieldGroup< scalar > scalarFields_
 Categorized scalar/vector/tensor vol fields. More...
 
fieldGroup< vectorvectorFields_
 
fieldGroup< sphericalTensorsphericalTensorFields_
 
fieldGroup< symmTensorsymmTensorFields_
 
fieldGroup< tensortensorFields_
 
fieldGroup< scalar > surfaceScalarFields_
 Categorized scalar/vector/tensor surf fields. More...
 
fieldGroup< vectorsurfaceVectorFields_
 
fieldGroup< sphericalTensorsurfaceSphericalTensorFields_
 
fieldGroup< symmTensorsurfaceSymmTensorFields_
 
fieldGroup< tensorsurfaceTensorFields_
 
labelList elementList_
 
labelList faceList_
 
HashPtrTable< OFstreamprobeFilePtrs_
 Current open files. More...
 

Private Member Functions

template<class Type >
void sampleAndWrite (const GeometricField< Type, fvPatchField, volMesh > &)
 Sample and write a particular volume field. More...
 
template<class Type >
void sampleAndWrite (const GeometricField< Type, fvsPatchField, surfaceMesh > &)
 Sample and write a particular surface field. More...
 
template<class Type >
void sampleAndWrite (const fieldGroup< Type > &)
 Sample and write all the fields of the given type. More...
 
template<class Type >
void sampleAndWriteSurfaceFields (const fieldGroup< Type > &)
 Sample and write all the surface fields of the given type. More...
 
 probes (const probes &)
 Disallow default bitwise copy construct. More...
 
void operator= (const probes &)
 Disallow default bitwise assignment. More...
 

Additional Inherited Members

- Public Types inherited from Field
typedef pTraits< Type >::cmptType cmptType
 Component type. More...
 
typedef SubField< Type > subField
 Declare type of subField. 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 inherited from Field
static const char *const typeName
 

Detailed Description

Set of locations to sample.

Call write() to sample and write files.

Example of function object specification:

probes
{
    type            probes;
    functionObjectLibs ( "libsampling.so" );

    // Name of the directory for probe data
    name            probes;

    // Write at same frequency as fields
    outputControl   outputTime;
    outputInterval  1;

    // Fields to be probed
    fields
    (
        p U
    );

    // Optional: do not recalculate cells if mesh moves
    fixedLocations  false;

    // Optional: interpolation scheme to use (default is cell)
    interpolationScheme cellPoint;

    probeLocations
    (
        ( 1e-06 0 0.01 )      // at inlet
        (0.21 -0.20999 0.01)  // at outlet1
        (0.21 0.20999 0.01)   // at outlet2
        (0.21 0 0.01)         // at central block
    );
}
Source files

Definition at line 102 of file probes.H.

Constructor & Destructor Documentation

◆ probes() [1/2]

probes ( const probes )
private

Disallow default bitwise copy construct.

◆ probes() [2/2]

probes ( const word name,
const objectRegistry obr,
const dictionary dict,
const bool  loadFromFiles = false,
const bool  findElements = true 
)

Construct for given objectRegistry and dictionary.

Allow the possibility to load fields from files

Definition at line 288 of file probes.C.

References dict.

◆ ~probes()

~probes ( )
virtual

Destructor.

Definition at line 321 of file probes.C.

Member Function Documentation

◆ clearFieldGroups()

void clearFieldGroups ( )
protected

◆ appendFieldGroup()

Foam::label appendFieldGroup ( const word fieldName,
const word fieldType 
)
protected

Append fieldName to the appropriate group.

Definition at line 51 of file probesGrouping.C.

◆ classifyFields()

Foam::label classifyFields ( )
protected

Classify field types, returns the number of fields.

Definition at line 111 of file probesGrouping.C.

References Foam::findStrings(), forAll, and IOobjectList::sortedNames().

Here is the call graph for this function:

◆ findElements()

void findElements ( const fvMesh mesh)
protectedvirtual

Find cells and faces containing probes.

Reimplemented in patchProbes.

Definition at line 43 of file probes.C.

References List::clear(), probes::elementList_, Foam::endl(), probes::faceList_, forAll, Foam::Info, Foam::mag(), UPstream::master(), mesh, UPstream::myProcNo(), Foam::Pout, Foam::reduce(), List::setSize(), and WarningInFunction.

Here is the call graph for this function:

◆ prepare()

Foam::label prepare ( )
protected

Classify field type and Open/close file streams,.

returns number of fields to sample

Definition at line 158 of file probes.C.

References IOstream::defaultPrecision(), polyMesh::defaultRegion, Foam::endl(), HashTable::erase(), forAll, forAllConstIter(), forAllIter, Foam::Info, HashSet< Key, Hash >::insert(), UPstream::master(), Foam::mkDir(), OFstream::name(), fileName::name(), Foam::nl, UPstream::parRun(), fileName::path(), Foam::setw(), and w().

Here is the call graph for this function:

◆ readDict()

void readDict ( const dictionary dict)
protected

Read dictionary settings.

Definition at line 266 of file probes.C.

References dict, dictionary::lookup(), dictionary::readIfPresent(), and WarningInFunction.

Referenced by patchProbes::readDict().

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

◆ sampleAndWrite() [1/3]

void sampleAndWrite ( const GeometricField< Type, fvPatchField, volMesh > &  vField)
private

Sample and write a particular volume field.

Definition at line 69 of file probesTemplates.C.

References Foam::endl(), forAll, Foam::setw(), and w().

Referenced by probes::sampleAndWrite().

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

◆ sampleAndWrite() [2/3]

void sampleAndWrite ( const GeometricField< Type, fvsPatchField, surfaceMesh > &  sField)
private

Sample and write a particular surface field.

Definition at line 93 of file probesTemplates.C.

References Foam::endl(), forAll, Foam::setw(), and w().

Here is the call graph for this function:

◆ sampleAndWrite() [3/3]

void sampleAndWrite ( const fieldGroup< Type > &  fields)
private

◆ sampleAndWriteSurfaceFields()

void sampleAndWriteSurfaceFields ( const fieldGroup< Type > &  fields)
private

Sample and write all the surface fields of the given type.

Definition at line 165 of file probesTemplates.C.

References HashTable< regIOobject * >::const_iterator, fields, forAll, IOobject::MUST_READ, IOobject::NO_WRITE, and Foam::type().

Here is the call graph for this function:

◆ operator=()

void operator= ( const probes )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "probes"  )

Runtime type information.

◆ name()

virtual const word& name ( ) const
inlinevirtual

Return name of the set of probes.

Definition at line 259 of file probes.H.

References probes::name_.

◆ fieldNames()

virtual const wordReList& fieldNames ( ) const
inlinevirtual

Return names of fields to probe.

Definition at line 265 of file probes.H.

References probes::fieldSelection_.

◆ probeLocations()

virtual const pointField& probeLocations ( ) const
inlinevirtual

Return locations to probe.

Definition at line 271 of file probes.H.

Referenced by patchProbes::findElements().

Here is the caller graph for this function:

◆ probe()

virtual const point& probe ( const label  i) const
inlinevirtual

Return location for probe i.

Definition at line 277 of file probes.H.

◆ elements()

const labelList& elements ( ) const
inline

Cells to be probed (obtained from the locations)

Definition at line 283 of file probes.H.

References probes::elementList_.

◆ execute()

void execute ( )
virtual

Execute, currently does nothing.

Definition at line 327 of file probes.C.

◆ end()

void end ( )
virtual

Execute at the final time-loop, currently does nothing.

Definition at line 333 of file probes.C.

◆ timeSet()

void timeSet ( )
virtual

Called when time was set at the end of the Time::operator++.

Definition at line 339 of file probes.C.

◆ write()

void write ( )
virtual

Sample and write.

Reimplemented in patchProbes.

Definition at line 345 of file probes.C.

◆ read()

void read ( const dictionary dict)
virtual

Read the probes.

Reimplemented in patchProbes.

Definition at line 364 of file probes.C.

References dict, dictionary::readIfPresent(), and WarningInFunction.

Here is the call graph for this function:

◆ updateMesh()

void updateMesh ( const mapPolyMesh mpm)
virtual

Update for changes of mesh.

Definition at line 389 of file probes.C.

References DynamicList::append(), Foam::endl(), forAll, Foam::Info, mapPolyMesh::reverseCellMap(), and mapPolyMesh::reverseFaceMap().

Here is the call graph for this function:

◆ movePoints()

void movePoints ( const polyMesh )
virtual

Update for changes of mesh.

Definition at line 482 of file probes.C.

References Foam::endl(), and Foam::Info.

Here is the call graph for this function:

◆ readUpdate()

virtual void readUpdate ( const polyMesh::readUpdateState  state)
inlinevirtual

Update for changes of mesh due to readUpdate.

Definition at line 310 of file probes.H.

◆ sample() [1/6]

tmp<Field<Type> > sample ( const GeometricField< Type, fvPatchField, volMesh > &  ) const

Sample a volume field at all locations.

◆ sample() [2/6]

tmp<Field<Type> > sample ( const word fieldName) const

Sample a single vol field on all sample locations.

◆ sampleSurfaceFields() [1/2]

tmp<Field<Type> > sampleSurfaceFields ( const word fieldName) const

Sample a single scalar field on all sample locations.

◆ sample() [3/6]

tmp<Field<Type> > sample ( const GeometricField< Type, fvsPatchField, surfaceMesh > &  ) const

Sample a surface field at all locations.

◆ sample() [4/6]

Foam::tmp<Foam::Field<Type> > sample ( const GeometricField< Type, fvPatchField, volMesh > &  vField) const

Definition at line 217 of file probesTemplates.C.

References forAll, Pstream::listCombineGather(), and Pstream::listCombineScatter().

Here is the call graph for this function:

◆ sample() [5/6]

Foam::tmp<Foam::Field<Type> > sample ( const word fieldName) const

Definition at line 272 of file probesTemplates.C.

◆ sample() [6/6]

Foam::tmp<Foam::Field<Type> > sample ( const GeometricField< Type, fvsPatchField, surfaceMesh > &  sField) const

Definition at line 287 of file probesTemplates.C.

References forAll, Pstream::listCombineGather(), and Pstream::listCombineScatter().

Here is the call graph for this function:

◆ sampleSurfaceFields() [2/2]

Foam::tmp<Foam::Field<Type> > sampleSurfaceFields ( const word fieldName) const

Definition at line 317 of file probesTemplates.C.

Field Documentation

◆ name_

const word name_
protected

Name of this set of probes,.

Also used as the name of the probes directory.

Definition at line 129 of file probes.H.

Referenced by probes::name().

◆ mesh_

const fvMesh& mesh_
protected

Const reference to fvMesh.

Definition at line 132 of file probes.H.

Referenced by patchProbes::sample(), and probes::sampleAndWrite().

◆ loadFromFiles_

const bool loadFromFiles_
protected

Load fields from files (not from objectRegistry)

Definition at line 135 of file probes.H.

Referenced by probes::sampleAndWrite().

◆ fieldSelection_

wordReList fieldSelection_
protected

Names of fields to probe.

Definition at line 141 of file probes.H.

Referenced by probes::fieldNames().

◆ fixedLocations_

bool fixedLocations_
protected

Fixed locations, default = yes.

Note: set to false for moving mesh calculations where locations should move with the mesh

Definition at line 146 of file probes.H.

◆ interpolationScheme_

word interpolationScheme_
protected

Interpolation scheme name.

Note: only possible when fixedLocations_ is true

Definition at line 150 of file probes.H.

◆ scalarFields_

fieldGroup<scalar> scalarFields_
protected

Categorized scalar/vector/tensor vol fields.

Definition at line 156 of file probes.H.

Referenced by probes::clearFieldGroups().

◆ vectorFields_

fieldGroup<vector> vectorFields_
protected

Definition at line 157 of file probes.H.

Referenced by probes::clearFieldGroups().

◆ sphericalTensorFields_

fieldGroup<sphericalTensor> sphericalTensorFields_
protected

Definition at line 158 of file probes.H.

Referenced by probes::clearFieldGroups().

◆ symmTensorFields_

fieldGroup<symmTensor> symmTensorFields_
protected

Definition at line 159 of file probes.H.

Referenced by probes::clearFieldGroups().

◆ tensorFields_

fieldGroup<tensor> tensorFields_
protected

Definition at line 160 of file probes.H.

Referenced by probes::clearFieldGroups().

◆ surfaceScalarFields_

fieldGroup<scalar> surfaceScalarFields_
protected

Categorized scalar/vector/tensor surf fields.

Definition at line 163 of file probes.H.

Referenced by probes::clearFieldGroups().

◆ surfaceVectorFields_

fieldGroup<vector> surfaceVectorFields_
protected

Definition at line 164 of file probes.H.

Referenced by probes::clearFieldGroups().

◆ surfaceSphericalTensorFields_

fieldGroup<sphericalTensor> surfaceSphericalTensorFields_
protected

Definition at line 165 of file probes.H.

Referenced by probes::clearFieldGroups().

◆ surfaceSymmTensorFields_

fieldGroup<symmTensor> surfaceSymmTensorFields_
protected

Definition at line 166 of file probes.H.

Referenced by probes::clearFieldGroups().

◆ surfaceTensorFields_

fieldGroup<tensor> surfaceTensorFields_
protected

Definition at line 167 of file probes.H.

Referenced by probes::clearFieldGroups().

◆ elementList_

labelList elementList_
protected

Definition at line 170 of file probes.H.

Referenced by probes::elements(), patchProbes::findElements(), and probes::findElements().

◆ faceList_

labelList faceList_
protected

Definition at line 173 of file probes.H.

Referenced by patchProbes::findElements(), and probes::findElements().

◆ probeFilePtrs_

HashPtrTable<OFstream> probeFilePtrs_
protected

Current open files.

Definition at line 176 of file probes.H.


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