Public Member Functions | Private Member Functions | Private Attributes
calcFvcGrad Class Reference

This function object calculates the gradient of a field. The operation is limited to scalar and vector volume or surface fields, and the output is a volume vector or tensor field. More...

Collaboration diagram for calcFvcGrad:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("calcFvcGrad")
 Runtime type information. More...
 
 calcFvcGrad (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false)
 Construct for given objectRegistry and dictionary. More...
 
virtual ~calcFvcGrad ()
 Destructor. More...
 
virtual const wordname () const
 Return name of the set of calcFvcGrad. More...
 
virtual void read (const dictionary &)
 Read the calcFvcGrad data. 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 ()
 Calculate the calcFvcGrad and write. More...
 
virtual void updateMesh (const mapPolyMesh &)
 Update for changes of mesh. More...
 
virtual void movePoints (const polyMesh &)
 Update for changes of mesh. More...
 
template<class Type >
Foam::GeometricField< typename Foam::outerProduct< Foam::vector, Type >::type, Foam::fvPatchField, Foam::volMesh > & gradField (const word &gradName, const dimensionSet &dims)
 

Private Member Functions

template<class Type >
GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > & gradField (const word &gradName, const dimensionSet &dims)
 Helper function to create/store/return the gradient field. More...
 
template<class Type >
void calcGrad (const word &fieldName, const word &resultName, bool &processed)
 Helper function to calculate the gradient of different field types. More...
 
 calcFvcGrad (const calcFvcGrad &)
 Disallow default bitwise copy construct. More...
 
void operator= (const calcFvcGrad &)
 Disallow default bitwise assignment. More...
 

Private Attributes

word name_
 Name of this calcFvcGrad object. More...
 
const objectRegistryobr_
 Reference to the database. More...
 
bool active_
 On/off switch. More...
 
word fieldName_
 Name of field to process. More...
 
word resultName_
 Name of result field. More...
 
Switch log_
 Switch to send output to Info as well as to file. More...
 

Detailed Description

This function object calculates the gradient of a field. The operation is limited to scalar and vector volume or surface fields, and the output is a volume vector or tensor field.

Example of function object specification:

calcFvcGrad1
{
    type        calcFvcGrad;
    functionObjectLibs ("libFVFunctionObjects.so");
    ...
    fieldName   U;
}


Function object usage

Property Description Required Default value
type type name: calcFvcGrad yes
fieldName Name of field to process yes
resultName Name of gradient field no fvc::grad(fieldName)
log Log to standard output no yes
Source files

Definition at line 110 of file calcFvcGrad.H.

Constructor & Destructor Documentation

◆ calcFvcGrad() [1/2]

calcFvcGrad ( const calcFvcGrad )
private

Disallow default bitwise copy construct.

◆ calcFvcGrad() [2/2]

calcFvcGrad ( 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 42 of file calcFvcGrad.C.

References dict, Foam::endl(), Foam::nl, Foam::read(), and WarningInFunction.

Here is the call graph for this function:

◆ ~calcFvcGrad()

~calcFvcGrad ( )
virtual

Destructor.

Definition at line 71 of file calcFvcGrad.C.

Member Function Documentation

◆ gradField() [1/2]

GeometricField< typename outerProduct<vector, Type>::type, fvPatchField, volMesh >& gradField ( const word gradName,
const dimensionSet dims 
)
private

Helper function to create/store/return the gradient field.

◆ calcGrad()

void calcGrad ( const word fieldName,
const word resultName,
bool &  processed 
)
private

Helper function to calculate the gradient of different field types.

Definition at line 82 of file calcFvcGradTemplates.C.

References objectRegistry::foundObject(), Foam::fvc::grad(), objectRegistry::lookupObject(), mesh, and sf().

Here is the call graph for this function:

◆ operator=()

void operator= ( const calcFvcGrad )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "calcFvcGrad"  )

Runtime type information.

◆ name()

virtual const word& name ( ) const
inlinevirtual

Return name of the set of calcFvcGrad.

Definition at line 187 of file calcFvcGrad.H.

References calcFvcGrad::name_.

◆ read()

void read ( const dictionary dict)
virtual

Read the calcFvcGrad data.

Definition at line 77 of file calcFvcGrad.C.

References dict, dictionary::lookup(), word::null, and dictionary::readIfPresent().

Here is the call graph for this function:

◆ execute()

void execute ( )
virtual

Execute, currently does nothing.

Definition at line 94 of file calcFvcGrad.C.

References Foam::endl(), and WarningInFunction.

Here is the call graph for this function:

◆ end()

void end ( )
virtual

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

Definition at line 112 of file calcFvcGrad.C.

◆ timeSet()

void timeSet ( )
virtual

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

Definition at line 118 of file calcFvcGrad.C.

◆ write()

void write ( )
virtual

Calculate the calcFvcGrad and write.

Definition at line 124 of file calcFvcGrad.C.

References Foam::endl(), Foam::Info, IOobject::name(), Foam::nl, Foam::type(), and regIOobject::write().

Here is the call graph for this function:

◆ updateMesh()

virtual void updateMesh ( const mapPolyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 208 of file calcFvcGrad.H.

◆ movePoints()

virtual void movePoints ( const polyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 212 of file calcFvcGrad.H.

◆ gradField() [2/2]

Foam::GeometricField< typename Foam::outerProduct<Foam::vector, Type>::type, Foam::fvPatchField, Foam::volMesh>& gradField ( const word gradName,
const dimensionSet dims 
)

Definition at line 38 of file calcFvcGradTemplates.C.

References Foam::dimLength, Foam::endl(), Foam::Info, mesh, IOobject::NO_READ, IOobject::NO_WRITE, and calcFvcGrad::obr_.

Here is the call graph for this function:

Field Documentation

◆ name_

word name_
private

Name of this calcFvcGrad object.

Definition at line 115 of file calcFvcGrad.H.

Referenced by calcFvcGrad::name().

◆ obr_

const objectRegistry& obr_
private

Reference to the database.

Definition at line 118 of file calcFvcGrad.H.

Referenced by calcFvcGrad::gradField().

◆ active_

bool active_
private

On/off switch.

Definition at line 121 of file calcFvcGrad.H.

◆ fieldName_

word fieldName_
private

Name of field to process.

Definition at line 124 of file calcFvcGrad.H.

◆ resultName_

word resultName_
private

Name of result field.

Definition at line 127 of file calcFvcGrad.H.

◆ log_

Switch log_
private

Switch to send output to Info as well as to file.

Definition at line 130 of file calcFvcGrad.H.


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