Data Structures | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
sampledSurfaces Class Reference

Set of surfaces to sample. More...

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

Data Structures

class  mergeInfo
 Class used for surface merging information. More...
 

Public Member Functions

 TypeName ("surfaces")
 Runtime type information. More...
 
 sampledSurfaces (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false)
 Construct for given objectRegistry and dictionary. More...
 
virtual ~sampledSurfaces ()
 Destructor. More...
 
virtual bool needsUpdate () const
 Does any of the surfaces need an update? More...
 
virtual bool expire ()
 Mark the surfaces as needing an update. More...
 
virtual bool update ()
 Update the surfaces as required and merge surface points (parallel). More...
 
virtual const wordname () const
 Return name of the set of surfaces. More...
 
void verbose (const bool verbosity=true)
 Set verbosity level. 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 sampledSurfaces dictionary. More...
 
virtual void updateMesh (const mapPolyMesh &)
 Update for changes of mesh - expires the surfaces. More...
 
virtual void movePoints (const polyMesh &)
 Update for mesh point-motion - expires the surfaces. More...
 
virtual void readUpdate (const polyMesh::readUpdateState state)
 Update for changes of mesh due to readUpdate - expires the surfaces. More...
 
- Public Member Functions inherited from functionObjectState
 functionObjectState (const objectRegistry &obr, const word &name)
 Construct from components. More...
 
virtual ~functionObjectState ()
 Destructor. More...
 
const wordname () const
 Return the name. More...
 
bool active () const
 Return the active flag. More...
 
const IOdictionarystateDict () const
 Return access to the state dictionary. More...
 
dictionarypropertyDict ()
 Return access to the property dictionary. More...
 
template<class Type >
bool setActive ()
 Set the active status by querying objectRegistry type. More...
 
bool foundProperty (const word &entryName) const
 Return true if the property exists. More...
 
