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

This function object calculates the magnitude of a field. The operation can be applied to any volume or surface fieldsm and the output is a volume or surface scalar field. More...

Collaboration diagram for calcMag:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("calcMag")
 Runtime type information. More...
 
 calcMag (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFiles=false)
 Construct for given objectRegistry and dictionary. More...
 
virtual ~calcMag ()
 Destructor. More...
 
virtual const wordname () const
 Return name of the set of calcMag. More...
 
virtual void read (const dictionary &)
 Read the calcMag 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 calcMag 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...
 

Private Member Functions

template<class FieldType >
FieldType & magField (const word &magName, const dimensionSet &dims)
 Helper function to create/store/return the mag field. More...
 
template<class Type >
void calc (const word &fieldName, const word &resultName, bool &processed)
 Helper function to calculate the magnitude of different field types. More...
 
 calcMag (const calcMag &)
 Disallow default bitwise copy construct. More...
 
void operator= (const calcMag &)
 Disallow default bitwise assignment. More...
 

Private Attributes

word name_
 Name of this calcMag 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 magnitude of a field. The operation can be applied to any volume or surface fieldsm and the output is a volume or surface scalar field.

Example of function object specification:

calcMag1
{
    type        calcMag;
    functionObjectLibs ("libFVFunctionObjects.so");
    ...
    fieldName   U;
}


Function object usage

Property Description Required Default value
type type name: calcMag yes
fieldName Name of field to process yes
resultName Name of magnitude field no mag(fieldName)
log Log to standard output no yes
Source files

Definition at line 109 of file calcMag.H.

Constructor & Destructor Documentation

◆ calcMag() [1/2]

calcMag ( const calcMag )
private

Disallow default bitwise copy construct.

◆ calcMag() [2/2]

calcMag ( 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 calcMag.C.

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

Here is the call graph for this function:

◆ ~calcMag()

~calcMag ( )
virtual

Destructor.

Definition at line 71 of file calcMag.C.

Member Function Documentation

◆ magField()

FieldType & magField ( const word magName,
const dimensionSet dims 
)
private

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

Definition at line 33 of file calcMagTemplates.C.

References f(), and mesh.

Here is the call graph for this function:

◆ calc()

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

Helper function to calculate the magnitude of different field types.

Definition at line 72 of file calcMagTemplates.C.

References Foam::mag(), mesh, and sf().

Here is the call graph for this function:

◆ operator=()

void operator= ( const calcMag )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "calcMag"  )

Runtime type information.

◆ name()

virtual const word& name ( ) const
inlinevirtual

Return name of the set of calcMag.

Definition at line 180 of file calcMag.H.

References calcMag::name_.

◆ read()

void read ( const dictionary dict)
virtual

Read the calcMag data.

Definition at line 77 of file calcMag.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 calcMag.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 115 of file calcMag.C.

◆ timeSet()

void timeSet ( )
virtual

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

Definition at line 121 of file calcMag.C.

◆ write()

void write ( )
virtual

Calculate the calcMag and write.

Definition at line 127 of file calcMag.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 201 of file calcMag.H.

◆ movePoints()

virtual void movePoints ( const polyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 205 of file calcMag.H.

Field Documentation

◆ name_

word name_
private

Name of this calcMag object.

Definition at line 114 of file calcMag.H.

Referenced by calcMag::name().

◆ obr_

const objectRegistry& obr_
private

Reference to the database.

Definition at line 117 of file calcMag.H.

◆ active_

bool active_
private

On/off switch.

Definition at line 120 of file calcMag.H.

◆ fieldName_

word fieldName_
private

Name of field to process.

Definition at line 123 of file calcMag.H.

◆ resultName_

word resultName_
private

Name of result field.

Definition at line 126 of file calcMag.H.

◆ log_

Switch log_
private

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

Definition at line 129 of file calcMag.H.


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