Commit 83321bd4 authored by Henry Weller's avatar Henry Weller
Browse files

functionObjects: renamed faceSource -> surfaceRegion, cellSource -> volRegion

The use of the term 'source' in the context of post-processing is
confusing and does not properly describe the process of region
selection.  The new names 'surfaceRegion' and 'volRegion' better
describe the purpose of the functionObjects which is to provide field
processing functionality limited to a specified region of space, either
a surface or volume.

The keyword 'source' is renamed 'regionType' which better describes the
purpose which is to specify the method by which the surface or volume
region is selected.

The keyword to select the name of the surface or volume region is
renamed from 'sourceName' to 'name' consistent with the other
name-changes above.
parent e2336fef
......@@ -49,4 +49,4 @@ Current tools
- scalarTransport for plugin scalar transport calculations
- visualization post-processing VTK files for cutting planes, streamlines,...
- faceSource configuration for some of the tools above
- surfaceRegion configuration for some of the tools above
......@@ -6,7 +6,7 @@
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/flowRate/surfaceSource.cfg"
#includeEtc "caseDicts/postProcessing/flowRate/sursurfaceRegion.cfg"
fields (U);
operation areaNormalIntegrate;
......
......@@ -6,7 +6,7 @@
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
type cellSource;
type volRegion;
libs ("libfieldFunctionObjects.so");
writeControl timeStep;
......@@ -15,7 +15,7 @@ writeInterval 1;
writeFields false;
log false;
source all;
regionType all;
operation max;
// ************************************************************************* //
......@@ -6,7 +6,7 @@
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
type faceSource;
type surfaceRegion;
libs ("libfieldFunctionObjects.so");
writeControl timeStep;
......@@ -15,7 +15,7 @@ writeInterval 1;
writeFields false;
log false;
source all;
regionType all;
operation max;
// ************************************************************************* //
......@@ -17,13 +17,13 @@ log false;
source1
{
#includeEtc "caseDicts/postProcessing/faceSource/faceSource.cfg"
#includeEtc "caseDicts/postProcessing/surfaceRegion/surfaceRegion.cfg"
operation areaAverage;
fields (p);
}
source2
{
#includeEtc "caseDicts/postProcessing/faceSource/faceSource.cfg"
#includeEtc "caseDicts/postProcessing/surfaceRegion/surfaceRegion.cfg"
operation areaAverage;
fields (p);
}
......
......@@ -10,13 +10,13 @@
source1
{
source patch;
sourceName $patch1;
regionType patch;
name $patch1;
}
source2
{
source patch;
sourceName $patch2;
regionType patch;
name $patch2;
}
// ************************************************************************* //
......@@ -10,12 +10,12 @@
source1
{
source sampledSurface;
regionType sampledSurface;
sampledSurfaceDict
{
type sampledTriSurfaceMesh;
source cells;
regionType cells;
interpolate true;
surface $triSurface1;
}
......
......@@ -6,8 +6,8 @@
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/faceSource/faceSource.cfg"
#includeEtc "caseDicts/postProcessing/surfaceRegion/surfaceRegion.cfg"
source faceZone;
regionType faceZone;
// ************************************************************************* //
......@@ -6,9 +6,9 @@
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/faceSource/faceSource.cfg"
#includeEtc "caseDicts/postProcessing/surfaceRegion/surfaceRegion.cfg"
source patch;
sourceName $patch;
regionType patch;
name $patch;
// ************************************************************************* //
......@@ -16,7 +16,7 @@ patchAverage
fields (<field names>);
operation average;
#includeEtc "caseDicts/postProcessing/faceSource/patchSource.cfg"
#includeEtc "caseDicts/postProcessing/surfaceRegion/patch.cfg"
log true;
}
......
......@@ -16,7 +16,7 @@ patchIntegrate
fields (<field names>);
operation areaIntegrate;
#includeEtc "caseDicts/postProcessing/faceSource/patchSource.cfg"
#includeEtc "caseDicts/postProcessing/surfaceRegion/patch.cfg"
log true;
}
......
......@@ -6,7 +6,7 @@
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
type faceSource;
type surfaceRegion;
libs ("libfieldFunctionObjects.so");
writeControl timeStep;
......
......@@ -6,9 +6,9 @@
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
#includeEtc "caseDicts/postProcessing/faceSource/faceSource.cfg"
#includeEtc "caseDicts/postProcessing/surfaceRegion/surfaceRegion.cfg"
source sampledSurface;
regionType sampledSurface;
sampledSurfaceDict
{
......
......@@ -8,8 +8,8 @@ fieldMinMax/fieldMinMax.C
fieldValues/fieldValue/fieldValue.C
fieldValues/fieldValue/fieldValueNew.C
fieldValues/fieldValueDelta/fieldValueDelta.C
fieldValues/cellSource/cellSource.C
fieldValues/faceSource/faceSource.C
fieldValues/volRegion/volRegion.C
fieldValues/surfaceRegion/surfaceRegion.C
nearWallFields/nearWallFields.C
nearWallFields/findCellParticle.C
......
......@@ -48,7 +48,7 @@ functions
{
faceObj1
{
type faceSource;
type surfaceRegion;
libs ("libfieldFunctionObjects.so");
enabled true;
......@@ -64,7 +64,7 @@ functions
source patch;
// if patch or faceZone: name of patch or faceZone
sourceName movingWall;
name movingWall;
//// if sampledSurface: dictionary with a sampledSurface
//// Note: will not sample surface fields.
......@@ -90,14 +90,14 @@ functions
faceObj2
{
type faceSource;
type surfaceRegion;
libs ("libfieldFunctionObjects.so");
enabled true;
writeControl writeTime;
log true;
writeFields true;
source faceZone;
sourceName f0;
name f0;
operation sum;
fields
......@@ -108,14 +108,14 @@ functions
cellObj1
{
type cellSource;
type volRegion;
libs ("libfieldFunctionObjects.so");
enabled true;
writeControl writeTime;
log true;
writeFields true;
source cellZone;
sourceName c0;
name c0;
operation volAverage;
fields
......
......@@ -51,7 +51,7 @@ Foam::functionObjects::fieldValue::fieldValue
:
writeFiles(name, runTime, dict, name),
dict_(dict),
sourceName_(word::null),
name_(word::null),
resultDict_(fileName("name"), dictionary::null)
{
read(dict);
......@@ -69,7 +69,7 @@ Foam::functionObjects::fieldValue::fieldValue
:
writeFiles(name, obr, dict, name),
dict_(dict),
sourceName_(word::null),
name_(word::null),
resultDict_(fileName("name"), dictionary::null)
{
read(dict);
......
......@@ -70,7 +70,7 @@ protected:
dictionary dict_;
//- Name of source object
word sourceName_;
word name_;
//- List of field names to operate on
wordList fields_;
......@@ -154,7 +154,7 @@ public:
inline const dictionary& dict() const;
//- Return the source name
inline const word& sourceName() const;
inline const word& name() const;
//- Return the list of field names
inline const wordList& fields() const;
......
......@@ -34,9 +34,9 @@ inline const Foam::dictionary& Foam::functionObjects::fieldValue::dict() const
}
inline const Foam::word& Foam::functionObjects::fieldValue::sourceName() const
inline const Foam::word& Foam::functionObjects::fieldValue::name() const
{
return sourceName_;
return name_;
}
......
......@@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include "faceSource.H"
#include "surfaceRegion.H"
#include "fvMesh.H"
#include "cyclicPolyPatch.H"
#include "emptyPolyPatch.H"
......@@ -42,9 +42,9 @@ namespace functionObjects
{
namespace fieldValues
{
defineTypeNameAndDebug(faceSource, 0);
addToRunTimeSelectionTable(fieldValue, faceSource, dictionary);
addToRunTimeSelectionTable(functionObject, faceSource, dictionary);
defineTypeNameAndDebug(surfaceRegion, 0);
addToRunTimeSelectionTable(fieldValue, surfaceRegion, dictionary);
addToRunTimeSelectionTable(functionObject, surfaceRegion, dictionary);
}
}
}
......@@ -52,7 +52,7 @@ namespace fieldValues
template<>
const char* Foam::NamedEnum
<
Foam::functionObjects::fieldValues::faceSource::sourceType,
Foam::functionObjects::fieldValues::surfaceRegion::regionTypes,
3
>::names[] =
{
......@@ -64,7 +64,7 @@ const char* Foam::NamedEnum
template<>
const char* Foam::NamedEnum
<
Foam::functionObjects::fieldValues::faceSource::operationType,
Foam::functionObjects::fieldValues::surfaceRegion::operationType,
15
>::names[] =
{
......@@ -87,29 +87,29 @@ const char* Foam::NamedEnum
const Foam::NamedEnum
<
Foam::functionObjects::fieldValues::faceSource::sourceType,
Foam::functionObjects::fieldValues::surfaceRegion::regionTypes,
3
> Foam::functionObjects::fieldValues::faceSource::sourceTypeNames_;
> Foam::functionObjects::fieldValues::surfaceRegion::regionTypeNames_;
const Foam::NamedEnum
<
Foam::functionObjects::fieldValues::faceSource::operationType,
Foam::functionObjects::fieldValues::surfaceRegion::operationType,
15
> Foam::functionObjects::fieldValues::faceSource::operationTypeNames_;
> Foam::functionObjects::fieldValues::surfaceRegion::operationTypeNames_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::functionObjects::fieldValues::faceSource::setFaceZoneFaces()
void Foam::functionObjects::fieldValues::surfaceRegion::setFaceZoneFaces()
{
label zoneId = mesh().faceZones().findZoneID(sourceName_);
label zoneId = mesh().faceZones().findZoneID(name_);
if (zoneId < 0)
{
FatalErrorInFunction
<< type() << " " << name() << ": "
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl
<< " Unknown face zone name: " << sourceName_
<< regionTypeNames_[regionType_] << "(" << name_ << "):" << nl
<< " Unknown face zone name: " << name_
<< ". Valid face zones are: " << mesh().faceZones().names()
<< nl << exit(FatalError);
}
......@@ -185,16 +185,16 @@ void Foam::functionObjects::fieldValues::faceSource::setFaceZoneFaces()
}
void Foam::functionObjects::fieldValues::faceSource::setPatchFaces()
void Foam::functionObjects::fieldValues::surfaceRegion::setPatchFaces()
{
const label patchid = mesh().boundaryMesh().findPatchID(sourceName_);
const label patchid = mesh().boundaryMesh().findPatchID(name_);
if (patchid < 0)
{
FatalErrorInFunction
<< type() << " " << name() << ": "
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl
<< " Unknown patch name: " << sourceName_
<< regionTypeNames_[regionType_] << "(" << name_ << "):" << nl
<< " Unknown patch name: " << name_
<< ". Valid patch names are: "
<< mesh().boundaryMesh().names() << nl
<< exit(FatalError);
......@@ -222,7 +222,7 @@ void Foam::functionObjects::fieldValues::faceSource::setPatchFaces()
}
void Foam::functionObjects::fieldValues::faceSource::sampledSurfaceFaces
void Foam::functionObjects::fieldValues::surfaceRegion::sampledSurfaceFaces
(
const dictionary& dict
)
......@@ -238,7 +238,7 @@ void Foam::functionObjects::fieldValues::faceSource::sampledSurfaceFaces
}
void Foam::functionObjects::fieldValues::faceSource::combineMeshGeometry
void Foam::functionObjects::fieldValues::surfaceRegion::combineMeshGeometry
(
faceList& faces,
pointField& points
......@@ -359,7 +359,7 @@ void Foam::functionObjects::fieldValues::faceSource::combineMeshGeometry
}
void Foam::functionObjects::fieldValues::faceSource::combineSurfaceGeometry
void Foam::functionObjects::fieldValues::surfaceRegion::combineSurfaceGeometry
(
faceList& faces,
pointField& points
......@@ -398,7 +398,8 @@ void Foam::functionObjects::fieldValues::faceSource::combineSurfaceGeometry
}
Foam::scalar Foam::functionObjects::fieldValues::faceSource::totalArea() const
Foam::scalar
Foam::functionObjects::fieldValues::surfaceRegion::totalArea() const
{
scalar totalArea;
......@@ -417,14 +418,14 @@ Foam::scalar Foam::functionObjects::fieldValues::faceSource::totalArea() const
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::functionObjects::fieldValues::faceSource::initialise
void Foam::functionObjects::fieldValues::surfaceRegion::initialise
(
const dictionary& dict
)
{
dict.lookup("sourceName") >> sourceName_;
dict.lookup("name") >> name_;
switch (source_)
switch (regionType_)
{
case stFaceZone:
{
......@@ -445,9 +446,9 @@ void Foam::functionObjects::fieldValues::faceSource::initialise
{
FatalErrorInFunction
<< type() << " " << name() << ": "
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):"
<< nl << " Unknown source type. Valid source types are:"
<< sourceTypeNames_.sortedToc() << nl << exit(FatalError);
<< regionTypeNames_[regionType_] << "(" << name_ << "):"
<< nl << " Unknown region type. Valid region types are:"
<< regionTypeNames_.sortedToc() << nl << exit(FatalError);
}
}
......@@ -455,8 +456,8 @@ void Foam::functionObjects::fieldValues::faceSource::initialise
{
FatalErrorInFunction
<< type() << " " << name() << ": "
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl
<< " Source has no faces" << exit(FatalError);
<< regionTypeNames_[regionType_] << "(" << name_ << "):" << nl
<< " Region has no faces" << exit(FatalError);
}
if (surfacePtr_.valid())
......@@ -476,7 +477,7 @@ void Foam::functionObjects::fieldValues::faceSource::initialise
{
Info<< " weight field = " << weightFieldName_ << nl;
if (source_ == stSampledSurface)
if (regionType_ == stSampledSurface)
{
FatalIOErrorInFunction(dict)
<< "Cannot use weightField for a sampledSurface"
......@@ -532,13 +533,13 @@ void Foam::functionObjects::fieldValues::faceSource::initialise
}
void Foam::functionObjects::fieldValues::faceSource::writeFileHeader
void Foam::functionObjects::fieldValues::surfaceRegion::writeFileHeader
(
const label i
)
{
writeCommented(file(), "Source : ");
file() << sourceTypeNames_[source_] << " " << sourceName_ << endl;
writeCommented(file(), "Region type : ");
file() << regionTypeNames_[regionType_] << " " << name_ << endl;
writeCommented(file(), "Faces : ");
file() << nFaces_ << endl;
writeCommented(file(), "Area : ");
......@@ -562,7 +563,7 @@ void Foam::functionObjects::fieldValues::faceSource::writeFileHeader
template<>
Foam::scalar Foam::functionObjects::fieldValues::faceSource::processValues
Foam::scalar Foam::functionObjects::fieldValues::surfaceRegion::processValues
(
const Field<scalar>& values,
const vectorField& Sf,
......@@ -593,7 +594,7 @@ Foam::scalar Foam::functionObjects::fieldValues::faceSource::processValues
template<>
Foam::vector Foam::functionObjects::fieldValues::faceSource::processValues
Foam::vector Foam::functionObjects::fieldValues::surfaceRegion::processValues
(
const Field<vector>& values,
const vectorField& Sf,
......@@ -639,7 +640,7 @@ Foam::vector Foam::functionObjects::fieldValues::faceSource::processValues
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObjects::fieldValues::faceSource::faceSource
Foam::functionObjects::fieldValues::surfaceRegion::surfaceRegion
(
const word& name,
const Time& runTime,
......@@ -648,7 +649,7 @@ Foam::functionObjects::fieldValues::faceSource::faceSource
:
fieldValue(name, runTime, dict, typeName),
surfaceWriterPtr_(NULL),
source_(sourceTypeNames_.read(dict.lookup("source"))),
regionType_(regionTypeNames_.read(dict.lookup("regionType"))),
operation_(operationTypeNames_.read(dict.lookup("operation"))),
weightFieldName_("none"),
orientWeightField_(false),
......@@ -669,7 +670,7 @@ Foam::functionObjects::fieldValues::faceSource::faceSource
read(dict);
}
Foam::functionObjects::fieldValues::faceSource::faceSource
Foam::functionObjects::fieldValues::surfaceRegion::surfaceRegion
(
const word& name,
const objectRegistry& obr,
......@@ -678,7 +679,7 @@ Foam::functionObjects::fieldValues::faceSource::faceSource
:
fieldValue(name, obr, dict, typeName),
surfaceWriterPtr_(NULL),
source_(sourceTypeNames_.read(dict.lookup("source"))),
regionType_(regionTypeNames_.read(dict.lookup("regionType"))),
operation_(operationTypeNames_.read(dict.lookup("operation"))),
weightFieldName_("none"),
orientWeightField_(false),
......@@ -702,13 +703,13 @@ Foam::functionObjects::fieldValues::faceSource::faceSource
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::fieldValues::faceSource::~faceSource()
Foam::functionObjects::fieldValues::surfaceRegion::~surfaceRegion()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::functionObjects::fieldValues::faceSource::read
bool Foam::functionObjects::fieldValues::surfaceRegion::read
(
const dictionary& dict
)
......@@ -720,7 +721,7 @@ bool Foam::functionObjects::fieldValues::faceSource::read
}
bool Foam::functionObjects::fieldValues::faceSource::write
bool Foam::functionObjects::fieldValues::surfaceRegion::write
(
const bool postProcess
)
......
......@@ -22,13 +22,13 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::functionObjects::fieldValues::faceSource
Foam::functionObjects::fieldValues::surfaceRegion
Group
grpFieldFunctionObjects
Description
This function object provides a 'face source' variant of the fieldValues
This function object provides a 'face regionType' variant of the fieldValues
function object. Given a list of user-specified fields and a selection
of mesh (or general surface) faces, a number of operations can be
performed, such as sums, averages and integrations.
......@@ -39,16 +39,16 @@ Description
Example of function object specification:
\verbatim
faceSource1
surfaceRegion1
{
type faceSource;
type surfaceRegion;
libs ("libfieldFunctionObjects.so");
...
log yes;
writeFields true;
surfaceFormat none;
source faceZone;
sourceName f0;
regionType faceZone;
name f0;
operation sum;
weightField alpha1;
fields
......@@ -63,13 +63,13 @@ Description
\heading Function object usage
\table
Property | Description | Required | Default value
type | type name: faceSource | yes |
type | type name: surfaceRegion | yes |
log | write data to standard output | no | no
writeFields | write the output values | yes |
writeArea | Write the area of the faceSource | no |
writeArea | Write the area of the surfaceRegion | no |