mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
functionObjects: Further simplification and rationalization using the fvMeshFunctionObject base-class
This commit is contained in:
@ -103,18 +103,12 @@ Foam::functionObjects::fieldMinMax::fieldMinMax
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
regionFunctionObject(name, runTime, dict),
|
||||
fvMeshFunctionObject(name, runTime, dict),
|
||||
logFiles(obr_, name),
|
||||
location_(true),
|
||||
mode_(mdMag),
|
||||
fieldSet_()
|
||||
{
|
||||
if (!isA<fvMesh>(obr_))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "objectRegistry is not an fvMesh" << exit(FatalError);
|
||||
}
|
||||
|
||||
read(dict);
|
||||
resetName(typeName);
|
||||
}
|
||||
@ -130,7 +124,7 @@ Foam::functionObjects::fieldMinMax::~fieldMinMax()
|
||||
|
||||
bool Foam::functionObjects::fieldMinMax::read(const dictionary& dict)
|
||||
{
|
||||
regionFunctionObject::read(dict);
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
location_ = dict.lookupOrDefault<Switch>("location", true);
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ Usage
|
||||
Output data is written to the file \<timeDir\>/fieldMinMax.dat
|
||||
|
||||
See also
|
||||
Foam::functionObjects::regionFunctionObject
|
||||
Foam::functionObjects::fvMeshFunctionObject
|
||||
Foam::functionObjects::logFiles
|
||||
|
||||
SourceFiles
|
||||
@ -78,7 +78,7 @@ SourceFiles
|
||||
#ifndef functionObjects_fieldMinMax_H
|
||||
#define functionObjects_fieldMinMax_H
|
||||
|
||||
#include "regionFunctionObject.H"
|
||||
#include "fvMeshFunctionObject.H"
|
||||
#include "logFiles.H"
|
||||
#include "vector.H"
|
||||
|
||||
@ -95,7 +95,7 @@ namespace functionObjects
|
||||
|
||||
class fieldMinMax
|
||||
:
|
||||
public regionFunctionObject,
|
||||
public fvMeshFunctionObject,
|
||||
public logFiles
|
||||
{
|
||||
public:
|
||||
|
||||
@ -109,10 +109,9 @@ void Foam::functionObjects::fieldMinMax::calcMinMaxFields
|
||||
const label proci = Pstream::myProcNo();
|
||||
|
||||
const fieldType& field = obr_.lookupObject<fieldType>(fieldName);
|
||||
const fvMesh& mesh = field.mesh();
|
||||
|
||||
const volVectorField::Boundary& CfBoundary =
|
||||
mesh.C().boundaryField();
|
||||
mesh_.C().boundaryField();
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
@ -126,7 +125,7 @@ void Foam::functionObjects::fieldMinMax::calcMinMaxFields
|
||||
List<vector> minCs(Pstream::nProcs());
|
||||
label minProci = findMin(magField);
|
||||
minVs[proci] = magField[minProci];
|
||||
minCs[proci] = field.mesh().C()[minProci];
|
||||
minCs[proci] = mesh_.C()[minProci];
|
||||
|
||||
|
||||
labelList maxIs(Pstream::nProcs());
|
||||
@ -134,7 +133,7 @@ void Foam::functionObjects::fieldMinMax::calcMinMaxFields
|
||||
List<vector> maxCs(Pstream::nProcs());
|
||||
label maxProci = findMax(magField);
|
||||
maxVs[proci] = magField[maxProci];
|
||||
maxCs[proci] = field.mesh().C()[maxProci];
|
||||
maxCs[proci] = mesh_.C()[maxProci];
|
||||
|
||||
forAll(magFieldBoundary, patchi)
|
||||
{
|
||||
@ -198,7 +197,7 @@ void Foam::functionObjects::fieldMinMax::calcMinMaxFields
|
||||
List<vector> minCs(Pstream::nProcs());
|
||||
label minProci = findMin(field);
|
||||
minVs[proci] = field[minProci];
|
||||
minCs[proci] = field.mesh().C()[minProci];
|
||||
minCs[proci] = mesh_.C()[minProci];
|
||||
|
||||
Pstream::gatherList(minVs);
|
||||
Pstream::gatherList(minCs);
|
||||
@ -207,7 +206,7 @@ void Foam::functionObjects::fieldMinMax::calcMinMaxFields
|
||||
List<vector> maxCs(Pstream::nProcs());
|
||||
label maxProci = findMax(field);
|
||||
maxVs[proci] = field[maxProci];
|
||||
maxCs[proci] = field.mesh().C()[maxProci];
|
||||
maxCs[proci] = mesh_.C()[maxProci];
|
||||
|
||||
forAll(fieldBoundary, patchi)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user