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

Set of sets to sample. Call sampledSets.write() to sample&write files. More...

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

Data Structures

class  fieldGroup
 Class used for grouping field types. More...
 
class  volFieldSampler
 Class used for sampling volFields. More...
 

Public Member Functions

 TypeName ("sets")
 Runtime type information. More...
 
 sampledSets (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false)
 Construct for given objectRegistry and dictionary. More...
 
virtual ~sampledSets ()
 Destructor. 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 sampledSets. More...
 
void correct ()
 Correct for mesh changes. More...
 
virtual void updateMesh (const mapPolyMesh &)
 Update for changes of mesh. More...
 
virtual void movePoints (const polyMesh &)
 Update for mesh point-motion. More...
 
virtual void readUpdate (const polyMesh::readUpdateState state)
 Update for changes of mesh due to readUpdate. 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< sampledSet >
 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...
 

Private 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...
 
void combineSampledSets (PtrList< coordSet > &masterSampledSets, labelListList &indexSets)
 Combine points from all processors. Sort by curveDist and produce. More...
 
template<class T >
void combineSampledValues (const PtrList< volFieldSampler< T > > &sampledFields, const labelListList &indexSets, PtrList< volFieldSampler< T > > &masterFields)
 Combine values from all processors. More...
 
template<class Type >
void writeSampleFile (const coordSet &masterSampleSet, const PtrList< volFieldSampler< Type > > &masterFields, const label setI, const fileName &timeDir, const writer< Type > &formatter)
 
template<class Type >
void sampleAndWrite (fieldGroup< Type > &fields)
 
 sampledSets (const sampledSets &)
 Disallow default bitwise copy construct and assignment. More...
 
void operator= (const sampledSets &)
 

Private Attributes

const fvMeshmesh_
 Const reference to fvMesh. More...
 
dictionary dict_
 Keep the dictionary to recreate sets for moving mesh cases. More...
 
bool loadFromFiles_
 Load fields from files (not from objectRegistry) More...
 
fileName outputPath_
 Output path. More...
 
meshSearch searchEngine_
 Mesh search engine. More...
 
wordReList fieldSelection_
 Names of fields to sample. More...
 
word interpolationScheme_
 Interpolation scheme to use. More...
 
word writeFormat_
 Output format to use. More...
 
fieldGroup< scalar > scalarFields_
 
fieldGroup< vectorvectorFields_
 
fieldGroup< sphericalTensorsphericalTensorFields_
 
fieldGroup< symmTensorsymmTensorFields_
 
fieldGroup< tensortensorFields_
 
PtrList< coordSetmasterSampledSets_
 
labelListList indexSets_
 

Static Private Attributes

static bool verbose_ = false
 Output verbosity. More...
 

Additional Inherited Members

- Public Types inherited from PtrList< sampledSet >
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< sampledSet >
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< sampledSet >
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 sets to sample. Call sampledSets.write() to sample&write files.

Source files

Definition at line 60 of file sampledSets.H.

Constructor & Destructor Documentation

◆ sampledSets() [1/2]

sampledSets ( const sampledSets )
private

Disallow default bitwise copy construct and assignment.

◆ sampledSets() [2/2]

