Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
patchProbes Class Reference

Set of locations to sample at patches. More...

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

Public Member Functions

 TypeName ("patchProbes")
 Runtime type information. More...
 
 patchProbes (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false, const bool findElements=true)
 Construct for given objectRegistry and dictionary. More...
 
virtual ~patchProbes ()
 Destructor. More...
 
virtual void write ()
 Public members. More...
 
virtual void read (const dictionary &)
 Read. 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
 
- Public Member Functions inherited from probes
 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 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

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...
 
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 GeometricField< Type, fvsPatchField, surfaceMesh > &) const
 Sample a surface field at all locations. More...
 
template<class Type >
tmp< Field< Type > > sample (const word &fieldName) const
 Sample a single field on all sample locations. More...
 
virtual void findElements (const fvMesh &)
 Find elements containing patchProbes. More...
 
void readDict (const dictionary &dict)
 Read dictionary settings. More...
 
- Protected Member Functions inherited from probes
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...
 
label prepare ()
 Classify field type and Open/close file streams,. More...
 
void readDict (const dictionary &dict)
 Read dictionary settings. More...
 

Protected Attributes

wordReList patchNames_
 Patches to sample. More...
 
- Protected Attributes inherited from probes
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

 patchProbes (const patchProbes &)
 Disallow default bitwise copy construct. More...
 
void operator= (const patchProbes &)
 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 at patches.

Call write() to sample and write files.

Example of function object specification:

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

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

    // Patches to sample (wildcards allowed)
    patches         (".*inl.*");

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

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

    // Locations to probe. These get snapped onto the nearest point
    // on the selected patches
    probeLocations
    (
        ( -100 0 0.01 )      // at inlet
    );
}
Source files

Definition at line 92 of file patchProbes.H.

Constructor & Destructor Documentation

◆ patchProbes() [1/2]

patchProbes ( const patchProbes )
private

Disallow default bitwise copy construct.

◆ patchProbes() [2/2]

patchProbes ( 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 221 of file patchProbes.C.

References dict.

◆ ~patchProbes()

~patchProbes ( )
virtual

Destructor.

Definition at line 246 of file patchProbes.C.

Member Function Documentation

◆ sampleAndWrite() [1/3]

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

Sample and write a particular volume field.

Definition at line 35 of file patchProbesTemplates.C.

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

Here is the call graph for this function:

◆ sampleAndWrite() [2/3]

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

Sample and write a particular surface field.

Definition at line 61 of file patchProbesTemplates.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)
protected

Sample and write all the fields of the given type.

Definition at line 87 of file patchProbesTemplates.C.

References fields, forAll, and Foam::type().

Here is the call graph for this function:

◆ sampleAndWriteSurfaceFields()

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

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

Definition at line 139 of file patchProbesTemplates.C.

References fields, forAll, and Foam::type().

Here is the call graph for this function:

◆ sample() [1/6]

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

Sample a volume field at all locations.

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

Here is the caller graph for this function:

◆ sample() [2/6]

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

Sample a surface field at all locations.

◆ sample() [3/6]

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

Sample a single field on all sample locations.

◆ findElements()

void findElements ( const fvMesh mesh)
protectedvirtual

◆ readDict()

void readDict ( const dictionary dict)
protected

Read dictionary settings.

Definition at line 207 of file patchProbes.C.

References dict, dictionary::lookup(), probes::readDict(), and dictionary::readIfPresent().

Here is the call graph for this function:

◆ operator=()

void operator= ( const patchProbes )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "patchProbes"  )

Runtime type information.

◆ write()

void write ( )
virtual

Public members.

Sample and write

Reimplemented from probes.

Definition at line 250 of file patchProbes.C.

◆ read()

void read ( const dictionary dict)
virtual

Read.

Reimplemented from probes.

Definition at line 269 of file patchProbes.C.

References dict.

◆ sample() [4/6]

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

Definition at line 194 of file patchProbesTemplates.C.

References GeometricField::boundaryField(), forAll, and patches.

Here is the call graph for this function:

◆ sample() [5/6]

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

Definition at line 230 of file patchProbesTemplates.C.

References objectRegistry::lookupObject(), probes::mesh_, and patchProbes::sample().

Here is the call graph for this function:

◆ sample() [6/6]

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

Definition at line 245 of file patchProbesTemplates.C.

References GeometricField::boundaryField(), forAll, Pstream::listCombineGather(), Pstream::listCombineScatter(), and patches.

Here is the call graph for this function:

Field Documentation

◆ patchNames_

wordReList patchNames_
protected

Patches to sample.

Definition at line 101 of file patchProbes.H.

Referenced by patchProbes::findElements().


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