template<class Type >
Type getProperty (const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve generic property. More...
 
template<class Type >
void getProperty (const word &entryName, Type &value) const
 Retrieve generic property. More...
 
template<class Type >
void setProperty (const word &entryName, const Type &value)
 Add generic property. More...
 
template<class Type >
Type getObjectProperty (const word &objectName, const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve generic property from named object. More...
 
template<class Type >
void getObjectProperty (const word &objectName, const word &entryName, Type &value) const
 Retrieve generic property from named object. More...
 
template<class Type >
void setObjectProperty (const word &objectName, const word &entryName, const Type &value)
 Add generic property from named object. More...
 
template<class Type >
void setResult (const word &entryName, const Type &value)
 Add result. More...
 
template<class Type >
void setObjectResult (const word &objectName, const word &entryName, const Type &value)
 Add result from named object. More...
 
template<class Type >
Type getResult (const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve result. More...
 
template<class Type >
Type getObjectResult (const word &objectName, const word &entryName, const Type &defaultValue=pTraits< Type >::zero) const
 Retrieve result from named object. More...
 
template<class Type >
void getObjectResult (const word &objectName, const word &entryName, Type &value) const
 Retrieve result from named object. More...
 
word resultType (const word &entryName) const
 Retrieve the result type. More...
 
word objectResultType (const word &objectName, const word &entryName) const
 Return the type of result. More...
 
List< wordobjectResultEntries () const
 Retrieve the result entries. More...
 
List< wordobjectResultEntries (const word &objectName) const
 Return result entries for named object. More...
 
- Public Member Functions inherited from PtrList< sampledSurface >
 PtrList ()
 Null Constructor. More...
 
 PtrList (const label)
 Construct with size specified. More...
 
 PtrList (const PtrList< T > &)
 Copy constructor. More...
 
 PtrList (const PtrList< T > &, const CloneArg &)
 Copy constructor with additional argument for clone. More...
 
 PtrList (const Xfer< PtrList< T > > &)
 Construct by transferring the parameter contents. More...
 
 PtrList (PtrList< T > &, bool reUse)
 Construct as copy or re-use as specified. More...
 
 PtrList (const SLPtrList< T > &)
 Construct as copy of SLPtrList<T> More...
 
 PtrList (Istream &, const INew &)
 Construct from Istream using given Istream constructor class. More...
 
 PtrList (Istream &)
 Construct from Istream using default Istream constructor class. More...
 
 PtrList ()
 
 PtrList (const label s)
 
 PtrList (const PtrList< T > &a)
 
 PtrList (const Xfer< PtrList< T > > &lst)
 
 PtrList (PtrList< T > &a, bool reUse)
 
 PtrList (const SLPtrList< T > &sll)
 
 PtrList (Istream &is)
 
 ~PtrList ()
 Destructor. More...
 
label size () const
 Return the number of elements in the PtrList. More...
 
bool empty () const
 Return true if the PtrList is empty (ie, size() is zero). More...
 
Tfirst ()
 Return reference to the first element of the list. More...
 
const Tfirst () const
 Return reference to first element of the list. More...
 
Tlast ()
 Return reference to the last element of the list. More...
 
const Tlast () const
 Return reference to the last element of the list. More...
 
void setSize (const label)
 Reset size of PtrList. If extending the PtrList, new entries are. More...
 
void resize (const label)
 Alias for setSize(const label) More...
 
void clear ()
 Clear the PtrList, i.e. set size to zero deleting all the. More...
 
void append (T *)
 Append an element at the end of the list. More...
 
void append (const autoPtr< T > &)
 
void append (const tmp< T > &)
 
void transfer (PtrList< T > &)
 Transfer the contents of the argument PtrList into this PtrList. More...
 
Xfer< PtrList< T > > xfer ()
 Transfer contents to the Xfer container. More...
 
bool set (const label) const
 Is element set. More...
 
autoPtr< Tset (const label, T *)
 Set element. Return old element (can be NULL). More...
 
autoPtr< Tset (const label, const autoPtr< T > &)
 
autoPtr< Tset (const label, const tmp< T > &)
 
void reorder (const labelUList &)
 Reorders elements. Ordering does not have to be done in. More...
 
const Toperator[] (const label) const
 Return element const reference. More...
 
Toperator[] (const label)
 Return element reference. More...
 
const Toperator() (const label) const
 Return element const pointer. More...
 
PtrList< T > & operator= (const PtrList< T > &)
 Assignment. More...
 
iterator begin ()
 Return an iterator to begin traversing the PtrList. More...
 
const_iterator begin () const
 Return an const_iterator to begin traversing the PtrList. More...
 
iterator end ()
 Return an iterator to end traversing the PtrList. More...
 
const_iterator end () const
 Return an const_iterator to end traversing the PtrList. More...
 
const_iterator cbegin () const
 Return an const_iterator to begin traversing the PtrList. More...
 
const_iterator cend () const
 Return an const_iterator to end traversing the PtrList. More...
 

Static Public Member Functions

static scalar mergeTol ()
 Get merge tolerance. More...
 
static scalar mergeTol (const scalar)
 Set tolerance (and return old tolerance) More...
 

Private Member Functions

label classifyFields ()
 Return number of fields. More...
 
void writeGeometry () const
 Write geometry only. More...
 
template<class Type >
void writeSurface (const Field< Type > &values, const label surfI, const word &fieldName, const fileName &outputDir)
 Write sampled fieldName on surface and on outputDir path. More...
 
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 IOobjectList &objects)
 Sample and write all sampled fields. More...
 
 sampledSurfaces (const sampledSurfaces &)
 Disallow default bitwise copy construct and assignment. More...
 
void operator= (const sampledSurfaces &)
 

Private Attributes

const objectRegistryobr_
 Const reference to database. More...
 
const bool loadFromFiles_
 Load fields from files (not from objectRegistry) More...
 
fileName outputPath_
 Output path. More...
 
wordReList fieldSelection_
 Names of fields to sample. More...
 
word interpolationScheme_
 Interpolation scheme to use. More...
 
List< mergeInfomergeList_
 Information for merging surfaces. More...
 
autoPtr< surfaceWriterformatter_
 Surface formatter. More...
 

Static Private Attributes

static bool verbose_ = false
 Output verbosity. More...
 
static scalar mergeTol_ = 1e-10
 Tolerance for merging points (fraction of mesh bounding box) More...
 

Additional Inherited Members

- Public Types inherited from PtrList< sampledSurface >
typedef T value_type
 Type of values the PtrList contains. More...
 
typedef Treference
 Type that can be used for storing into PtrList::value_type objects. More...
 
- Data Fields inherited from PtrList< sampledSurface >
const typedef Tconst_reference
 Type that can be used for storing into constant PtrList::value_type. More...
 
- Protected Member Functions inherited from functionObjectState
 functionObjectState (const functionObjectState &)
 Disallow default bitwise copy construct. More...
 
void operator= (const functionObjectState &)
 Disallow default bitwise assignment. More...
 
- Protected Member Functions inherited from PtrList< sampledSurface >
void read (Istream &, const INew &inewt)
 Read from Istream using given Istream constructor class. More...
 
- Protected Attributes inherited from functionObjectState
const word name_
 Name of model. More...
 
bool active_
 Flag to indicate whether the object is active. More...
 
IOdictionarystateDict_
 Reference to the state dictionary. More...
 

Detailed Description

Set of surfaces to sample.

The write() method is used to sample and write files.

Source files

Definition at line 59 of file sampledSurfaces.H.

Constructor & Destructor Documentation

◆ sampledSurfaces() [1/2]

sampledSurfaces ( const sampledSurfaces )
private

Disallow default bitwise copy construct and assignment.

◆ sampledSurfaces() [2/2]

sampledSurfaces ( const word name,
const objectRegistry obr,
const dictionary dict,
const bool  loadFromFiles = false 
)

Construct for given objectRegistry and dictionary.

allow the possibility to load fields from files

Definition at line 88 of file sampledSurfaces.C.

References dict, UPstream::parRun(), and Foam::read().

Here is the call graph for this function:

◆ ~sampledSurfaces()

~sampledSurfaces ( )
virtual

Destructor.

Definition at line 126 of file sampledSurfaces.C.

Member Function Documentation

◆ classifyFields()

Foam::label classifyFields ( )
private

◆ writeGeometry()

void writeGeometry ( ) const
private

◆ writeSurface()

void writeSurface ( const Field< Type > &  values,
const label  surfI,
const word fieldName,
const fileName outputDir 
)
private

Write sampled fieldName on surface and on outputDir path.

Definition at line 36 of file sampledSurfacesTemplates.C.

References Foam::ListListOps::combine(), Foam::inplaceReorder(), points, propsDict(), and s().

Here is the call 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 119 of file sampledSurfacesTemplates.C.

References autoPtr::empty(), forAll, Foam::compressible::New(), and s().

Referenced by sampledSurfaces::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 160 of file sampledSurfacesTemplates.C.

References forAll, and s().

Here is the call graph for this function:

◆ sampleAndWrite() [3/3]

void sampleAndWrite ( const IOobjectList objects)
private

◆ operator=()

void operator= ( const sampledSurfaces )
private

◆ TypeName()

TypeName ( "surfaces"  )

Runtime type information.

◆ needsUpdate()

bool needsUpdate ( ) const
virtual

Does any of the surfaces need an update?

Definition at line 273 of file sampledSurfaces.C.

References forAll.

◆ expire()

bool expire ( )
virtual

Mark the surfaces as needing an update.

May also free up unneeded data. Return false if all surfaces were already marked as expired.

Definition at line 287 of file sampledSurfaces.C.

References forAll, and UPstream::parRun().

Here is the call graph for this function:

◆ update()

bool update ( )
virtual

Update the surfaces as required and merge surface points (parallel).

Return false if no surfaces required an update.

Definition at line 310 of file sampledSurfaces.C.

References polyMesh::bounds(), Foam::endl(), forAll, PatchTools::gatherAndMerge(), Foam::Info, boundBox::mag(), UPstream::master(), mesh, Foam::nl, UPstream::parRun(), PrimitivePatch< Face, FaceList, PointField, PointType >::points(), Foam::Pout, and s().

Here is the call graph for this function:

◆ name()

virtual const word& name ( ) const
inlinevirtual

Return name of the set of surfaces.

Definition at line 207 of file sampledSurfaces.H.

References functionObjectState::name_.

◆ verbose()

void verbose ( const bool  verbosity = true)

Set verbosity level.

Definition at line 132 of file sampledSurfaces.C.

◆ execute()

void execute ( )
virtual

Execute, currently does nothing.

Definition at line 138 of file sampledSurfaces.C.

◆ end()

void end ( )
virtual

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

Definition at line 144 of file sampledSurfaces.C.

◆ timeSet()

void timeSet ( )
virtual

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

Definition at line 150 of file sampledSurfaces.C.

◆ write()

void write ( )
virtual

Sample and write.

Definition at line 156 of file sampledSurfaces.C.

◆ read()

void read ( const dictionary dict)
virtual

◆ updateMesh()

void updateMesh ( const mapPolyMesh )
virtual

Update for changes of mesh - expires the surfaces.

Definition at line 250 of file sampledSurfaces.C.

◆ movePoints()

void movePoints ( const polyMesh )
virtual

Update for mesh point-motion - expires the surfaces.

Definition at line 258 of file sampledSurfaces.C.

◆ readUpdate()

void readUpdate ( const polyMesh::readUpdateState  state)
virtual

Update for changes of mesh due to readUpdate - expires the surfaces.

Definition at line 264 of file sampledSurfaces.C.

References polyMesh::UNCHANGED.

◆ mergeTol() [1/2]

Foam::scalar mergeTol ( )
static

Get merge tolerance.

Definition at line 377 of file sampledSurfaces.C.

◆ mergeTol() [2/2]

Foam::scalar mergeTol ( const scalar  tol)
static

Set tolerance (and return old tolerance)

Definition at line 383 of file sampledSurfaces.C.

Field Documentation

◆ verbose_

bool verbose_ = false
staticprivate

Output verbosity.

Definition at line 88 of file sampledSurfaces.H.

Referenced by sampledSurfaces::sampleAndWrite().

◆ mergeTol_

Foam::scalar mergeTol_ = 1e-10
staticprivate

Tolerance for merging points (fraction of mesh bounding box)

Definition at line 91 of file sampledSurfaces.H.

◆ obr_

const objectRegistry& obr_
private

Const reference to database.

Definition at line 97 of file sampledSurfaces.H.

Referenced by sampledSurfaces::classifyFields(), sampledSurfaces::sampleAndWrite(), and sampledSurfaces::writeGeometry().

◆ loadFromFiles_

const bool loadFromFiles_
private

Load fields from files (not from objectRegistry)

Definition at line 100 of file sampledSurfaces.H.

Referenced by sampledSurfaces::classifyFields(), and sampledSurfaces::sampleAndWrite().

◆ outputPath_

fileName outputPath_
private

Output path.

Definition at line 103 of file sampledSurfaces.H.

Referenced by sampledSurfaces::writeGeometry().

◆ fieldSelection_

wordReList fieldSelection_
private

Names of fields to sample.

Definition at line 109 of file sampledSurfaces.H.

Referenced by sampledSurfaces::classifyFields(), and sampledSurfaces::sampleAndWrite().

◆ interpolationScheme_

word interpolationScheme_
private

Interpolation scheme to use.

Definition at line 112 of file sampledSurfaces.H.

◆ mergeList_

List<mergeInfo> mergeList_
private

Information for merging surfaces.

Definition at line 118 of file sampledSurfaces.H.

Referenced by sampledSurfaces::writeGeometry().

◆ formatter_

autoPtr<surfaceWriter> formatter_
private

Surface formatter.

Definition at line 124 of file sampledSurfaces.H.

Referenced by sampledSurfaces::writeGeometry().


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