sampledSets ( 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 132 of file sampledSets.C.

References dict, and Foam::read().

Here is the call graph for this function:

◆ ~sampledSets()

~sampledSets ( )
virtual

Destructor.

Definition at line 167 of file sampledSets.C.

Member Function Documentation

◆ clearFieldGroups()

void clearFieldGroups ( )
private

◆ appendFieldGroup()

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

Append fieldName to the appropriate group.

Definition at line 44 of file sampledSetsGrouping.C.

◆ classifyFields()

Foam::label classifyFields ( )
private

Classify field types, returns the number of fields.

Definition at line 79 of file sampledSetsGrouping.C.

References Foam::endl(), Foam::findStrings(), forAll, List::size(), IOobjectList::sortedNames(), and WarningInFunction.

Here is the call graph for this function:

◆ combineSampledSets()

void combineSampledSets ( PtrList< coordSet > &  masterSampledSets,
labelListList indexSets 
)
private

Combine points from all processors. Sort by curveDist and produce.

index list. Valid result only on master processor.

Definition at line 46 of file sampledSets.C.

References coordSet::axis(), Foam::ListListOps::combine(), coordSet::curveDist(), Foam::endl(), forAll, SortableList::indices(), coordSet::name(), sampledSet::segments(), PtrList::set(), List::size(), and WarningInFunction.

Here is the call graph for this function:

◆ combineSampledValues()

void combineSampledValues ( const PtrList< volFieldSampler< T > > &  sampledFields,
const labelListList indexSets,
PtrList< volFieldSampler< T > > &  masterFields 
)
private

Combine values from all processors.

Valid result only on master processor.

Definition at line 178 of file sampledSetsTemplates.C.

References Foam::ListListOps::combine(), forAll, Foam::name(), and List::size().

Referenced by sampledSets::sampleAndWrite().

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

◆ writeSampleFile()

void writeSampleFile ( const coordSet masterSampleSet,
const PtrList< volFieldSampler< Type > > &  masterFields,
const label  setI,
const fileName timeDir,
const writer< Type > &  formatter 
)
private

Definition at line 126 of file sampledSetsTemplates.C.

References Foam::endl(), forAll, writer< Type >::getFileName(), OFstream::name(), IOstream::opened(), propsDict(), WarningInFunction, and writer< Type >::write().

Referenced by sampledSets::sampleAndWrite().

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

◆ sampleAndWrite()

void sampleAndWrite ( fieldGroup< Type > &  fields)
private

◆ operator=()

void operator= ( const sampledSets )
private

◆ TypeName()

TypeName ( "sets"  )

Runtime type information.

◆ verbose()

void verbose ( const bool  verbosity = true)

Set verbosity level.

Definition at line 173 of file sampledSets.C.

◆ execute()

void execute ( )
virtual

Execute, currently does nothing.

Definition at line 179 of file sampledSets.C.

◆ end()

void end ( )
virtual

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

Definition at line 185 of file sampledSets.C.

◆ timeSet()

void timeSet ( )
virtual

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

Definition at line 191 of file sampledSets.C.

◆ write()

void write ( )
virtual

Sample and write.

Definition at line 197 of file sampledSets.C.

References Foam::endl(), UPstream::master(), Foam::mkDir(), Foam::nl, and Foam::Pout.

Here is the call graph for this function:

◆ read()

void read ( const dictionary dict)
virtual

Read the sampledSets.

Definition at line 240 of file sampledSets.C.

References dict, Foam::endl(), forAll, dictionary::found(), Foam::Info, dictionary::lookup(), UPstream::master(), Foam::nl, and Foam::Pout.

Here is the call graph for this function:

◆ correct()

void correct ( )

Correct for mesh changes.

Definition at line 286 of file sampledSets.C.

◆ updateMesh()

void updateMesh ( const mapPolyMesh )
virtual

Update for changes of mesh.

Definition at line 304 of file sampledSets.C.

References correct().

Here is the call graph for this function:

◆ movePoints()

void movePoints ( const polyMesh )
virtual

Update for mesh point-motion.

Definition at line 310 of file sampledSets.C.

References correct().

Here is the call graph for this function:

◆ readUpdate()

void readUpdate ( const polyMesh::readUpdateState  state)
virtual

Update for changes of mesh due to readUpdate.

Definition at line 316 of file sampledSets.C.

References correct(), and polyMesh::UNCHANGED.

Here is the call graph for this function:

Field Documentation

◆ verbose_

bool verbose_ = false
staticprivate

Output verbosity.

Definition at line 152 of file sampledSets.H.

Referenced by sampledSets::sampleAndWrite().

◆ mesh_

const fvMesh& mesh_
private

Const reference to fvMesh.

Definition at line 158 of file sampledSets.H.

Referenced by sampledSets::sampleAndWrite().

◆ dict_

dictionary dict_
private

Keep the dictionary to recreate sets for moving mesh cases.

Definition at line 161 of file sampledSets.H.

◆ loadFromFiles_

bool loadFromFiles_
private

Load fields from files (not from objectRegistry)

Definition at line 164 of file sampledSets.H.

Referenced by sampledSets::sampleAndWrite().

◆ outputPath_

fileName outputPath_
private

Output path.

Definition at line 167 of file sampledSets.H.

Referenced by sampledSets::sampleAndWrite().

◆ searchEngine_

meshSearch searchEngine_
private

Mesh search engine.

Definition at line 170 of file sampledSets.H.

◆ fieldSelection_

wordReList fieldSelection_
private

Names of fields to sample.

Definition at line 176 of file sampledSets.H.

◆ interpolationScheme_

word interpolationScheme_
private

Interpolation scheme to use.

Definition at line 179 of file sampledSets.H.

Referenced by sampledSets::sampleAndWrite().

◆ writeFormat_

word writeFormat_
private

Output format to use.

Definition at line 182 of file sampledSets.H.

Referenced by sampledSets::sampleAndWrite().

◆ scalarFields_

fieldGroup<scalar> scalarFields_
private

Definition at line 187 of file sampledSets.H.

Referenced by sampledSets::clearFieldGroups().

◆ vectorFields_

fieldGroup<vector> vectorFields_
private

Definition at line 188 of file sampledSets.H.

Referenced by sampledSets::clearFieldGroups().

◆ sphericalTensorFields_

fieldGroup<sphericalTensor> sphericalTensorFields_
private

Definition at line 189 of file sampledSets.H.

Referenced by sampledSets::clearFieldGroups().

◆ symmTensorFields_

fieldGroup<symmTensor> symmTensorFields_
private

Definition at line 190 of file sampledSets.H.

Referenced by sampledSets::clearFieldGroups().

◆ tensorFields_

fieldGroup<tensor> tensorFields_
private

Definition at line 191 of file sampledSets.H.

Referenced by sampledSets::clearFieldGroups().

◆ masterSampledSets_

PtrList<coordSet> masterSampledSets_
private

Definition at line 196 of file sampledSets.H.

Referenced by sampledSets::sampleAndWrite().

◆ indexSets_

labelListList indexSets_
private

Definition at line 197 of file sampledSets.H.

Referenced by sampledSets::sampleAndWrite().


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