Zonal< DimensionedFieldType > Class Template Reference

Zonal internal and patch field initialisation function. More...

Inheritance diagram for Zonal< DimensionedFieldType >:
Collaboration diagram for Zonal< DimensionedFieldType >:

Public Member Functions

 TypeName ("zonal")
 Runtime type information. More...
 
 Zonal (const dictionary &dict, DimensionedFieldType &field)
 Construct with dictionary to initialise given field. More...
 
 Zonal (const Zonal &dff, DimensionedFieldType &field)
 Construct a copy for the given field. More...
 
virtual autoPtr< DimensionedFieldFunction< DimensionedFieldType > > clone (DimensionedFieldType &field) const
 Construct and return a clone for the specified field. More...
 
virtual ~Zonal ()
 Destructor. More...
 
virtual void evaluate ()
 Evaluate the function and set the field. More...
 
virtual void write (Ostream &os) const
 Write data to dictionary stream. More...
 
 TypeName ("zonal")
 Runtime type information. More...
 
 Zonal (const dictionary &dict, DimensionedFieldType &field)
 Construct with dictionary to initialise given field. More...
 
 Zonal (const Zonal &dff, DimensionedFieldType &field)
 Construct a copy for the given field. More...
 
virtual autoPtr< DimensionedFieldFunction< DimensionedFieldType > > clone (DimensionedFieldType &field) const
 Construct and return a clone for the specified field. More...
 
virtual ~Zonal ()
 Destructor. More...
 
virtual void evaluate ()
 Evaluate the function and set the field. More...
 
virtual void write (Ostream &os) const
 Write data to dictionary stream. More...
 
- Public Member Functions inherited from DimensionedFieldFunction< DimensionedFieldType >
 TypeName ("DimensionedFieldFunction")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, DimensionedFieldFunction, dictionary,(const dictionary &dict, DimensionedFieldType &field),(dict, field))
 
 DimensionedFieldFunction (const dictionary &dict, DimensionedFieldType &field)
 Construct with dictionary to initialise given field. More...
 
 DimensionedFieldFunction (const DimensionedFieldFunction &dff, DimensionedFieldType &field)
 Construct a copy for the given field. More...
 
 DimensionedFieldFunction (const DimensionedFieldFunction< DimensionedFieldType > &)=delete
 Disallow default bitwise copy construction. More...
 
virtual autoPtr< DimensionedFieldFunction< DimensionedFieldType > > clone () const
 Construct and return a clone for the specified field. More...
 
virtual ~DimensionedFieldFunction ()
 Destructor. More...
 
virtual bool update ()
 Update the field if the function has changed and return true. More...
 
virtual void reset ()
 Reset the field size. More...
 
void operator= (const DimensionedFieldFunction< DimensionedFieldType > &)=delete
 Disallow default bitwise assignment. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from DimensionedFieldFunction< DimensionedFieldType >
static autoPtr< DimensionedFieldFunction< DimensionedFieldType > > New (const dictionary &dict, DimensionedFieldType &field)
 Select null constructed. More...
 
- Protected Attributes inherited from DimensionedFieldFunction< DimensionedFieldType >
DimensionedFieldType & field_
 Reference to the field the function applies to. More...
 

Detailed Description

template<class DimensionedFieldType>
class Foam::DimensionedFieldFunctions::Zonal< DimensionedFieldType >

Zonal internal and patch field initialisation function.

The field is initialised to the given defaultValue and then updated to the value provided for each zone (cellZones for the internalField of volFields or faceZones for patchFields).

Usage
To set the water column in the alpha.water field for the damBreak cases specifying a default value of 0 and a value of 1 in a box cellZone:
internalField
{
    type        zonal;

    defaultValue    0;

    zones
    {
        waterColumn
        {
            type            box;

            box             (0 0 -1) (0.1461 0.292 1);

            value           1;
        }
    }
}

The value of inlet and other fixed value patch fields can be specified using DimensionedFieldFunctions::Zonal with the Foam::functionalFixedValue patch field. It is also possible to use the same zone specification as used for the internalField initialisation and filter it using the patch faceZone for efficiency, e.g.

internalField
{
    type        zonal;

    defaultValue    0;

    zones
    {
        water
        {
            type            box;
            box             (-999 -999 -999) (999 999 0.244);
            value           1;
        }
    }
}

boundaryField
{
    inlet
    {
        type            functionalFixedValue;

        value
        {
            $internalField;

            zones
            {
                water
                {
                    zone
                    {
                        type        patch;
                        patch       inlet;
                    }
                }
            }
        }
    }
    .
    .
    .
Source files

Source files

Definition at line 130 of file Zonal_DimensionedFieldFunction.H.

Constructor & Destructor Documentation

◆ Zonal() [1/4]

Zonal ( const dictionary dict,
DimensionedFieldType &  field 
)

Construct with dictionary to initialise given field.

Definition at line 33 of file Zonal_DimensionedFieldFunction.C.

◆ Zonal() [2/4]

Zonal ( const Zonal< DimensionedFieldType > &  dff,
DimensionedFieldType &  field 
)

Construct a copy for the given field.

Definition at line 54 of file Zonal_DimensionedFieldFunction.C.

◆ ~Zonal() [1/2]

virtual ~Zonal ( )
inlinevirtual

Destructor.

Definition at line 174 of file Zonal_DimensionedFieldFunction.H.

◆ Zonal() [3/4]

Zonal ( const dictionary dict,
DimensionedFieldType &  field 
)

Construct with dictionary to initialise given field.

◆ Zonal() [4/4]

Zonal ( const Zonal< DimensionedFieldType > &  dff,
DimensionedFieldType &  field 
)

Construct a copy for the given field.

◆ ~Zonal() [2/2]

virtual ~Zonal ( )
inlinevirtual

Destructor.

Definition at line 89 of file Zonal_DimensionedFvPatchFieldFunction.H.

Member Function Documentation

◆ TypeName() [1/2]

TypeName ( "zonal"  )

Runtime type information.

◆ clone() [1/2]

Foam::autoPtr< Foam::DimensionedFieldFunction< DimensionedFieldType > > clone ( DimensionedFieldType &  field) const
virtual

Construct and return a clone for the specified field.

Implements DimensionedFieldFunction< DimensionedFieldType >.

Definition at line 69 of file Zonal_DimensionedFieldFunction.C.

◆ evaluate() [1/2]

void evaluate
virtual

Evaluate the function and set the field.

Implements DimensionedFieldFunction< DimensionedFieldType >.

Definition at line 84 of file Zonal_DimensionedFieldFunction.C.

References forAll, forAllConstIter, dictionary::found(), dictionary::lookup(), mesh, zoneGenerator::New(), List< label >::null(), zoneSet::valid(), and zoneSet::zone().

Here is the call graph for this function:

◆ write() [1/2]

void write ( Ostream os) const
virtual

Write data to dictionary stream.

Implements DimensionedFieldFunction< DimensionedFieldType >.

Definition at line 145 of file Zonal_DimensionedFieldFunction.C.

References Foam::writeEntry().

Here is the call graph for this function:

◆ TypeName() [2/2]

TypeName ( "zonal"  )

Runtime type information.

◆ clone() [2/2]

virtual autoPtr<DimensionedFieldFunction<DimensionedFieldType> > clone ( DimensionedFieldType &  field) const
virtual

Construct and return a clone for the specified field.

Implements DimensionedFieldFunction< DimensionedFieldType >.

◆ evaluate() [2/2]

virtual void evaluate ( )
virtual

Evaluate the function and set the field.

Implements DimensionedFieldFunction< DimensionedFieldType >.

◆ write() [2/2]

virtual void write ( Ostream os) const
virtual

Write data to dictionary stream.

Implements DimensionedFieldFunction< DimensionedFieldType >.


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