STYLE: consistency updates

This commit is contained in:
Andrew Heather
2016-09-27 15:17:55 +01:00
parent 89d9fd1550
commit 3dbd39146c
242 changed files with 1933 additions and 1933 deletions

View File

@ -3,7 +3,7 @@
#+TITLE: OpenFOAM C++ Style Guide #+TITLE: OpenFOAM C++ Style Guide
#+AUTHOR: OpenFOAM Foundation #+AUTHOR: OpenFOAM Foundation
#+DATE: 2011-2016 #+DATE: 2011-2016
#+LINK: http://OpenFOAM.org #+LINK: http://OpenFOAM.com
#+OPTIONS: author:nil ^:{} #+OPTIONS: author:nil ^:{}
#+STARTUP: hidestars #+STARTUP: hidestars
#+STARTUP: odd #+STARTUP: odd

View File

@ -43,8 +43,8 @@ heatTransfer
type compressible::turbulentTemperatureCoupledBaffleMixed; type compressible::turbulentTemperatureCoupledBaffleMixed;
value ${:VALUE.T}; value ${:VALUE.T};
Tnbr T; Tnbr T;
kappa fluidThermo; kappaMethod fluidThermo;
kappaName none; kappa none;
} }
} }
} }

View File

@ -60,8 +60,8 @@ heatTransfer
type compressible::turbulentTemperatureCoupledBaffleMixed; type compressible::turbulentTemperatureCoupledBaffleMixed;
value ${:VALUE.T}; value ${:VALUE.T};
Tnbr T; Tnbr T;
kappa fluidThermo; kappaMethod fluidThermo;
kappaName none; kappa none;
} }
} }
} }

View File

@ -39,8 +39,8 @@ heatTransfer
type compressible::turbulentTemperatureCoupledBaffleMixed; type compressible::turbulentTemperatureCoupledBaffleMixed;
value ${:VALUE.T}; value ${:VALUE.T};
Tnbr T; Tnbr T;
kappa solidThermo; kappaMethod solidThermo;
kappaName none; kappa none;
} }
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Web: www.OpenFOAM.org \\ / A nd | Web: www.OpenFOAM.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Description Description

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -139,10 +139,10 @@ class functionObject
// Private Member Functions // Private Member Functions
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
functionObject(const functionObject&); functionObject(const functionObject&) = delete;
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const functionObject&); void operator=(const functionObject&) = delete;
public: public:

View File

@ -80,10 +80,11 @@ protected:
const ObjectType& lookupObject(const word& fieldName) const; const ObjectType& lookupObject(const word& fieldName) const;
//- Store the given field in the objectRegistry under the given name //- Store the given field in the objectRegistry under the given name
// Note: sets the fieldName to tfield().name() if not already set
template<class ObjectType> template<class ObjectType>
bool store bool store
( (
const word& fieldName, word& fieldName,
const tmp<ObjectType>& tfield, const tmp<ObjectType>& tfield,
bool cacheable = false bool cacheable = false
); );

View File

@ -51,7 +51,7 @@ const ObjectType& Foam::functionObjects::regionFunctionObject::lookupObject
template<class ObjectType> template<class ObjectType>
bool Foam::functionObjects::regionFunctionObject::store bool Foam::functionObjects::regionFunctionObject::store
( (
const word& fieldName, word& fieldName,
const tmp<ObjectType>& tfield, const tmp<ObjectType>& tfield,
bool cacheable bool cacheable
) )
@ -90,6 +90,10 @@ bool Foam::functionObjects::regionFunctionObject::store
{ {
tfield.ref().rename(fieldName); tfield.ref().rename(fieldName);
} }
else
{
fieldName = tfield().name();
}
obr_.objectRegistry::store(tfield.ptr()); obr_.objectRegistry::store(tfield.ptr());
} }

View File

@ -64,7 +64,7 @@ class filteredLinear2Limiter
{ {
// Private data // Private data
// Scaling corefficient for the gradient ratio, // Scaling coefficient for the gradient ratio,
// 0 = linear // 0 = linear
// 1 = fully limited // 1 = fully limited
scalar k_; scalar k_;

View File

@ -46,7 +46,7 @@ Usage
Q1 Q1
{ {
type Q; type Q;
functionObjectLibs ("libutilityFunctionObjects.so"); libs ("libutilityFunctionObjects.so");
... ...
} }
\endverbatim \endverbatim

View File

@ -135,19 +135,19 @@ void Foam::functionObjects::externalCoupled::removeReadFiles() const
Log << type() << ": removing all read files" << endl; Log << type() << ": removing all read files" << endl;
forAll(regionGroupNames_, regionI) forAll(regionGroupNames_, regioni)
{ {
const word& compName = regionGroupNames_[regionI]; const word& compName = regionGroupNames_[regioni];
const labelList& groups = regionToGroups_[compName]; const labelList& groups = regionToGroups_[compName];
forAll(groups, i) forAll(groups, i)
{ {
label groupI = groups[i]; label groupi = groups[i];
const wordRe& groupName = groupNames_[groupI]; const wordRe& groupName = groupNames_[groupi];
forAll(groupReadFields_[groupI], fieldI) forAll(groupReadFields_[groupi], fieldi)
{ {
const word& fieldName = groupReadFields_[groupI][fieldI]; const word& fieldName = groupReadFields_[groupi][fieldi];
rm rm
( (
groupDir(commsDir_, compName, groupName) groupDir(commsDir_, compName, groupName)
@ -168,19 +168,19 @@ void Foam::functionObjects::externalCoupled::removeWriteFiles() const
Log << type() << ": removing all write files" << endl; Log << type() << ": removing all write files" << endl;
forAll(regionGroupNames_, regionI) forAll(regionGroupNames_, regioni)
{ {
const word& compName = regionGroupNames_[regionI]; const word& compName = regionGroupNames_[regioni];
const labelList& groups = regionToGroups_[compName]; const labelList& groups = regionToGroups_[compName];
forAll(groups, i) forAll(groups, i)
{ {
label groupI = groups[i]; label groupi = groups[i];
const wordRe& groupName = groupNames_[groupI]; const wordRe& groupName = groupNames_[groupi];
forAll(groupReadFields_[groupI], fieldI) forAll(groupReadFields_[groupi], fieldi)
{ {
const word& fieldName = groupReadFields_[groupI][fieldI]; const word& fieldName = groupReadFields_[groupi][fieldi];
rm rm
( (
groupDir(commsDir_, compName, groupName) groupDir(commsDir_, compName, groupName)
@ -252,20 +252,20 @@ void Foam::functionObjects::externalCoupled::readColumns
// Read data from file and send to destination processor // Read data from file and send to destination processor
for (label procI = 0; procI < Pstream::nProcs(); procI++) for (label proci = 0; proci < Pstream::nProcs(); proci++)
{ {
// Temporary storage // Temporary storage
List<scalarField> values(nColumns); List<scalarField> values(nColumns);
// Number of rows to read for processor procI // Number of rows to read for processor proci
label procNRows = globalFaces.localSize(procI); label procNRows = globalFaces.localSize(proci);
forAll(values, columnI) forAll(values, columni)
{ {
values[columnI].setSize(procNRows); values[columni].setSize(procNRows);
} }
for (label rowI = 0; rowI < procNRows; rowI++) for (label rowi = 0; rowi < procNRows; rowi++)
{ {
// Get a line // Get a line
do do
@ -273,8 +273,8 @@ void Foam::functionObjects::externalCoupled::readColumns
if (!masterFilePtr().good()) if (!masterFilePtr().good())
{ {
FatalIOErrorInFunction(masterFilePtr()) FatalIOErrorInFunction(masterFilePtr())
<< "Trying to read data for processor " << procI << "Trying to read data for processor " << proci
<< " row " << rowI << " row " << rowi
<< ". Does your file have as many rows as there are" << ". Does your file have as many rows as there are"
<< " patch faces (" << globalFaces.size() << " patch faces (" << globalFaces.size()
<< ") ?" << exit(FatalIOError); << ") ?" << exit(FatalIOError);
@ -285,14 +285,14 @@ void Foam::functionObjects::externalCoupled::readColumns
IStringStream lineStr(line); IStringStream lineStr(line);
for (label columnI = 0; columnI < nColumns; columnI++) for (label columni = 0; columni < nColumns; columni++)
{ {
lineStr >> values[columnI][rowI]; lineStr >> values[columni][rowi];
} }
} }
// Send to procI // Send to proci
UOPstream str(procI, pBufs); UOPstream str(proci, pBufs);
str << values; str << values;
} }
} }
@ -322,14 +322,14 @@ void Foam::functionObjects::externalCoupled::readLines
// Read line from file and send to destination processor // Read line from file and send to destination processor
for (label procI = 0; procI < Pstream::nProcs(); procI++) for (label proci = 0; proci < Pstream::nProcs(); proci++)
{ {
// Number of rows to read for processor procI // Number of rows to read for processor proci
label procNRows = globalFaces.localSize(procI); label procNRows = globalFaces.localSize(proci);
UOPstream toProc(procI, pBufs); UOPstream toProc(proci, pBufs);
for (label rowI = 0; rowI < procNRows; rowI++) for (label rowi = 0; rowi < procNRows; rowi++)
{ {
// Get a line // Get a line
do do
@ -337,8 +337,8 @@ void Foam::functionObjects::externalCoupled::readLines
if (!masterFilePtr().good()) if (!masterFilePtr().good())
{ {
FatalIOErrorInFunction(masterFilePtr()) FatalIOErrorInFunction(masterFilePtr())
<< "Trying to read data for processor " << procI << "Trying to read data for processor " << proci
<< " row " << rowI << " row " << rowi
<< ". Does your file have as many rows as there are" << ". Does your file have as many rows as there are"
<< " patch faces (" << globalFaces.size() << " patch faces (" << globalFaces.size()
<< ") ?" << exit(FatalIOError); << ") ?" << exit(FatalIOError);
@ -358,7 +358,7 @@ void Foam::functionObjects::externalCoupled::readLines
// Read lines from PstreamBuffers // Read lines from PstreamBuffers
UIPstream str(Pstream::masterNo(), pBufs); UIPstream str(Pstream::masterNo(), pBufs);
for (label rowI = 0; rowI < nRows; rowI++) for (label rowi = 0; rowi < nRows; rowi++)
{ {
string line(str); string line(str);
lines << line.c_str() << nl; lines << line.c_str() << nl;
@ -399,9 +399,9 @@ void Foam::functionObjects::externalCoupled::writeGeometry
DynamicList<face> allMeshesFaces; DynamicList<face> allMeshesFaces;
DynamicField<point> allMeshesPoints; DynamicField<point> allMeshesPoints;
forAll(meshes, meshI) forAll(meshes, meshi)
{ {
const fvMesh& mesh = meshes[meshI]; const fvMesh& mesh = meshes[meshi];
const polyBoundaryMesh& pbm = mesh.boundaryMesh(); const polyBoundaryMesh& pbm = mesh.boundaryMesh();
const labelList patchIDs const labelList patchIDs
@ -422,9 +422,9 @@ void Foam::functionObjects::externalCoupled::writeGeometry
{ {
const polyPatch& p = pbm[patchIDs[i]]; const polyPatch& p = pbm[patchIDs[i]];
forAll(p, pI) forAll(p, pi)
{ {
allFaceIDs.append(p.start()+pI); allFaceIDs.append(p.start()+pi);
} }
} }
@ -445,18 +445,18 @@ void Foam::functionObjects::externalCoupled::writeGeometry
uniquePointIDs uniquePointIDs
); );
label procI = Pstream::myProcNo(); label proci = Pstream::myProcNo();
List<pointField> collectedPoints(Pstream::nProcs()); List<pointField> collectedPoints(Pstream::nProcs());
collectedPoints[procI] = pointField(mesh.points(), uniquePointIDs); collectedPoints[proci] = pointField(mesh.points(), uniquePointIDs);
Pstream::gatherList(collectedPoints); Pstream::gatherList(collectedPoints);
List<faceList> collectedFaces(Pstream::nProcs()); List<faceList> collectedFaces(Pstream::nProcs());
faceList& patchFaces = collectedFaces[procI]; faceList& patchFaces = collectedFaces[proci];
patchFaces = allPatch.localFaces(); patchFaces = allPatch.localFaces();
forAll(patchFaces, faceI) forAll(patchFaces, facei)
{ {
inplaceRenumber(pointToGlobal, patchFaces[faceI]); inplaceRenumber(pointToGlobal, patchFaces[facei]);
} }
Pstream::gatherList(collectedFaces); Pstream::gatherList(collectedFaces);
@ -465,19 +465,19 @@ void Foam::functionObjects::externalCoupled::writeGeometry
// Append and renumber // Append and renumber
label nPoints = allMeshesPoints.size(); label nPoints = allMeshesPoints.size();
forAll(collectedPoints, procI) forAll(collectedPoints, proci)
{ {
allMeshesPoints.append(collectedPoints[procI]); allMeshesPoints.append(collectedPoints[proci]);
} }
face newFace; face newFace;
forAll(collectedFaces, procI) forAll(collectedFaces, proci)
{ {
const faceList& procFaces = collectedFaces[procI]; const faceList& procFaces = collectedFaces[proci];
forAll(procFaces, faceI) forAll(procFaces, facei)
{ {
const face& f = procFaces[faceI]; const face& f = procFaces[facei];
newFace.setSize(f.size()); newFace.setSize(f.size());
forAll(f, fp) forAll(f, fp)
@ -487,7 +487,7 @@ void Foam::functionObjects::externalCoupled::writeGeometry
allMeshesFaces.append(newFace); allMeshesFaces.append(newFace);
} }
nPoints += collectedPoints[procI].size(); nPoints += collectedPoints[proci].size();
} }
} }
@ -573,10 +573,10 @@ void Foam::functionObjects::externalCoupled::checkOrder
void Foam::functionObjects::externalCoupled::readData() void Foam::functionObjects::externalCoupled::readData()
{ {
forAll(regionGroupNames_, regionI) forAll(regionGroupNames_, regioni)
{ {
const word& compName = regionGroupNames_[regionI]; const word& compName = regionGroupNames_[regioni];
const wordList& regionNames = regionGroupRegions_[regionI]; const wordList& regionNames = regionGroupRegions_[regioni];
// Get the meshes for the region-group // Get the meshes for the region-group
UPtrList<const fvMesh> meshes(regionNames.size()); UPtrList<const fvMesh> meshes(regionNames.size());
@ -590,13 +590,13 @@ void Foam::functionObjects::externalCoupled::readData()
forAll(groups, i) forAll(groups, i)
{ {
label groupI = groups[i]; label groupi = groups[i];
const wordRe& groupName = groupNames_[groupI]; const wordRe& groupName = groupNames_[groupi];
const wordList& fieldNames = groupReadFields_[groupI]; const wordList& fieldNames = groupReadFields_[groupi];
forAll(fieldNames, fieldI) forAll(fieldNames, fieldi)
{ {
const word& fieldName = fieldNames[fieldI]; const word& fieldName = fieldNames[fieldi];
bool ok = readData<scalar> bool ok = readData<scalar>
( (
@ -643,10 +643,10 @@ void Foam::functionObjects::externalCoupled::readData()
void Foam::functionObjects::externalCoupled::writeData() const void Foam::functionObjects::externalCoupled::writeData() const
{ {
forAll(regionGroupNames_, regionI) forAll(regionGroupNames_, regioni)
{ {
const word& compName = regionGroupNames_[regionI]; const word& compName = regionGroupNames_[regioni];
const wordList& regionNames = regionGroupRegions_[regionI]; const wordList& regionNames = regionGroupRegions_[regioni];
// Get the meshes for the region-group // Get the meshes for the region-group
UPtrList<const fvMesh> meshes(regionNames.size()); UPtrList<const fvMesh> meshes(regionNames.size());
@ -660,13 +660,13 @@ void Foam::functionObjects::externalCoupled::writeData() const
forAll(groups, i) forAll(groups, i)
{ {
label groupI = groups[i]; label groupi = groups[i];
const wordRe& groupName = groupNames_[groupI]; const wordRe& groupName = groupNames_[groupi];
const wordList& fieldNames = groupWriteFields_[groupI]; const wordList& fieldNames = groupWriteFields_[groupi];
forAll(fieldNames, fieldI) forAll(fieldNames, fieldi)
{ {
const word& fieldName = fieldNames[fieldI]; const word& fieldName = fieldNames[fieldi];
bool ok = writeData<scalar> bool ok = writeData<scalar>
( (
@ -736,8 +736,8 @@ void Foam::functionObjects::externalCoupled::initialise()
forAll(groups, i) forAll(groups, i)
{ {
label groupI = groups[i]; label groupi = groups[i];
const wordRe& groupName = groupNames_[groupI]; const wordRe& groupName = groupNames_[groupi];
bool exists = false; bool exists = false;
if (Pstream::master()) if (Pstream::master())
@ -938,26 +938,26 @@ bool Foam::functionObjects::externalCoupled::read(const dictionary& dict)
if (log) if (log)
{ {
Info<< type() << ": Communicating with regions:" << endl; Info<< type() << ": Communicating with regions:" << endl;
forAll(regionGroupNames_, rgI) forAll(regionGroupNames_, rgi)
{ {
//const wordList& regionNames = regionGroupRegions_[rgI]; //const wordList& regionNames = regionGroupRegions_[rgi];
const word& compName = regionGroupNames_[rgI]; const word& compName = regionGroupNames_[rgi];
Info<< "Region: " << compName << endl << incrIndent; Info<< "Region: " << compName << endl << incrIndent;
const labelList& groups = regionToGroups_[compName]; const labelList& groups = regionToGroups_[compName];
forAll(groups, i) forAll(groups, i)
{ {
label groupI = groups[i]; label groupi = groups[i];
const wordRe& groupName = groupNames_[groupI]; const wordRe& groupName = groupNames_[groupi];
Info<< indent << "patchGroup: " << groupName << "\t" Info<< indent << "patchGroup: " << groupName << "\t"
<< endl << endl
<< incrIndent << incrIndent
<< indent << "Reading fields: " << indent << "Reading fields: "
<< groupReadFields_[groupI] << groupReadFields_[groupi]
<< endl << endl
<< indent << "Writing fields: " << indent << "Writing fields: "
<< groupWriteFields_[groupI] << groupWriteFields_[groupi]
<< endl << endl
<< decrIndent; << decrIndent;
} }
@ -971,15 +971,15 @@ bool Foam::functionObjects::externalCoupled::read(const dictionary& dict)
// should already be written - but just make sure // should already be written - but just make sure
if (Pstream::master()) if (Pstream::master())
{ {
forAll(regionGroupNames_, rgI) forAll(regionGroupNames_, rgi)
{ {
const word& compName = regionGroupNames_[rgI]; const word& compName = regionGroupNames_[rgi];
const labelList& groups = regionToGroups_[compName]; const labelList& groups = regionToGroups_[compName];
forAll(groups, i) forAll(groups, i)
{ {
label groupI = groups[i]; label groupi = groups[i];
const wordRe& groupName = groupNames_[groupI]; const wordRe& groupName = groupNames_[groupi];
fileName dir(groupDir(commsDir_, compName, groupName)); fileName dir(groupDir(commsDir_, compName, groupName));
if (!isDir(dir)) if (!isDir(dir))

View File

@ -126,13 +126,13 @@ void Foam::externalCoupledMixedFvPatchField<Type>::writeData
const Field<Type>& refGrad(this->refGrad()); const Field<Type>& refGrad(this->refGrad());
const scalarField& valueFraction(this->valueFraction()); const scalarField& valueFraction(this->valueFraction());
forAll(refValue, faceI) forAll(refValue, facei)
{ {
os << this->operator[](faceI) << token::SPACE os << this->operator[](facei) << token::SPACE
<< snGrad[faceI] << token::SPACE << snGrad[facei] << token::SPACE
<< refValue[faceI] << token::SPACE << refValue[facei] << token::SPACE
<< refGrad[faceI] << token::SPACE << refGrad[facei] << token::SPACE
<< valueFraction[faceI] << nl; << valueFraction[facei] << nl;
} }
} }
@ -146,7 +146,7 @@ void Foam::externalCoupledMixedFvPatchField<Type>::readData(Istream& is)
string line; string line;
forAll(*this, faceI) forAll(*this, facei)
{ {
iss.getLine(line); iss.getLine(line);
IStringStream lineStr(line); IStringStream lineStr(line);
@ -158,9 +158,9 @@ void Foam::externalCoupledMixedFvPatchField<Type>::readData(Istream& is)
lineStr lineStr
>> value >> value
>> snGrad >> snGrad
>> this->refValue()[faceI] >> this->refValue()[facei]
>> this->refGrad()[faceI] >> this->refGrad()[facei]
>> this->valueFraction()[faceI]; >> this->valueFraction()[facei];
} }
} }

View File

@ -145,7 +145,7 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::writeData
Ostream& os Ostream& os
) const ) const
{ {
const label patchI = patch().index(); const label patchi = patch().index();
// Heat flux [W/m2] // Heat flux [W/m2]
scalarField qDot(this->patch().size(), 0.0); scalarField qDot(this->patch().size(), 0.0);
@ -170,17 +170,17 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::writeData
const basicThermo& thermo = turbModel.transport(); const basicThermo& thermo = turbModel.transport();
const fvPatchScalarField& hep = thermo.he().boundaryField()[patchI]; const fvPatchScalarField& hep = thermo.he().boundaryField()[patchi];
qDot = turbModel.alphaEff(patchI)*hep.snGrad(); qDot = turbModel.alphaEff(patchi)*hep.snGrad();
} }
else if (db().foundObject<basicThermo>(thermoName)) else if (db().foundObject<basicThermo>(thermoName))
{ {
const basicThermo& thermo = db().lookupObject<basicThermo>(thermoName); const basicThermo& thermo = db().lookupObject<basicThermo>(thermoName);
const fvPatchScalarField& hep = thermo.he().boundaryField()[patchI]; const fvPatchScalarField& hep = thermo.he().boundaryField()[patchi];
qDot = thermo.alpha().boundaryField()[patchI]*hep.snGrad(); qDot = thermo.alpha().boundaryField()[patchi]*hep.snGrad();
} }
else else
{ {
@ -200,12 +200,12 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::writeData
const Field<scalar>& magSf(this->patch().magSf()); const Field<scalar>& magSf(this->patch().magSf());
forAll(patch(), faceI) forAll(patch(), facei)
{ {
os << magSf[faceI] << token::SPACE os << magSf[facei] << token::SPACE
<< Tp[faceI] << token::SPACE << Tp[facei] << token::SPACE
<< qDot[faceI] << token::SPACE << qDot[facei] << token::SPACE
<< htc[faceI] << token::SPACE << htc[facei] << token::SPACE
<< nl; << nl;
} }
} }
@ -222,15 +222,15 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::readData
string line; string line;
forAll(*this, faceI) forAll(*this, facei)
{ {
iss.getLine(line); iss.getLine(line);
IStringStream lineStr(line); IStringStream lineStr(line);
lineStr lineStr
>> this->refValue()[faceI] >> this->refValue()[facei]
>> this->refGrad()[faceI] >> this->refGrad()[facei]
>> this->valueFraction()[faceI]; >> this->valueFraction()[facei];
} }
} }

View File

@ -110,9 +110,9 @@ bool Foam::functionObjects::externalCoupled::readData
// Handle column-wise reading of patch data. Supports most easy types // Handle column-wise reading of patch data. Supports most easy types
forAll(patchIDs, i) forAll(patchIDs, i)
{ {
label patchI = patchIDs[i]; label patchi = patchIDs[i];
if (isA<patchFieldType>(bf[patchI])) if (isA<patchFieldType>(bf[patchi]))
{ {
// Explicit handling of externalCoupledMixed bcs - they // Explicit handling of externalCoupledMixed bcs - they
// have specialised reading routines. // have specialised reading routines.
@ -121,7 +121,7 @@ bool Foam::functionObjects::externalCoupled::readData
( (
refCast<const patchFieldType> refCast<const patchFieldType>
( (
bf[patchI] bf[patchi]
) )
); );
@ -129,7 +129,7 @@ bool Foam::functionObjects::externalCoupled::readData
OStringStream os; OStringStream os;
readLines readLines
( (
bf[patchI].size(), // number of lines to read bf[patchi].size(), // number of lines to read
masterFilePtr, masterFilePtr,
os os
); );
@ -141,14 +141,14 @@ bool Foam::functionObjects::externalCoupled::readData
// additional processing by derived type. // additional processing by derived type.
pf.patchFieldType::evaluate(); pf.patchFieldType::evaluate();
} }
else if (isA<mixedFvPatchField<Type>>(bf[patchI])) else if (isA<mixedFvPatchField<Type>>(bf[patchi]))
{ {
// Read columns from file for // Read columns from file for
// value, snGrad, refValue, refGrad, valueFraction // value, snGrad, refValue, refGrad, valueFraction
List<scalarField> data; List<scalarField> data;
readColumns readColumns
( (
bf[patchI].size(), // number of lines to read bf[patchi].size(), // number of lines to read
4*pTraits<Type>::nComponents+1, // nColumns: 4*Type+1*scalar 4*pTraits<Type>::nComponents+1, // nColumns: 4*Type+1*scalar
masterFilePtr, masterFilePtr,
data data
@ -159,13 +159,13 @@ bool Foam::functionObjects::externalCoupled::readData
( (
refCast<const mixedFvPatchField<Type>> refCast<const mixedFvPatchField<Type>>
( (
bf[patchI] bf[patchi]
) )
); );
// Transfer read data to bc. // Transfer read data to bc.
// Skip value, snGrad // Skip value, snGrad
direction columnI = 2*pTraits<Type>::nComponents; direction columni = 2*pTraits<Type>::nComponents;
Field<Type>& refValue = pf.refValue(); Field<Type>& refValue = pf.refValue();
for for
@ -175,7 +175,7 @@ bool Foam::functionObjects::externalCoupled::readData
cmpt++ cmpt++
) )
{ {
refValue.replace(cmpt, data[columnI++]); refValue.replace(cmpt, data[columni++]);
} }
Field<Type>& refGrad = pf.refGrad(); Field<Type>& refGrad = pf.refGrad();
for for
@ -185,21 +185,21 @@ bool Foam::functionObjects::externalCoupled::readData
cmpt++ cmpt++
) )
{ {
refGrad.replace(cmpt, data[columnI++]); refGrad.replace(cmpt, data[columni++]);
} }
pf.valueFraction() = data[columnI]; pf.valueFraction() = data[columni];
// Update the value from the read coefficicient. Bypass any // Update the value from the read coefficicient. Bypass any
// additional processing by derived type. // additional processing by derived type.
pf.mixedFvPatchField<Type>::evaluate(); pf.mixedFvPatchField<Type>::evaluate();
} }
else if (isA<fixedGradientFvPatchField<Type>>(bf[patchI])) else if (isA<fixedGradientFvPatchField<Type>>(bf[patchi]))
{ {
// Read columns for value and gradient // Read columns for value and gradient
List<scalarField> data; List<scalarField> data;
readColumns readColumns
( (
bf[patchI].size(), // number of lines to read bf[patchi].size(), // number of lines to read
2*pTraits<Type>::nComponents, // nColumns: Type 2*pTraits<Type>::nComponents, // nColumns: Type
masterFilePtr, masterFilePtr,
data data
@ -210,7 +210,7 @@ bool Foam::functionObjects::externalCoupled::readData
( (
refCast<const fixedGradientFvPatchField<Type>> refCast<const fixedGradientFvPatchField<Type>>
( (
bf[patchI] bf[patchi]
) )
); );
@ -234,20 +234,20 @@ bool Foam::functionObjects::externalCoupled::readData
// additional processing by derived type. // additional processing by derived type.
pf.fixedGradientFvPatchField<Type>::evaluate(); pf.fixedGradientFvPatchField<Type>::evaluate();
} }
else if (isA<fixedValueFvPatchField<Type>>(bf[patchI])) else if (isA<fixedValueFvPatchField<Type>>(bf[patchi]))
{ {
// Read columns for value only // Read columns for value only
List<scalarField> data; List<scalarField> data;
readColumns readColumns
( (
bf[patchI].size(), // number of lines to read bf[patchi].size(), // number of lines to read
pTraits<Type>::nComponents, // number of columns to read pTraits<Type>::nComponents, // number of columns to read
masterFilePtr, masterFilePtr,
data data
); );
// Transfer read value to bc // Transfer read value to bc
Field<Type> value(bf[patchI].size()); Field<Type> value(bf[patchi].size());
for for
( (
direction cmpt = 0; direction cmpt = 0;
@ -263,7 +263,7 @@ bool Foam::functionObjects::externalCoupled::readData
( (
refCast<const fixedValueFvPatchField<Type>> refCast<const fixedValueFvPatchField<Type>>
( (
bf[patchI] bf[patchi]
) )
); );
@ -276,8 +276,8 @@ bool Foam::functionObjects::externalCoupled::readData
else else
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unsupported boundary condition " << bf[patchI].type() << "Unsupported boundary condition " << bf[patchi].type()
<< " for patch " << bf[patchI].patch().name() << " for patch " << bf[patchi].patch().name()
<< " in region " << mesh.name() << " in region " << mesh.name()
<< exit(FatalError); << exit(FatalError);
} }
@ -309,24 +309,24 @@ Foam::functionObjects::externalCoupled::gatherAndCombine
if (Pstream::master()) if (Pstream::master())
{ {
// Combine values into single field // Combine values into single field
label globalElemI = 0; label globalElemi = 0;
forAll(gatheredValues, lstI) forAll(gatheredValues, lsti)
{ {
globalElemI += gatheredValues[lstI].size(); globalElemi += gatheredValues[lsti].size();
} }
result.setSize(globalElemI); result.setSize(globalElemi);
globalElemI = 0; globalElemi = 0;
forAll(gatheredValues, lstI) forAll(gatheredValues, lsti)
{ {
const Field<Type>& sub = gatheredValues[lstI]; const Field<Type>& sub = gatheredValues[lsti];
forAll(sub, elemI) forAll(sub, elemi)
{ {
result[globalElemI++] = sub[elemI]; result[globalElemi++] = sub[elemi];
} }
} }
} }
@ -408,18 +408,18 @@ bool Foam::functionObjects::externalCoupled::writeData
// Handle column-wise writing of patch data. Supports most easy types // Handle column-wise writing of patch data. Supports most easy types
forAll(patchIDs, i) forAll(patchIDs, i)
{ {
label patchI = patchIDs[i]; label patchi = patchIDs[i];
const globalIndex globalFaces(bf[patchI].size()); const globalIndex globalFaces(bf[patchi].size());
if (isA<patchFieldType>(bf[patchI])) if (isA<patchFieldType>(bf[patchi]))
{ {
// Explicit handling of externalCoupledMixed bcs - they // Explicit handling of externalCoupledMixed bcs - they
// have specialised writing routines // have specialised writing routines
const patchFieldType& pf = refCast<const patchFieldType> const patchFieldType& pf = refCast<const patchFieldType>
( (
bf[patchI] bf[patchi]
); );
OStringStream os; OStringStream os;
@ -438,9 +438,9 @@ bool Foam::functionObjects::externalCoupled::writeData
} }
masterFilePtr() << os.str().c_str(); masterFilePtr() << os.str().c_str();
for (label procI = 1; procI < Pstream::nProcs(); procI++) for (label proci = 1; proci < Pstream::nProcs(); proci++)
{ {
IPstream fromSlave(Pstream::scheduled, procI); IPstream fromSlave(Pstream::scheduled, proci);
string str(fromSlave); string str(fromSlave);
masterFilePtr() << str.c_str(); masterFilePtr() << str.c_str();
} }
@ -451,10 +451,10 @@ bool Foam::functionObjects::externalCoupled::writeData
toMaster << os.str(); toMaster << os.str();
} }
} }
else if (isA<mixedFvPatchField<Type>>(bf[patchI])) else if (isA<mixedFvPatchField<Type>>(bf[patchi]))
{ {
const mixedFvPatchField<Type>& pf = const mixedFvPatchField<Type>& pf =
refCast<const mixedFvPatchField<Type>>(bf[patchI]); refCast<const mixedFvPatchField<Type>>(bf[patchi]);
Field<Type> value(gatherAndCombine(pf)); Field<Type> value(gatherAndCombine(pf));
Field<Type> snGrad(gatherAndCombine(pf.snGrad()())); Field<Type> snGrad(gatherAndCombine(pf.snGrad()()));
@ -464,29 +464,29 @@ bool Foam::functionObjects::externalCoupled::writeData
if (Pstream::master()) if (Pstream::master())
{ {
forAll(refValue, faceI) forAll(refValue, facei)
{ {
masterFilePtr() masterFilePtr()
<< value[faceI] << token::SPACE << value[facei] << token::SPACE
<< snGrad[faceI] << token::SPACE << snGrad[facei] << token::SPACE
<< refValue[faceI] << token::SPACE << refValue[facei] << token::SPACE
<< refGrad[faceI] << token::SPACE << refGrad[facei] << token::SPACE
<< valueFraction[faceI] << nl; << valueFraction[facei] << nl;
} }
} }
} }
else else
{ {
// Output the value and snGrad // Output the value and snGrad
Field<Type> value(gatherAndCombine(bf[patchI])); Field<Type> value(gatherAndCombine(bf[patchi]));
Field<Type> snGrad(gatherAndCombine(bf[patchI].snGrad()())); Field<Type> snGrad(gatherAndCombine(bf[patchi].snGrad()()));
if (Pstream::master()) if (Pstream::master())
{ {
forAll(value, faceI) forAll(value, facei)
{ {
masterFilePtr() masterFilePtr()
<< value[faceI] << token::SPACE << value[facei] << token::SPACE
<< snGrad[faceI] << nl; << snGrad[facei] << nl;
} }
} }
} }

View File

@ -151,18 +151,18 @@ void Foam::functionObjects::fieldMinMax::calcMinMaxFields
{ {
const vectorField& Cfp = CfBoundary[patchi]; const vectorField& Cfp = CfBoundary[patchi];
label minPI = findMin(mfp); label minPi = findMin(mfp);
if (mfp[minPI] < minVs[proci]) if (mfp[minPi] < minVs[proci])
{ {
minVs[proci] = mfp[minPI]; minVs[proci] = mfp[minPi];
minCs[proci] = Cfp[minPI]; minCs[proci] = Cfp[minPi];
} }
label maxPI = findMax(mfp); label maxPi = findMax(mfp);
if (mfp[maxPI] > maxVs[proci]) if (mfp[maxPi] > maxVs[proci])
{ {
maxVs[proci] = mfp[maxPI]; maxVs[proci] = mfp[maxPi];
maxCs[proci] = Cfp[maxPI]; maxCs[proci] = Cfp[maxPi];
} }
} }
} }

View File

@ -89,21 +89,20 @@ void Foam::functionObjects::fieldValues::volFieldValue::initialise
void Foam::functionObjects::fieldValues::volFieldValue::writeFileHeader void Foam::functionObjects::fieldValues::volFieldValue::writeFileHeader
( (
const label i Ostream& os
) ) const
{ {
volRegion::writeFileHeader(*this, file()); volRegion::writeFileHeader(*this, os);
writeCommented(file(), "Time"); writeCommented(os, "Time");
forAll(fields_, fieldi) forAll(fields_, fieldi)
{ {
file() os << tab << operationTypeNames_[operation_]
<< tab << operationTypeNames_[operation_]
<< "(" << fields_[fieldi] << ")"; << "(" << fields_[fieldi] << ")";
} }
file() << endl; os << endl;
} }
@ -122,6 +121,7 @@ Foam::functionObjects::fieldValues::volFieldValue::volFieldValue
weightFieldName_("none") weightFieldName_("none")
{ {
read(dict); read(dict);
writeFileHeader(file());
} }

View File

@ -189,7 +189,7 @@ protected:
) const; ) const;
//- Output file header information //- Output file header information
virtual void writeFileHeader(const label i); virtual void writeFileHeader(Ostream& os) const;
public: public:

View File

@ -81,9 +81,9 @@ void Foam::functionObjects::fluxSummary::initialiseFaceZone
{ {
const fvMesh& mesh = refCast<const fvMesh>(obr_); const fvMesh& mesh = refCast<const fvMesh>(obr_);
label zoneI = mesh.faceZones().findZoneID(faceZoneName); label zonei = mesh.faceZones().findZoneID(faceZoneName);
if (zoneI == -1) if (zonei == -1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unable to find faceZone " << faceZoneName << "Unable to find faceZone " << faceZoneName
@ -93,7 +93,7 @@ void Foam::functionObjects::fluxSummary::initialiseFaceZone
faceZoneNames.append(faceZoneName); faceZoneNames.append(faceZoneName);
const faceZone& fZone = mesh.faceZones()[zoneI]; const faceZone& fZone = mesh.faceZones()[zonei];
DynamicList<label> faceIDs(fZone.size()); DynamicList<label> faceIDs(fZone.size());
DynamicList<label> facePatchIDs(fZone.size()); DynamicList<label> facePatchIDs(fZone.size());
@ -101,24 +101,24 @@ void Foam::functionObjects::fluxSummary::initialiseFaceZone
forAll(fZone, i) forAll(fZone, i)
{ {
label faceI = fZone[i]; label facei = fZone[i];
label faceID = -1; label faceID = -1;
label facePatchID = -1; label facePatchID = -1;
if (mesh.isInternalFace(faceI)) if (mesh.isInternalFace(facei))
{ {
faceID = faceI; faceID = facei;
facePatchID = -1; facePatchID = -1;
} }
else else
{ {
facePatchID = mesh.boundaryMesh().whichPatch(faceI); facePatchID = mesh.boundaryMesh().whichPatch(facei);
const polyPatch& pp = mesh.boundaryMesh()[facePatchID]; const polyPatch& pp = mesh.boundaryMesh()[facePatchID];
if (isA<coupledPolyPatch>(pp)) if (isA<coupledPolyPatch>(pp))
{ {
if (refCast<const coupledPolyPatch>(pp).owner()) if (refCast<const coupledPolyPatch>(pp).owner())
{ {
faceID = pp.whichFace(faceI); faceID = pp.whichFace(facei);
} }
else else
{ {
@ -127,7 +127,7 @@ void Foam::functionObjects::fluxSummary::initialiseFaceZone
} }
else if (!isA<emptyPolyPatch>(pp)) else if (!isA<emptyPolyPatch>(pp))
{ {
faceID = faceI - pp.start(); faceID = facei - pp.start();
} }
else else
{ {
@ -139,7 +139,7 @@ void Foam::functionObjects::fluxSummary::initialiseFaceZone
if (faceID >= 0) if (faceID >= 0)
{ {
// Orientation set by faceZone flip map // Orientation set by faceZone flip map
if (fZone.flipMap()[faceI]) if (fZone.flipMap()[facei])
{ {
faceSigns.append(-1); faceSigns.append(-1);
} }
@ -174,9 +174,9 @@ void Foam::functionObjects::fluxSummary::initialiseFaceZoneAndDirection
vector refDir = dir/(mag(dir) + ROOTVSMALL); vector refDir = dir/(mag(dir) + ROOTVSMALL);
label zoneI = mesh.faceZones().findZoneID(faceZoneName); label zonei = mesh.faceZones().findZoneID(faceZoneName);
if (zoneI == -1) if (zonei == -1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unable to find faceZone " << faceZoneName << "Unable to find faceZone " << faceZoneName
@ -187,7 +187,7 @@ void Foam::functionObjects::fluxSummary::initialiseFaceZoneAndDirection
faceZoneNames.append(faceZoneName); faceZoneNames.append(faceZoneName);
zoneRefDir.append(refDir); zoneRefDir.append(refDir);
const faceZone& fZone = mesh.faceZones()[zoneI]; const faceZone& fZone = mesh.faceZones()[zonei];
DynamicList<label> faceIDs(fZone.size()); DynamicList<label> faceIDs(fZone.size());
DynamicList<label> facePatchIDs(fZone.size()); DynamicList<label> facePatchIDs(fZone.size());
@ -200,24 +200,24 @@ void Foam::functionObjects::fluxSummary::initialiseFaceZoneAndDirection
forAll(fZone, i) forAll(fZone, i)
{ {
label faceI = fZone[i]; label facei = fZone[i];
label faceID = -1; label faceID = -1;
label facePatchID = -1; label facePatchID = -1;
if (mesh.isInternalFace(faceI)) if (mesh.isInternalFace(facei))
{ {
faceID = faceI; faceID = facei;
facePatchID = -1; facePatchID = -1;
} }
else else
{ {
facePatchID = mesh.boundaryMesh().whichPatch(faceI); facePatchID = mesh.boundaryMesh().whichPatch(facei);
const polyPatch& pp = mesh.boundaryMesh()[facePatchID]; const polyPatch& pp = mesh.boundaryMesh()[facePatchID];
if (isA<coupledPolyPatch>(pp)) if (isA<coupledPolyPatch>(pp))
{ {
if (refCast<const coupledPolyPatch>(pp).owner()) if (refCast<const coupledPolyPatch>(pp).owner())
{ {
faceID = pp.whichFace(faceI); faceID = pp.whichFace(facei);
} }
else else
{ {
@ -226,7 +226,7 @@ void Foam::functionObjects::fluxSummary::initialiseFaceZoneAndDirection
} }
else if (!isA<emptyPolyPatch>(pp)) else if (!isA<emptyPolyPatch>(pp))
{ {
faceID = faceI - pp.start(); faceID = facei - pp.start();
} }
else else
{ {
@ -283,9 +283,9 @@ void Foam::functionObjects::fluxSummary::initialiseCellZoneAndDirection
vector refDir = dir/(mag(dir) + ROOTVSMALL); vector refDir = dir/(mag(dir) + ROOTVSMALL);
const label cellZoneI = mesh.cellZones().findZoneID(cellZoneName); const label cellZonei = mesh.cellZones().findZoneID(cellZoneName);
if (cellZoneI == -1) if (cellZonei == -1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unable to find cellZone " << cellZoneName << "Unable to find cellZone " << cellZoneName
@ -297,22 +297,22 @@ void Foam::functionObjects::fluxSummary::initialiseCellZoneAndDirection
const polyBoundaryMesh& pbm = mesh.boundaryMesh(); const polyBoundaryMesh& pbm = mesh.boundaryMesh();
labelList cellAddr(mesh.nCells(), -1); labelList cellAddr(mesh.nCells(), -1);
const labelList& cellIDs = mesh.cellZones()[cellZoneI]; const labelList& cellIDs = mesh.cellZones()[cellZonei];
UIndirectList<label>(cellAddr, cellIDs) = identity(cellIDs.size()); UIndirectList<label>(cellAddr, cellIDs) = identity(cellIDs.size());
labelList nbrFaceCellAddr(mesh.nFaces() - nInternalFaces, -1); labelList nbrFaceCellAddr(mesh.nFaces() - nInternalFaces, -1);
forAll(pbm, patchI) forAll(pbm, patchi)
{ {
const polyPatch& pp = pbm[patchI]; const polyPatch& pp = pbm[patchi];
if (pp.coupled()) if (pp.coupled())
{ {
forAll(pp, i) forAll(pp, i)
{ {
label faceI = pp.start() + i; label facei = pp.start() + i;
label nbrFaceI = faceI - nInternalFaces; label nbrFacei = facei - nInternalFaces;
label own = mesh.faceOwner()[faceI]; label own = mesh.faceOwner()[facei];
nbrFaceCellAddr[nbrFaceI] = cellAddr[own]; nbrFaceCellAddr[nbrFacei] = cellAddr[own];
} }
} }
} }
@ -327,27 +327,27 @@ void Foam::functionObjects::fluxSummary::initialiseCellZoneAndDirection
DynamicList<scalar> faceSigns(faceIDs.size()); DynamicList<scalar> faceSigns(faceIDs.size());
// Internal faces // Internal faces
for (label faceI = 0; faceI < nInternalFaces; faceI++) for (label facei = 0; facei < nInternalFaces; facei++)
{ {
const label own = cellAddr[mesh.faceOwner()[faceI]]; const label own = cellAddr[mesh.faceOwner()[facei]];
const label nbr = cellAddr[mesh.faceNeighbour()[faceI]]; const label nbr = cellAddr[mesh.faceNeighbour()[facei]];
if (((own != -1) && (nbr == -1)) || ((own == -1) && (nbr != -1))) if (((own != -1) && (nbr == -1)) || ((own == -1) && (nbr != -1)))
{ {
vector n = mesh.faces()[faceI].normal(mesh.points()); vector n = mesh.faces()[facei].normal(mesh.points());
n /= mag(n) + ROOTVSMALL; n /= mag(n) + ROOTVSMALL;
if ((n & refDir) > tolerance_) if ((n & refDir) > tolerance_)
{ {
faceIDs.append(faceI); faceIDs.append(facei);
faceLocalPatchIDs.append(faceI); faceLocalPatchIDs.append(facei);
facePatchIDs.append(-1); facePatchIDs.append(-1);
faceSigns.append(1); faceSigns.append(1);
} }
else if ((n & -refDir) > tolerance_) else if ((n & -refDir) > tolerance_)
{ {
faceIDs.append(faceI); faceIDs.append(facei);
faceLocalPatchIDs.append(faceI); faceLocalPatchIDs.append(facei);
facePatchIDs.append(-1); facePatchIDs.append(-1);
faceSigns.append(-1); faceSigns.append(-1);
} }
@ -355,33 +355,33 @@ void Foam::functionObjects::fluxSummary::initialiseCellZoneAndDirection
} }
// Loop over boundary faces // Loop over boundary faces
forAll(pbm, patchI) forAll(pbm, patchi)
{ {
const polyPatch& pp = pbm[patchI]; const polyPatch& pp = pbm[patchi];
forAll(pp, localFaceI) forAll(pp, localFacei)
{ {
const label faceI = pp.start() + localFaceI; const label facei = pp.start() + localFacei;
const label own = cellAddr[mesh.faceOwner()[faceI]]; const label own = cellAddr[mesh.faceOwner()[facei]];
const label nbr = nbrFaceCellAddr[faceI - nInternalFaces]; const label nbr = nbrFaceCellAddr[facei - nInternalFaces];
if ((own != -1) && (nbr == -1)) if ((own != -1) && (nbr == -1))
{ {
vector n = mesh.faces()[faceI].normal(mesh.points()); vector n = mesh.faces()[facei].normal(mesh.points());
n /= mag(n) + ROOTVSMALL; n /= mag(n) + ROOTVSMALL;
if ((n & refDir) > tolerance_) if ((n & refDir) > tolerance_)
{ {
faceIDs.append(faceI); faceIDs.append(facei);
faceLocalPatchIDs.append(localFaceI); faceLocalPatchIDs.append(localFacei);
facePatchIDs.append(patchI); facePatchIDs.append(patchi);
faceSigns.append(1); faceSigns.append(1);
} }
else if ((n & -refDir) > tolerance_) else if ((n & -refDir) > tolerance_)
{ {
faceIDs.append(faceI); faceIDs.append(facei);
faceLocalPatchIDs.append(localFaceI); faceLocalPatchIDs.append(localFacei);
facePatchIDs.append(patchI); facePatchIDs.append(patchi);
faceSigns.append(-1); faceSigns.append(-1);
} }
} }
@ -423,26 +423,26 @@ void Foam::functionObjects::fluxSummary::initialiseCellZoneAndDirection
DynamicList<label> changedEdges; DynamicList<label> changedEdges;
DynamicList<patchEdgeFaceRegion> changedInfo; DynamicList<patchEdgeFaceRegion> changedInfo;
label seedFaceI = labelMax; label seedFacei = labelMax;
for (; oldFaceID < patch.size(); oldFaceID++) for (; oldFaceID < patch.size(); oldFaceID++)
{ {
if (allFaceInfo[oldFaceID].region() == -1) if (allFaceInfo[oldFaceID].region() == -1)
{ {
seedFaceI = globalFaces.toGlobal(oldFaceID); seedFacei = globalFaces.toGlobal(oldFaceID);
break; break;
} }
} }
reduce(seedFaceI, minOp<label>()); reduce(seedFacei, minOp<label>());
if (seedFaceI == labelMax) if (seedFacei == labelMax)
{ {
break; break;
} }
if (globalFaces.isLocal(seedFaceI)) if (globalFaces.isLocal(seedFacei))
{ {
label localFaceI = globalFaces.toLocal(seedFaceI); label localFacei = globalFaces.toLocal(seedFacei);
const labelList& fEdges = patch.faceEdges()[localFaceI]; const labelList& fEdges = patch.faceEdges()[localFacei];
forAll(fEdges, i) forAll(fEdges, i)
{ {
@ -479,9 +479,9 @@ void Foam::functionObjects::fluxSummary::initialiseCellZoneAndDirection
if (debug) if (debug)
{ {
label nCells = 0; label nCells = 0;
forAll(allFaceInfo, faceI) forAll(allFaceInfo, facei)
{ {
if (allFaceInfo[faceI].region() == regioni) if (allFaceInfo[facei].region() == regioni)
{ {
nCells++; nCells++;
} }
@ -521,7 +521,7 @@ void Foam::functionObjects::fluxSummary::initialiseCellZoneAndDirection
facePatchID.append(regionFacePatchIDs[regioni]); facePatchID.append(regionFacePatchIDs[regioni]);
faceSign.append(regionFaceSigns[regioni]); faceSign.append(regionFaceSigns[regioni]);
// Write OBJ of faces to file // Write OBj of faces to file
if (debug) if (debug)
{ {
OBJstream os(mesh.time().path()/zoneName + ".obj"); OBJstream os(mesh.time().path()/zoneName + ".obj");
@ -712,16 +712,16 @@ bool Foam::functionObjects::fluxSummary::read(const dictionary& dict)
{ {
filePtrs_.setSize(faceZoneName_.size()); filePtrs_.setSize(faceZoneName_.size());
forAll(filePtrs_, fileI) forAll(filePtrs_, filei)
{ {
const word& fzName = faceZoneName_[fileI]; const word& fzName = faceZoneName_[filei];
filePtrs_.set(fileI, createFile(fzName)); filePtrs_.set(filei, createFile(fzName));
writeFileHeader writeFileHeader
( (
fzName, fzName,
faceArea_[fileI], faceArea_[filei],
refDir_[fileI], refDir_[filei],
filePtrs_[fileI] filePtrs_[filei]
); );
} }
} }

View File

@ -41,7 +41,7 @@ Usage
fluxSummary1 fluxSummary1
{ {
type fluxSummary; type fluxSummary;
functionObjectLibs ("libutilityFunctionObjects.so"); libs ("libutilityFunctionObjects.so");
... ...
write yes; write yes;
log yes; log yes;

View File

@ -87,7 +87,7 @@ void Foam::functionObjects::mapFields::createInterpolation
meshToMesh::interpolationMethodNames_[mapMethodName] meshToMesh::interpolationMethodNames_[mapMethodName]
); );
// Lookup corresponding AMI method // Lookup corresponding AMi method
word patchMapMethodName = word patchMapMethodName =
AMIPatchToPatchInterpolation::interpolationMethodToWord AMIPatchToPatchInterpolation::interpolationMethodToWord
( (

View File

@ -33,12 +33,12 @@ Foam::findCellParticle::findCellParticle
const vector& position, const vector& position,
const label celli, const label celli,
const label tetFacei, const label tetFacei,
const label tetPtI, const label tetPti,
const point& end, const point& end,
const label data const label data
) )
: :
particle(mesh, position, celli, tetFacei, tetPtI), particle(mesh, position, celli, tetFacei, tetPti),
end_(end), end_(end),
data_(data) data_(data)
{} {}

View File

@ -122,7 +122,7 @@ public:
const vector& position, const vector& position,
const label celli, const label celli,
const label tetFacei, const label tetFacei,
const label tetPtI, const label tetPti,
const point& end, const point& end,
const label data const label data
); );

View File

@ -267,10 +267,10 @@ bool Foam::functionObjects::nearWallFields::read(const dictionary& dict)
// Convert field to map // Convert field to map
fieldMap_.resize(2*fieldSet_.size()); fieldMap_.resize(2*fieldSet_.size());
reverseFieldMap_.resize(2*fieldSet_.size()); reverseFieldMap_.resize(2*fieldSet_.size());
forAll(fieldSet_, setI) forAll(fieldSet_, seti)
{ {
const word& fldName = fieldSet_[setI].first(); const word& fldName = fieldSet_[seti].first();
const word& sampleFldName = fieldSet_[setI].second(); const word& sampleFldName = fieldSet_[seti].second();
fieldMap_.insert(fldName, sampleFldName); fieldMap_.insert(fldName, sampleFldName);
reverseFieldMap_.insert(sampleFldName, fldName); reverseFieldMap_.insert(sampleFldName, fldName);

View File

@ -101,26 +101,26 @@ calculateSpeciesRR
endTime_ += dt; endTime_ += dt;
forAll(production_, specieI) forAll(production_, speciei)
{ {
forAll(production_[specieI], reactionI) forAll(production_[speciei], reactioni)
{ {
RR = basicChemistry.calculateRR(reactionI, specieI); RR = basicChemistry.calculateRR(reactioni, speciei);
if (RR[0] > 0.0) if (RR[0] > 0.0)
{ {
production_[specieI][reactionI] = RR[0]; production_[speciei][reactioni] = RR[0];
productionInt_[specieI][reactionI] =+ dt*RR[0]; productionInt_[speciei][reactioni] =+ dt*RR[0];
} }
else if (RR[0] < 0.0) else if (RR[0] < 0.0)
{ {
consumption_[specieI][reactionI] = RR[0]; consumption_[speciei][reactioni] = RR[0];
consumptionInt_[specieI][reactionI] =+ dt*RR[0]; consumptionInt_[speciei][reactioni] =+ dt*RR[0];
} }
else else
{ {
production_[specieI][reactionI] = 0.0; production_[speciei][reactioni] = 0.0;
consumption_[specieI][reactionI] = 0.0; consumption_[speciei][reactioni] = 0.0;
} }
} }
} }
@ -143,21 +143,21 @@ writeSpeciesRR()
prodIntFilePtr_() << "start time : " << startTime_ << tab prodIntFilePtr_() << "start time : " << startTime_ << tab
<< "end time :" << endTime_ << nl; << "end time :" << endTime_ << nl;
for (label reactionI = 0; reactionI < nReactions_; ++reactionI) for (label reactioni = 0; reactioni < nReactions_; ++reactioni)
{ {
consFilePtr_() << reactionI << tab; consFilePtr_() << reactioni << tab;
consIntFilePtr_() << reactionI << tab; consIntFilePtr_() << reactioni << tab;
prodFilePtr_() << reactionI << tab; prodFilePtr_() << reactioni << tab;
prodIntFilePtr_() << reactionI << tab; prodIntFilePtr_() << reactioni << tab;
forAll(speciesNames_, i) forAll(speciesNames_, i)
{ {
prodFilePtr_() << production_[i][reactionI] << tab; prodFilePtr_() << production_[i][reactioni] << tab;
consFilePtr_() << consumption_[i][reactionI] << tab; consFilePtr_() << consumption_[i][reactioni] << tab;
prodIntFilePtr_() << productionInt_[i][reactionI] << tab; prodIntFilePtr_() << productionInt_[i][reactioni] << tab;
consIntFilePtr_() << consumptionInt_[i][reactionI] << tab; consIntFilePtr_() << consumptionInt_[i][reactioni] << tab;
consumptionInt_[i][reactionI] = 0.0; consumptionInt_[i][reactioni] = 0.0;
productionInt_[i][reactionI] = 0.0; productionInt_[i][reactioni] = 0.0;
} }
consFilePtr_() << nl; consFilePtr_() << nl;
consIntFilePtr_() << nl; consIntFilePtr_() << nl;

View File

@ -64,16 +64,16 @@ bool Foam::functionObjects::readFields::loadField(const word& fieldName)
{ {
// Store field on mesh database // Store field on mesh database
Log << " Reading " << fieldName << endl; Log << " Reading " << fieldName << endl;
tmp<VolFieldType> tvf(new VolFieldType(fieldHeader, mesh_)); VolFieldType* vfPtr(new VolFieldType(fieldHeader, mesh_));
regionFunctionObject::store(fieldName, tvf); mesh_.objectRegistry::store(vfPtr);
return true; return true;
} }
else if (fieldHeader.typeHeaderOk<SurfaceFieldType>(false)) else if (fieldHeader.typeHeaderOk<SurfaceFieldType>(false))
{ {
// Store field on mesh database // Store field on mesh database
Log << " Reading " << fieldName << endl; Log << " Reading " << fieldName << endl;
tmp<SurfaceFieldType> tsf(new SurfaceFieldType(fieldHeader, mesh_)); SurfaceFieldType* sfPtr(new SurfaceFieldType(fieldHeader, mesh_));
regionFunctionObject::store(fieldName, tsf); mesh_.objectRegistry::store(sfPtr);
return true; return true;
} }
} }

View File

@ -137,8 +137,8 @@ void Foam::functionObjects::regionSizeDistribution::writeAlphaFields
// Knock out any cell not in patchRegions // Knock out any cell not in patchRegions
forAll(liquidCore, celli) forAll(liquidCore, celli)
{ {
label regionI = regions[celli]; label regioni = regions[celli];
if (patchRegions.found(regionI)) if (patchRegions.found(regioni))
{ {
backgroundAlpha[celli] = 0; backgroundAlpha[celli] = 0;
} }
@ -146,7 +146,7 @@ void Foam::functionObjects::regionSizeDistribution::writeAlphaFields
{ {
liquidCore[celli] = 0; liquidCore[celli] = 0;
scalar regionVol = regionVolume[regionI]; scalar regionVol = regionVolume[regioni];
if (regionVol < maxDropletVol) if (regionVol < maxDropletVol)
{ {
backgroundAlpha[celli] = 0; backgroundAlpha[celli] = 0;
@ -598,10 +598,10 @@ bool Foam::functionObjects::regionSizeDistribution::write()
<< endl; << endl;
forAllConstIter(Map<label>, patchRegions, iter) forAllConstIter(Map<label>, patchRegions, iter)
{ {
label regionI = iter.key(); label regioni = iter.key();
Info<< " " << token::TAB << iter.key() Info<< " " << token::TAB << iter.key()
<< token::TAB << allRegionVolume[regionI] << token::TAB << allRegionVolume[regioni]
<< token::TAB << allRegionAlphaVolume[regionI] << endl; << token::TAB << allRegionAlphaVolume[regioni] << endl;
} }
Info<< endl; Info<< endl;
@ -658,17 +658,17 @@ bool Foam::functionObjects::regionSizeDistribution::write()
// threshold // threshold
forAllIter(Map<scalar>, allRegionVolume, vIter) forAllIter(Map<scalar>, allRegionVolume, vIter)
{ {
label regionI = vIter.key(); label regioni = vIter.key();
if if
( (
patchRegions.found(regionI) patchRegions.found(regioni)
|| vIter() >= maxDropletVol || vIter() >= maxDropletVol
|| (allRegionAlphaVolume[regionI]/vIter() < threshold_) || (allRegionAlphaVolume[regioni]/vIter() < threshold_)
) )
{ {
allRegionVolume.erase(vIter); allRegionVolume.erase(vIter);
allRegionAlphaVolume.erase(regionI); allRegionAlphaVolume.erase(regioni);
allRegionNumCells.erase(regionI); allRegionNumCells.erase(regioni);
} }
} }
@ -791,11 +791,11 @@ bool Foam::functionObjects::regionSizeDistribution::write()
<< endl; << endl;
scalar delta = 0.0; scalar delta = 0.0;
forAll(binDownCount, binI) forAll(binDownCount, bini)
{ {
Info<< " " << token::TAB << binI Info<< " " << token::TAB << bini
<< token::TAB << delta << token::TAB << delta
<< token::TAB << binDownCount[binI] << endl; << token::TAB << binDownCount[bini] << endl;
delta += deltaX; delta += deltaX;
} }
Info<< endl; Info<< endl;
@ -844,11 +844,11 @@ bool Foam::functionObjects::regionSizeDistribution::write()
<< endl; << endl;
scalar diam = 0.0; scalar diam = 0.0;
forAll(binCount, binI) forAll(binCount, bini)
{ {
Info<< " " << token::TAB << binI Info<< " " << token::TAB << bini
<< token::TAB << diam << token::TAB << diam
<< token::TAB << binCount[binI] << endl; << token::TAB << binCount[bini] << endl;
diam += delta; diam += delta;
} }

View File

@ -41,12 +41,12 @@ Foam::Map<Type> Foam::functionObjects::regionSizeDistribution::regionSum
forAll(fld, celli) forAll(fld, celli)
{ {
label regionI = regions[celli]; label regioni = regions[celli];
typename Map<Type>::iterator fnd = regionToSum.find(regionI); typename Map<Type>::iterator fnd = regionToSum.find(regioni);
if (fnd == regionToSum.end()) if (fnd == regionToSum.end())
{ {
regionToSum.insert(regionI, fld[celli]); regionToSum.insert(regioni, fld[celli]);
} }
else else
{ {

View File

@ -168,9 +168,9 @@ Foam::tmp<Foam::pointScalarField> Foam::functionObjects::streamFunction::calc
const cellList& c = mesh_.cells(); const cellList& c = mesh_.cells();
forAll(c, cI) forAll(c, ci)
{ {
labelList zeroPoints = c[cI].labels(mesh_.faces()); labelList zeroPoints = c[ci].labels(mesh_.faces());
bool found = true; bool found = true;

View File

@ -54,12 +54,12 @@ Foam::functionObjects::streamLineBase::wallPatch() const
label nFaces = 0; label nFaces = 0;
forAll(patches, patchI) forAll(patches, patchi)
{ {
//if (!polyPatch::constraintType(patches[patchI].type())) //if (!polyPatch::constraintType(patches[patchi].type()))
if (isA<wallPolyPatch>(patches[patchI])) if (isA<wallPolyPatch>(patches[patchi]))
{ {
nFaces += patches[patchI].size(); nFaces += patches[patchi].size();
} }
} }
@ -67,12 +67,12 @@ Foam::functionObjects::streamLineBase::wallPatch() const
nFaces = 0; nFaces = 0;
forAll(patches, patchI) forAll(patches, patchi)
{ {
//if (!polyPatch::constraintType(patches[patchI].type())) //if (!polyPatch::constraintType(patches[patchi].type()))
if (isA<wallPolyPatch>(patches[patchI])) if (isA<wallPolyPatch>(patches[patchi]))
{ {
const polyPatch& pp = patches[patchI]; const polyPatch& pp = patches[patchi];
forAll(pp, i) forAll(pp, i)
{ {
@ -220,11 +220,11 @@ void Foam::functionObjects::streamLineBase::initInterpolations
void Foam::functionObjects::streamLineBase::storePoint void Foam::functionObjects::streamLineBase::storePoint
( (
const label trackI, const label tracki,
const scalar w, const scalar w,
const label leftI, const label lefti,
const label rightI, const label righti,
DynamicList<point>& newTrack, DynamicList<point>& newTrack,
DynamicList<scalarList>& newScalars, DynamicList<scalarList>& newScalars,
@ -233,19 +233,19 @@ void Foam::functionObjects::streamLineBase::storePoint
{ {
label sz = newTrack.size(); label sz = newTrack.size();
const List<point>& track = allTracks_[trackI]; const List<point>& track = allTracks_[tracki];
newTrack.append((1.0-w)*track[leftI] + w*track[rightI]); newTrack.append((1.0-w)*track[lefti] + w*track[righti]);
// Scalars // Scalars
{ {
newScalars.append(scalarList(allScalars_.size())); newScalars.append(scalarList(allScalars_.size()));
scalarList& newVals = newScalars[sz]; scalarList& newVals = newScalars[sz];
forAll(allScalars_, scalarI) forAll(allScalars_, scalari)
{ {
const scalarList& trackVals = allScalars_[scalarI][trackI]; const scalarList& trackVals = allScalars_[scalari][tracki];
newVals[scalarI] = (1.0-w)*trackVals[leftI] + w*trackVals[rightI]; newVals[scalari] = (1.0-w)*trackVals[lefti] + w*trackVals[righti];
} }
} }
@ -254,10 +254,10 @@ void Foam::functionObjects::streamLineBase::storePoint
newVectors.append(vectorList(allVectors_.size())); newVectors.append(vectorList(allVectors_.size()));
vectorList& newVals = newVectors[sz]; vectorList& newVals = newVectors[sz];
forAll(allVectors_, vectorI) forAll(allVectors_, vectori)
{ {
const vectorList& trackVals = allVectors_[vectorI][trackI]; const vectorList& trackVals = allVectors_[vectori][tracki];
newVals[vectorI] = (1.0-w)*trackVals[leftI] + w*trackVals[rightI]; newVals[vectori] = (1.0-w)*trackVals[lefti] + w*trackVals[righti];
} }
} }
} }
@ -267,24 +267,24 @@ void Foam::functionObjects::streamLineBase::storePoint
void Foam::functionObjects::streamLineBase::trimToBox void Foam::functionObjects::streamLineBase::trimToBox
( (
const treeBoundBox& bb, const treeBoundBox& bb,
const label trackI, const label tracki,
PtrList<DynamicList<point>>& newTracks, PtrList<DynamicList<point>>& newTracks,
PtrList<DynamicList<scalarList>>& newScalars, PtrList<DynamicList<scalarList>>& newScalars,
PtrList<DynamicList<vectorList>>& newVectors PtrList<DynamicList<vectorList>>& newVectors
) const ) const
{ {
const List<point>& track = allTracks_[trackI]; const List<point>& track = allTracks_[tracki];
if (track.size()) if (track.size())
{ {
for for
( (
label segmentI = 1; label segmenti = 1;
segmentI < track.size(); segmenti < track.size();
segmentI++ segmenti++
) )
{ {
const point& startPt = track[segmentI-1]; const point& startPt = track[segmenti-1];
const point& endPt = track[segmentI]; const point& endPt = track[segmenti];
const vector d(endPt-startPt); const vector d(endPt-startPt);
scalar magD = mag(d); scalar magD = mag(d);
@ -292,14 +292,14 @@ void Foam::functionObjects::streamLineBase::trimToBox
{ {
if (bb.contains(startPt)) if (bb.contains(startPt))
{ {
// Store 1.0*track[segmentI-1]+0*track[segmentI] // Store 1.0*track[segmenti-1]+0*track[segmenti]
storePoint storePoint
( (
trackI, tracki,
0.0, 0.0,
segmentI-1, segmenti-1,
segmentI, segmenti,
newTracks.last(), newTracks.last(),
newScalars.last(), newScalars.last(),
@ -315,11 +315,11 @@ void Foam::functionObjects::streamLineBase::trimToBox
// values // values
storePoint storePoint
( (
trackI, tracki,
mag(clipPt-startPt)/magD, mag(clipPt-startPt)/magD,
segmentI-1, segmenti-1,
segmentI, segmenti,
newTracks.last(), newTracks.last(),
newScalars.last(), newScalars.last(),
@ -356,11 +356,11 @@ void Foam::functionObjects::streamLineBase::trimToBox
// Store point and interpolated values // Store point and interpolated values
storePoint storePoint
( (
trackI, tracki,
mag(clipPt-startPt)/magD, mag(clipPt-startPt)/magD,
segmentI-1, segmenti-1,
segmentI, segmenti,
newTracks.last(), newTracks.last(),
newScalars.last(), newScalars.last(),
@ -379,11 +379,11 @@ void Foam::functionObjects::streamLineBase::trimToBox
// Store point and interpolated values // Store point and interpolated values
storePoint storePoint
( (
trackI, tracki,
mag(clipPt-startPt)/magD, mag(clipPt-startPt)/magD,
segmentI-1, segmenti-1,
segmentI, segmenti,
newTracks.last(), newTracks.last(),
newScalars.last(), newScalars.last(),
@ -404,7 +404,7 @@ void Foam::functionObjects::streamLineBase::trimToBox
{ {
storePoint storePoint
( (
trackI, tracki,
1.0, 1.0,
track.size()-2, track.size()-2,
@ -427,9 +427,9 @@ void Foam::functionObjects::streamLineBase::trimToBox(const treeBoundBox& bb)
PtrList<DynamicList<scalarList>> newScalars; PtrList<DynamicList<scalarList>> newScalars;
PtrList<DynamicList<vectorList>> newVectors; PtrList<DynamicList<vectorList>> newVectors;
forAll(allTracks_, trackI) forAll(allTracks_, tracki)
{ {
const List<point>& track = allTracks_[trackI]; const List<point>& track = allTracks_[tracki];
if (track.size()) if (track.size())
{ {
@ -439,44 +439,44 @@ void Foam::functionObjects::streamLineBase::trimToBox(const treeBoundBox& bb)
newVectors.append(new DynamicList<vectorList>(track.size())); newVectors.append(new DynamicList<vectorList>(track.size()));
// Trim, split and append to newTracks // Trim, split and append to newTracks
trimToBox(bb, trackI, newTracks, newScalars, newVectors); trimToBox(bb, tracki, newTracks, newScalars, newVectors);
} }
} }
// Transfer newTracks to allTracks_ // Transfer newTracks to allTracks_
allTracks_.setSize(newTracks.size()); allTracks_.setSize(newTracks.size());
forAll(allTracks_, trackI) forAll(allTracks_, tracki)
{ {
allTracks_[trackI].transfer(newTracks[trackI]); allTracks_[tracki].transfer(newTracks[tracki]);
} }
// Replace track scalars // Replace track scalars
forAll(allScalars_, scalarI) forAll(allScalars_, scalari)
{ {
DynamicList<scalarList>& fieldVals = allScalars_[scalarI]; DynamicList<scalarList>& fieldVals = allScalars_[scalari];
fieldVals.setSize(newTracks.size()); fieldVals.setSize(newTracks.size());
forAll(fieldVals, trackI) forAll(fieldVals, tracki)
{ {
scalarList& trackVals = allScalars_[scalarI][trackI]; scalarList& trackVals = allScalars_[scalari][tracki];
trackVals.setSize(newScalars[trackI].size()); trackVals.setSize(newScalars[tracki].size());
forAll(trackVals, sampleI) forAll(trackVals, samplei)
{ {
trackVals[sampleI] = newScalars[trackI][sampleI][scalarI]; trackVals[samplei] = newScalars[tracki][samplei][scalari];
} }
} }
} }
// Replace track vectors // Replace track vectors
forAll(allVectors_, vectorI) forAll(allVectors_, vectori)
{ {
DynamicList<vectorList>& fieldVals = allVectors_[vectorI]; DynamicList<vectorList>& fieldVals = allVectors_[vectori];
fieldVals.setSize(newTracks.size()); fieldVals.setSize(newTracks.size());
forAll(fieldVals, trackI) forAll(fieldVals, tracki)
{ {
vectorList& trackVals = allVectors_[vectorI][trackI]; vectorList& trackVals = allVectors_[vectori][tracki];
trackVals.setSize(newVectors[trackI].size()); trackVals.setSize(newVectors[tracki].size());
forAll(trackVals, sampleI) forAll(trackVals, samplei)
{ {
trackVals[sampleI] = newVectors[trackI][sampleI][vectorI]; trackVals[samplei] = newVectors[tracki][samplei][vectori];
} }
} }
} }

View File

@ -149,11 +149,11 @@ protected:
//- Generate point and values by interpolating from existing values //- Generate point and values by interpolating from existing values
void storePoint void storePoint
( (
const label trackI, const label tracki,
const scalar w, const scalar w,
const label leftI, const label lefti,
const label rightI, const label righti,
DynamicList<point>& newTrack, DynamicList<point>& newTrack,
DynamicList<List<scalar>>& newScalars, DynamicList<List<scalar>>& newScalars,
@ -164,7 +164,7 @@ protected:
void trimToBox void trimToBox
( (
const treeBoundBox& bb, const treeBoundBox& bb,
const label trackI, const label tracki,
PtrList<DynamicList<point>>& newTracks, PtrList<DynamicList<point>>& newTracks,
PtrList<DynamicList<scalarList>>& newScalars, PtrList<DynamicList<scalarList>>& newScalars,
PtrList<DynamicList<vectorList>>& newVectors PtrList<DynamicList<vectorList>>& newVectors

View File

@ -70,11 +70,11 @@ Foam::vector Foam::streamLineParticle::interpolateFields
} }
sampledScalars_.setSize(td.vsInterp_.size()); sampledScalars_.setSize(td.vsInterp_.size());
forAll(td.vsInterp_, scalarI) forAll(td.vsInterp_, scalari)
{ {
sampledScalars_[scalarI].append sampledScalars_[scalari].append
( (
td.vsInterp_[scalarI].interpolate td.vsInterp_[scalari].interpolate
( (
position, position,
celli, celli,
@ -84,11 +84,11 @@ Foam::vector Foam::streamLineParticle::interpolateFields
} }
sampledVectors_.setSize(td.vvInterp_.size()); sampledVectors_.setSize(td.vvInterp_.size());
forAll(td.vvInterp_, vectorI) forAll(td.vvInterp_, vectori)
{ {
sampledVectors_[vectorI].append sampledVectors_[vectori].append
( (
td.vvInterp_[vectorI].interpolate td.vvInterp_[vectori].interpolate
( (
position, position,
celli, celli,

View File

@ -51,7 +51,7 @@ void Foam::functionObjects::surfaceInterpolate::interpolateFields()
if (fieldMap.found(fld.name())) if (fieldMap.found(fld.name()))
{ {
//const word sName = "interpolate(" + fld.name() + ')'; //const word sName = "interpolate(" + fld.name() + ')';
const word& sName = fieldMap[fld.name()]; word& sName = fieldMap[fld.name()];
if (obr_.found(sName)) if (obr_.found(sName))
{ {

View File

@ -38,7 +38,7 @@ Usage
vorticity1 vorticity1
{ {
type vorticity; type vorticity;
functionObjectLibs ("libutilityFunctionObjects.so"); libs ("libutilityFunctionObjects.so");
... ...
} }
\endverbatim \endverbatim

View File

@ -56,10 +56,10 @@ Foam::edge Foam::wallBoundedParticle::currentEdge() const
} }
else else
{ {
label faceBasePtI = mesh_.tetBasePtIs()[tetFace()]; label faceBasePti = mesh_.tetBasePtIs()[tetFace()];
label diagPtI = (faceBasePtI+diagEdge_)%f.size(); label diagPti = (faceBasePti+diagEdge_)%f.size();
return edge(f[faceBasePtI], f[diagPtI]); return edge(f[faceBasePti], f[diagPti]);
} }
} }
@ -135,7 +135,7 @@ void Foam::wallBoundedParticle::crossDiagonalEdge()
const Foam::face& f = mesh_.faces()[tetFace()]; const Foam::face& f = mesh_.faces()[tetFace()];
// tetPtI starts from 1, goes up to f.size()-2 // tetPti starts from 1, goes up to f.size()-2
if (tetPt() == diagEdge_) if (tetPt() == diagEdge_)
{ {
@ -165,7 +165,7 @@ void Foam::wallBoundedParticle::crossDiagonalEdge()
Foam::scalar Foam::wallBoundedParticle::trackFaceTri Foam::scalar Foam::wallBoundedParticle::trackFaceTri
( (
const vector& endPosition, const vector& endPosition,
label& minEdgeI label& minEdgei
) )
{ {
// Track p from position to endPosition // Track p from position to endPosition
@ -175,7 +175,7 @@ Foam::scalar Foam::wallBoundedParticle::trackFaceTri
// Check which edge intersects the trajectory. // Check which edge intersects the trajectory.
// Project trajectory onto triangle // Project trajectory onto triangle
minEdgeI = -1; minEdgei = -1;
scalar minS = 1; // end position scalar minS = 1; // end position
edge currentE(-1, -1); edge currentE(-1, -1);
@ -217,13 +217,13 @@ Foam::scalar Foam::wallBoundedParticle::trackFaceTri
if (s >= 0 && s < minS) if (s >= 0 && s < minS)
{ {
minS = s; minS = s;
minEdgeI = i; minEdgei = i;
} }
} }
} }
} }
if (minEdgeI != -1) if (minEdgei != -1)
{ {
position() += minS*(endPosition-position()); position() += minS*(endPosition-position());
} }
@ -299,12 +299,12 @@ Foam::wallBoundedParticle::wallBoundedParticle
const vector& position, const vector& position,
const label celli, const label celli,
const label tetFacei, const label tetFacei,
const label tetPtI, const label tetPti,
const label meshEdgeStart, const label meshEdgeStart,
const label diagEdge const label diagEdge
) )
: :
particle(mesh, position, celli, tetFacei, tetPtI), particle(mesh, position, celli, tetFacei, tetPti),
meshEdgeStart_(meshEdgeStart), meshEdgeStart_(meshEdgeStart),
diagEdge_(diagEdge) diagEdge_(diagEdge)
{} {}

View File

@ -112,9 +112,9 @@ protected:
//- Particle is on diagonal edge: //- Particle is on diagonal edge:
// const face& f = mesh.faces()[tetFace()] // const face& f = mesh.faces()[tetFace()]
// label faceBasePtI = mesh.tetBasePtIs()[facei]; // label faceBasePti = mesh.tetBasePtIs()[facei];
// label diagPtI = (faceBasePtI+diagEdge_)%f.size(); // label diagPti = (faceBasePti+diagEdge_)%f.size();
// const edge e(f[faceBasePtI], f[diagPtI]); // const edge e(f[faceBasePti], f[diagPti]);
label diagEdge_; label diagEdge_;
@ -130,7 +130,7 @@ protected:
void crossDiagonalEdge(); void crossDiagonalEdge();
//- Track through single triangle //- Track through single triangle
scalar trackFaceTri(const vector& endPosition, label& minEdgeI); scalar trackFaceTri(const vector& endPosition, label& minEdgei);
//- Is current triangle in the track direction //- Is current triangle in the track direction
bool isTriAlongTrack(const point& endPosition) const; bool isTriAlongTrack(const point& endPosition) const;
@ -225,7 +225,7 @@ public:
const vector& position, const vector& position,
const label celli, const label celli,
const label tetFacei, const label tetFacei,
const label tetPtI, const label tetPti,
const label meshEdgeStart, const label meshEdgeStart,
const label diagEdge const label diagEdge
); );

View File

@ -172,7 +172,7 @@ Foam::scalar Foam::wallBoundedParticle::trackToEdge
: mesh_.faceOwner()[facei_] : mesh_.faceOwner()[facei_]
); );
// Check angle to nbrCell tet. Is it in the direction of the // Check angle to nbrCell tet. Is it in the direction of the
// endposition? I.e. since volume of nbr tet is positive the // endposition? i.e. since volume of nbr tet is positive the
// tracking direction should be into the tet. // tracking direction should be into the tet.
tetIndices nbrTi(nbrCelli, tetFacei_, tetPti_, mesh_); tetIndices nbrTi(nbrCelli, tetFacei_, tetPti_, mesh_);
if ((nbrTi.faceTri(mesh_).normal() & (endPosition-position())) < 0) if ((nbrTi.faceTri(mesh_).normal() & (endPosition-position())) < 0)
@ -241,10 +241,10 @@ Foam::scalar Foam::wallBoundedParticle::trackToEdge
if (doTrack) if (doTrack)
{ {
// Track across triangle. Return triangle edge crossed. // Track across triangle. Return triangle edge crossed.
label triEdgeI = -1; label triEdgei = -1;
trackFraction = trackFaceTri(projectedEndPosition, triEdgeI); trackFraction = trackFaceTri(projectedEndPosition, triEdgei);
if (triEdgeI == -1) if (triEdgei == -1)
{ {
// Reached endpoint // Reached endpoint
//checkInside(); //checkInside();
@ -268,7 +268,7 @@ Foam::scalar Foam::wallBoundedParticle::trackToEdge
const Foam::face& f = mesh_.faces()[ti.face()]; const Foam::face& f = mesh_.faces()[ti.face()];
const label fp0 = ti.faceBasePt(); const label fp0 = ti.faceBasePt();
if (triEdgeI == 0) if (triEdgei == 0)
{ {
if (ti.facePtA() == f.fcIndex(fp0)) if (ti.facePtA() == f.fcIndex(fp0))
{ {
@ -305,7 +305,7 @@ Foam::scalar Foam::wallBoundedParticle::trackToEdge
crossDiagonalEdge(); crossDiagonalEdge();
} }
} }
else if (triEdgeI == 1) else if (triEdgei == 1)
{ {
//Pout<< "Real edge." << endl; //Pout<< "Real edge." << endl;
diagEdge_ = -1; diagEdge_ = -1;
@ -314,7 +314,7 @@ Foam::scalar Foam::wallBoundedParticle::trackToEdge
crossEdgeConnectedFace(currentEdge()); crossEdgeConnectedFace(currentEdge());
patchInteraction(td, trackFraction); patchInteraction(td, trackFraction);
} }
else // if (triEdgeI == 2) else // if (triEdgei == 2)
{ {
if (ti.facePtB() == f.rcIndex(fp0)) if (ti.facePtB() == f.rcIndex(fp0))
{ {

View File

@ -59,7 +59,7 @@ Foam::tetIndices Foam::functionObjects::wallBoundedStreamLine::findNearestTet
const cell& cFaces = mesh_.cells()[celli]; const cell& cFaces = mesh_.cells()[celli];
label minFacei = -1; label minFacei = -1;
label minTetPtI = -1; label minTetPti = -1;
scalar minDistSqr = sqr(GREAT); scalar minDistSqr = sqr(GREAT);
forAll(cFaces, cFacei) forAll(cFaces, cFacei)
@ -86,7 +86,7 @@ Foam::tetIndices Foam::functionObjects::wallBoundedStreamLine::findNearestTet
{ {
minDistSqr = d2; minDistSqr = d2;
minFacei = facei; minFacei = facei;
minTetPtI = i-1; minTetPti = i-1;
} }
fp = nextFp; fp = nextFp;
} }
@ -98,7 +98,7 @@ Foam::tetIndices Foam::functionObjects::wallBoundedStreamLine::findNearestTet
( (
celli, celli,
minFacei, minFacei,
minTetPtI, minTetPti,
mesh_ mesh_
); );
} }

View File

@ -63,11 +63,11 @@ Foam::vector Foam::wallBoundedStreamLineParticle::interpolateFields
// Store the scalar fields // Store the scalar fields
sampledScalars_.setSize(td.vsInterp_.size()); sampledScalars_.setSize(td.vsInterp_.size());
forAll(td.vsInterp_, scalarI) forAll(td.vsInterp_, scalari)
{ {
sampledScalars_[scalarI].append sampledScalars_[scalari].append
( (
td.vsInterp_[scalarI].interpolate td.vsInterp_[scalari].interpolate
( (
position, position,
ti, //celli, ti, //celli,
@ -78,23 +78,23 @@ Foam::vector Foam::wallBoundedStreamLineParticle::interpolateFields
// Store the vector fields // Store the vector fields
sampledVectors_.setSize(td.vvInterp_.size()); sampledVectors_.setSize(td.vvInterp_.size());
forAll(td.vvInterp_, vectorI) forAll(td.vvInterp_, vectori)
{ {
vector positionU; vector positionU;
if (vectorI == td.UIndex_) if (vectori == td.UIndex_)
{ {
positionU = U; positionU = U;
} }
else else
{ {
positionU = td.vvInterp_[vectorI].interpolate positionU = td.vvInterp_[vectori].interpolate
( (
position, position,
ti, //celli, ti, //celli,
facei facei
); );
} }
sampledVectors_[vectorI].append(positionU); sampledVectors_[vectori].append(positionU);
} }
} }
@ -136,7 +136,7 @@ Foam::wallBoundedStreamLineParticle::wallBoundedStreamLineParticle
const vector& position, const vector& position,
const label celli, const label celli,
const label tetFacei, const label tetFacei,
const label tetPtI, const label tetPti,
const label meshEdgeStart, const label meshEdgeStart,
const label diagEdge, const label diagEdge,
const label lifeTime const label lifeTime
@ -148,7 +148,7 @@ Foam::wallBoundedStreamLineParticle::wallBoundedStreamLineParticle
position, position,
celli, celli,
tetFacei, tetFacei,
tetPtI, tetPti,
meshEdgeStart, meshEdgeStart,
diagEdge diagEdge
), ),

View File

@ -170,7 +170,7 @@ public:
const vector& position, const vector& position,
const label celli, const label celli,
const label tetFacei, const label tetFacei,
const label tetPtI, const label tetPti,
const label meshEdgeStart, const label meshEdgeStart,
const label diagEdge, const label diagEdge,
const label lifeTime const label lifeTime

View File

@ -92,7 +92,11 @@ Foam::functionObjects::wallShearStress::wallShearStress
writeFile(mesh_, name, typeName, dict), writeFile(mesh_, name, typeName, dict),
patchSet_() patchSet_()
{ {
tmp<volVectorField> wallShearStressPtr read(dict);
writeFileHeader(file());
volVectorField* wallShearStressPtr
( (
new volVectorField new volVectorField
( (
@ -114,9 +118,7 @@ Foam::functionObjects::wallShearStress::wallShearStress
) )
); );
store(typeName, wallShearStressPtr); mesh_.objectRegistry::store(wallShearStressPtr);
read(dict);
} }

View File

@ -75,9 +75,11 @@ Foam::functionObjects::yPlus::yPlus
fvMeshFunctionObject(name, runTime, dict), fvMeshFunctionObject(name, runTime, dict),
writeFile(obr_, name, typeName, dict) writeFile(obr_, name, typeName, dict)
{ {
read(dict);
writeFileHeader(file()); writeFileHeader(file());
tmp<volScalarField> tyPlusPtr volScalarField* yPlusPtr
( (
new volScalarField new volScalarField
( (
@ -94,7 +96,7 @@ Foam::functionObjects::yPlus::yPlus
) )
); );
store(typeName, tyPlusPtr); mesh_.objectRegistry::store(yPlusPtr);
} }

View File

@ -109,24 +109,24 @@ void Foam::functionObjects::forceCoeffs::writeBinHeader
vectorField binPoints(nBin_); vectorField binPoints(nBin_);
writeCommented(os, "x co-ords :"); writeCommented(os, "x co-ords :");
forAll(binPoints, pointI) forAll(binPoints, pointi)
{ {
binPoints[pointI] = (binMin_ + (pointI + 1)*binDx_)*binDir_; binPoints[pointi] = (binMin_ + (pointi + 1)*binDx_)*binDir_;
os << tab << binPoints[pointI].x(); os << tab << binPoints[pointi].x();
} }
os << nl; os << nl;
writeCommented(os, "y co-ords :"); writeCommented(os, "y co-ords :");
forAll(binPoints, pointI) forAll(binPoints, pointi)
{ {
os << tab << binPoints[pointI].y(); os << tab << binPoints[pointi].y();
} }
os << nl; os << nl;
writeCommented(os, "z co-ords :"); writeCommented(os, "z co-ords :");
forAll(binPoints, pointI) forAll(binPoints, pointi)
{ {
os << tab << binPoints[pointI].z(); os << tab << binPoints[pointi].z();
} }
os << nl; os << nl;
@ -186,15 +186,15 @@ void Foam::functionObjects::forceCoeffs::writeBinData
{ {
os << obr_.time().value(); os << obr_.time().value();
for (label binI = 0; binI < nBin_; binI++) for (label bini = 0; bini < nBin_; bini++)
{ {
scalar total = coeffs[0][binI] + coeffs[1][binI] + coeffs[2][binI]; scalar total = coeffs[0][bini] + coeffs[1][bini] + coeffs[2][bini];
os << tab << total << tab << coeffs[0][binI] << tab << coeffs[1][binI]; os << tab << total << tab << coeffs[0][bini] << tab << coeffs[1][bini];
if (porosity_) if (porosity_)
{ {
os << tab << coeffs[2][binI]; os << tab << coeffs[2][bini];
} }
} }
@ -256,7 +256,7 @@ bool Foam::functionObjects::forceCoeffs::read(const dictionary& dict)
{ {
const fvMesh& mesh = refCast<const fvMesh>(obr_); const fvMesh& mesh = refCast<const fvMesh>(obr_);
tmp<volVectorField> tforceCoeff volVectorField* forceCoeffPtr
( (
new volVectorField new volVectorField
( (
@ -273,9 +273,9 @@ bool Foam::functionObjects::forceCoeffs::read(const dictionary& dict)
) )
); );
store(tforceCoeff().name(), tforceCoeff); mesh_.objectRegistry::store(forceCoeffPtr);
tmp<volVectorField> tmomentCoeff volVectorField* momentCoeffPtr
( (
new volVectorField new volVectorField
( (
@ -292,7 +292,7 @@ bool Foam::functionObjects::forceCoeffs::read(const dictionary& dict)
) )
); );
store(tmomentCoeff().name(), tmomentCoeff); mesh_.objectRegistry::store(momentCoeffPtr);
} }
return true; return true;
@ -361,11 +361,11 @@ bool Foam::functionObjects::forceCoeffs::execute()
{ {
forAll(liftCoeffs, i) forAll(liftCoeffs, i)
{ {
for (label binI = 1; binI < nBin_; binI++) for (label bini = 1; bini < nBin_; bini++)
{ {
liftCoeffs[i][binI] += liftCoeffs[i][binI-1]; liftCoeffs[i][bini] += liftCoeffs[i][bini-1];
dragCoeffs[i][binI] += dragCoeffs[i][binI-1]; dragCoeffs[i][bini] += dragCoeffs[i][bini-1];
momentCoeffs[i][binI] += momentCoeffs[i][binI-1]; momentCoeffs[i][bini] += momentCoeffs[i][bini-1];
} }
} }
} }

View File

@ -126,24 +126,24 @@ void Foam::functionObjects::forces::writeBinHeader
vectorField binPoints(nBin_); vectorField binPoints(nBin_);
writeCommented(os, "x co-ords :"); writeCommented(os, "x co-ords :");
forAll(binPoints, pointI) forAll(binPoints, pointi)
{ {
binPoints[pointI] = (binMin_ + (pointI + 1)*binDx_)*binDir_; binPoints[pointi] = (binMin_ + (pointi + 1)*binDx_)*binDir_;
os << tab << binPoints[pointI].x(); os << tab << binPoints[pointi].x();
} }
os << nl; os << nl;
writeCommented(os, "y co-ords :"); writeCommented(os, "y co-ords :");
forAll(binPoints, pointI) forAll(binPoints, pointi)
{ {
os << tab << binPoints[pointI].y(); os << tab << binPoints[pointi].y();
} }
os << nl; os << nl;
writeCommented(os, "z co-ords :"); writeCommented(os, "z co-ords :");
forAll(binPoints, pointI) forAll(binPoints, pointi)
{ {
os << tab << binPoints[pointI].z(); os << tab << binPoints[pointi].z();
} }
os << nl; os << nl;
@ -223,8 +223,8 @@ void Foam::functionObjects::forces::initialiseBins()
scalar binMax = -GREAT; scalar binMax = -GREAT;
forAllConstIter(labelHashSet, patchSet_, iter) forAllConstIter(labelHashSet, patchSet_, iter)
{ {
label patchI = iter.key(); label patchi = iter.key();
const polyPatch& pp = pbm[patchI]; const polyPatch& pp = pbm[patchi];
scalarField d(pp.faceCentres() & binDir_); scalarField d(pp.faceCentres() & binDir_);
binMin_ = min(min(d), binMin_); binMin_ = min(min(d), binMin_);
binMax = max(max(d), binMax); binMax = max(max(d), binMax);
@ -245,8 +245,8 @@ void Foam::functionObjects::forces::initialiseBins()
forAll(cellZoneIDs, i) forAll(cellZoneIDs, i)
{ {
label zoneI = cellZoneIDs[i]; label zonei = cellZoneIDs[i];
const cellZone& cZone = mesh_.cellZones()[zoneI]; const cellZone& cZone = mesh_.cellZones()[zonei];
const scalarField d(dd, cZone); const scalarField d(dd, cZone);
binMin_ = min(min(d), binMin_); binMin_ = min(min(d), binMin_);
binMax = max(max(d), binMax); binMax = max(max(d), binMax);
@ -497,7 +497,7 @@ void Foam::functionObjects::forces::applyBins
void Foam::functionObjects::forces::addToFields void Foam::functionObjects::forces::addToFields
( (
const label patchI, const label patchi,
const vectorField& Md, const vectorField& Md,
const vectorField& fN, const vectorField& fN,
const vectorField& fT, const vectorField& fT,
@ -515,7 +515,7 @@ void Foam::functionObjects::forces::addToFields
lookupObject<volVectorField>(fieldName("force")) lookupObject<volVectorField>(fieldName("force"))
); );
vectorField& pf = force.boundaryFieldRef()[patchI]; vectorField& pf = force.boundaryFieldRef()[patchi];
pf += fN + fT + fP; pf += fN + fT + fP;
volVectorField& moment = volVectorField& moment =
@ -524,7 +524,7 @@ void Foam::functionObjects::forces::addToFields
lookupObject<volVectorField>(fieldName("moment")) lookupObject<volVectorField>(fieldName("moment"))
); );
vectorField& pm = moment.boundaryFieldRef()[patchI]; vectorField& pm = moment.boundaryFieldRef()[patchi];
pm += Md; pm += Md;
} }
@ -557,9 +557,9 @@ void Foam::functionObjects::forces::addToFields
forAll(cellIDs, i) forAll(cellIDs, i)
{ {
label cellI = cellIDs[i]; label celli = cellIDs[i];
force[cellI] += fN[i] + fT[i] + fP[i]; force[celli] += fN[i] + fT[i] + fP[i];
moment[cellI] += Md[i]; moment[celli] += Md[i];
} }
} }
@ -934,7 +934,7 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
{ {
Info << " Fields will be written" << endl; Info << " Fields will be written" << endl;
tmp<volVectorField> tforce volVectorField* forcePtr
( (
new volVectorField new volVectorField
( (
@ -951,9 +951,9 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
) )
); );
store(tforce().name(), tforce); mesh_.objectRegistry::store(forcePtr);
tmp<volVectorField> tmoment volVectorField* momentPtr
( (
new volVectorField new volVectorField
( (
@ -970,7 +970,7 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
) )
); );
store(tmoment().name(), tmoment); mesh_.objectRegistry::store(momentPtr);
} }
return true; return true;
@ -991,33 +991,33 @@ void Foam::functionObjects::forces::calcForcesMoment()
forAllConstIter(labelHashSet, patchSet_, iter) forAllConstIter(labelHashSet, patchSet_, iter)
{ {
label patchI = iter.key(); label patchi = iter.key();
vectorField Md vectorField Md
( (
mesh_.C().boundaryField()[patchI] - coordSys_.origin() mesh_.C().boundaryField()[patchi] - coordSys_.origin()
); );
scalarField sA(mag(Sfb[patchI])); scalarField sA(mag(Sfb[patchi]));
// Normal force = surfaceUnitNormal*(surfaceNormal & forceDensity) // Normal force = surfaceUnitNormal*(surfaceNormal & forceDensity)
vectorField fN vectorField fN
( (
Sfb[patchI]/sA Sfb[patchi]/sA
*( *(
Sfb[patchI] & fD.boundaryField()[patchI] Sfb[patchi] & fD.boundaryField()[patchi]
) )
); );
// Tangential force (total force minus normal fN) // Tangential force (total force minus normal fN)
vectorField fT(sA*fD.boundaryField()[patchI] - fN); vectorField fT(sA*fD.boundaryField()[patchi] - fN);
// Porous force // Porous force
vectorField fP(Md.size(), Zero); vectorField fP(Md.size(), Zero);
addToFields(patchI, Md, fN, fT, fP); addToFields(patchi, Md, fN, fT, fP);
applyBins(Md, fN, fT, fP, mesh_.C().boundaryField()[patchI]); applyBins(Md, fN, fT, fP, mesh_.C().boundaryField()[patchi]);
} }
} }
else else
@ -1035,25 +1035,25 @@ void Foam::functionObjects::forces::calcForcesMoment()
forAllConstIter(labelHashSet, patchSet_, iter) forAllConstIter(labelHashSet, patchSet_, iter)
{ {
label patchI = iter.key(); label patchi = iter.key();
vectorField Md vectorField Md
( (
mesh_.C().boundaryField()[patchI] - coordSys_.origin() mesh_.C().boundaryField()[patchi] - coordSys_.origin()
); );
vectorField fN vectorField fN
( (
rho(p)*Sfb[patchI]*(p.boundaryField()[patchI] - pRef) rho(p)*Sfb[patchi]*(p.boundaryField()[patchi] - pRef)
); );
vectorField fT(Sfb[patchI] & devRhoReffb[patchI]); vectorField fT(Sfb[patchi] & devRhoReffb[patchi]);
vectorField fP(Md.size(), Zero); vectorField fP(Md.size(), Zero);
addToFields(patchI, Md, fN, fT, fP); addToFields(patchi, Md, fN, fT, fP);
applyBins(Md, fN, fT, fP, mesh_.C().boundaryField()[patchI]); applyBins(Md, fN, fT, fP, mesh_.C().boundaryField()[patchi]);
} }
} }
@ -1085,8 +1085,8 @@ void Foam::functionObjects::forces::calcForcesMoment()
forAll(cellZoneIDs, i) forAll(cellZoneIDs, i)
{ {
label zoneI = cellZoneIDs[i]; label zonei = cellZoneIDs[i];
const cellZone& cZone = mesh_.cellZones()[zoneI]; const cellZone& cZone = mesh_.cellZones()[zonei];
const vectorField d(mesh_.C(), cZone); const vectorField d(mesh_.C(), cZone);
const vectorField fP(fPTot, cZone); const vectorField fP(fPTot, cZone);

View File

@ -305,7 +305,7 @@ protected:
//- Add patch contributions to force and moment fields //- Add patch contributions to force and moment fields
void addToFields void addToFields
( (
const label patchI, const label patchi,
const vectorField& Md, const vectorField& Md,
const vectorField& fN, const vectorField& fN,
const vectorField& fT, const vectorField& fT,

View File

@ -75,14 +75,14 @@ const Foam::NamedEnum
void Foam::functionObjects::runTimePostPro::pathline::addLines void Foam::functionObjects::runTimePostPro::pathline::addLines
( (
const label frameI, const label framei,
vtkActor* actor, vtkActor* actor,
vtkPolyData* data vtkPolyData* data
) const ) const
{ {
geometryBase::initialiseActor(actor); geometryBase::initialiseActor(actor);
vector colour = lineColour_->value(frameI); vector colour = lineColour_->value(framei);
actor->GetProperty()->SetColor(colour[0], colour[1], colour[2]); actor->GetProperty()->SetColor(colour[0], colour[1], colour[2]);
vtkPolyDataMapper* mapper = vtkPolyDataMapper* mapper =

View File

@ -104,7 +104,7 @@ protected:
//- Add the pathlines to the renderer //- Add the pathlines to the renderer
void addLines void addLines
( (
const label frameI, const label framei,
vtkActor* actor, vtkActor* actor,
vtkPolyData* data vtkPolyData* data
) const; ) const;

View File

@ -72,7 +72,7 @@ const Foam::NamedEnum
void Foam::functionObjects::runTimePostPro::pointData::addPoints void Foam::functionObjects::runTimePostPro::pointData::addPoints
( (
const label frameI, const label framei,
vtkActor* actor, vtkActor* actor,
vtkPolyDataMapper* mapper, vtkPolyDataMapper* mapper,
vtkPolyData* data vtkPolyData* data
@ -80,7 +80,7 @@ void Foam::functionObjects::runTimePostPro::pointData::addPoints
{ {
geometryBase::initialiseActor(actor); geometryBase::initialiseActor(actor);
vector colour = pointColour_->value(frameI); vector colour = pointColour_->value(framei);
actor->GetProperty()->SetColor(colour[0], colour[1], colour[2]); actor->GetProperty()->SetColor(colour[0], colour[1], colour[2]);
switch (representation_) switch (representation_)

View File

@ -102,7 +102,7 @@ protected:
//- Add the point data to the renderer //- Add the point data to the renderer
void addPoints void addPoints
( (
const label frameI, const label framei,
vtkActor* actor, vtkActor* actor,
vtkPolyDataMapper* mapper, vtkPolyDataMapper* mapper,
vtkPolyData* data vtkPolyData* data

View File

@ -41,7 +41,7 @@ Description
dsmcFields1 dsmcFields1
{ {
type dsmcFields; type dsmcFields;
functionObjectLibs ("libutilityFunctionObjects.so"); libs ("libutilityFunctionObjects.so");
... ...
} }
\endverbatim \endverbatim

View File

@ -64,14 +64,14 @@ Foam::functionObjects::runTimeControls::averageCondition::averageCondition
{ {
const dictionary& dict = conditionDict(); const dictionary& dict = conditionDict();
forAll(fieldNames_, fieldI) forAll(fieldNames_, fieldi)
{ {
const word& fieldName = fieldNames_[fieldI]; const word& fieldName = fieldNames_[fieldi];
if (dict.found(fieldName)) if (dict.found(fieldName))
{ {
const dictionary& valueDict = dict.subDict(fieldName); const dictionary& valueDict = dict.subDict(fieldName);
totalTime_[fieldI] = readScalar(valueDict.lookup("totalTime")); totalTime_[fieldi] = readScalar(valueDict.lookup("totalTime"));
} }
} }
} }
@ -101,11 +101,11 @@ bool Foam::functionObjects::runTimeControls::averageCondition::apply()
DynamicList<label> unprocessedFields(fieldNames_.size()); DynamicList<label> unprocessedFields(fieldNames_.size());
forAll(fieldNames_, fieldI) forAll(fieldNames_, fieldi)
{ {
const word& fieldName(fieldNames_[fieldI]); const word& fieldName(fieldNames_[fieldi]);
scalar Dt = totalTime_[fieldI]; scalar Dt = totalTime_[fieldi];
scalar alpha = (Dt - dt)/Dt; scalar alpha = (Dt - dt)/Dt;
scalar beta = dt/Dt; scalar beta = dt/Dt;
@ -133,10 +133,10 @@ bool Foam::functionObjects::runTimeControls::averageCondition::apply()
if (!processed) if (!processed)
{ {
unprocessedFields.append(fieldI); unprocessedFields.append(fieldi);
} }
totalTime_[fieldI] += dt; totalTime_[fieldi] += dt;
} }
if (unprocessedFields.size()) if (unprocessedFields.size())
@ -147,8 +147,8 @@ bool Foam::functionObjects::runTimeControls::averageCondition::apply()
forAll(unprocessedFields, i) forAll(unprocessedFields, i)
{ {
label fieldI = unprocessedFields[i]; label fieldi = unprocessedFields[i];
Info<< " " << fieldNames_[fieldI] << nl; Info<< " " << fieldNames_[fieldi] << nl;
} }
} }
@ -162,20 +162,20 @@ void Foam::functionObjects::runTimeControls::averageCondition::write()
{ {
dictionary& conditionDict = this->conditionDict(); dictionary& conditionDict = this->conditionDict();
forAll(fieldNames_, fieldI) forAll(fieldNames_, fieldi)
{ {
const word& fieldName = fieldNames_[fieldI]; const word& fieldName = fieldNames_[fieldi];
// value dictionary should be present - mean values are written there // value dictionary should be present - mean values are written there
if (conditionDict.found(fieldName)) if (conditionDict.found(fieldName))
{ {
dictionary& valueDict = conditionDict.subDict(fieldName); dictionary& valueDict = conditionDict.subDict(fieldName);
valueDict.add("totalTime", totalTime_[fieldI], true); valueDict.add("totalTime", totalTime_[fieldi], true);
} }
else else
{ {
dictionary valueDict; dictionary valueDict;
valueDict.add("totalTime", totalTime_[fieldI], true); valueDict.add("totalTime", totalTime_[fieldi], true);
conditionDict.add(fieldName, valueDict); conditionDict.add(fieldName, valueDict);
} }
} }

View File

@ -132,15 +132,15 @@ apply()
List<scalar> result(fieldNames_.size(), -VGREAT); List<scalar> result(fieldNames_.size(), -VGREAT);
forAll(fieldNames_, fieldI) forAll(fieldNames_, fieldi)
{ {
const word& fieldName = fieldNames_[fieldI]; const word& fieldName = fieldNames_[fieldi];
if (solverDict.found(fieldName)) if (solverDict.found(fieldName))
{ {
const List<solverPerformance> sp(solverDict.lookup(fieldName)); const List<solverPerformance> sp(solverDict.lookup(fieldName));
const scalar residual = sp.first().initialResidual(); const scalar residual = sp.first().initialResidual();
result[fieldI] = residual; result[fieldi] = residual;
switch (mode_) switch (mode_)
{ {
@ -203,14 +203,14 @@ apply()
<< ": satisfied using threshold value: " << value_ << nl; << ": satisfied using threshold value: " << value_ << nl;
} }
forAll(result, resultI) forAll(result, resulti)
{ {
if (result[resultI] > 0) if (result[resulti] > 0)
{ {
if (log_) if (log_)
{ {
Info<< " field: " << fieldNames_[resultI] Info<< " field: " << fieldNames_[resulti]
<< ", residual: " << result[resultI] << nl; << ", residual: " << result[resulti] << nl;
} }
} }
} }

View File

@ -105,15 +105,15 @@ bool Foam::functionObjects::runTimeControls::equationMaxIterCondition::apply()
List<label> result(fieldNames_.size(), -1); List<label> result(fieldNames_.size(), -1);
forAll(fieldNames_, fieldI) forAll(fieldNames_, fieldi)
{ {
const word& fieldName = fieldNames_[fieldI]; const word& fieldName = fieldNames_[fieldi];
if (solverDict.found(fieldName)) if (solverDict.found(fieldName))
{ {
const List<solverPerformance> sp(solverDict.lookup(fieldName)); const List<solverPerformance> sp(solverDict.lookup(fieldName));
const label nIterations = sp.first().nIterations(); const label nIterations = sp.first().nIterations();
result[fieldI] = nIterations; result[fieldi] = nIterations;
if (nIterations > threshold_) if (nIterations > threshold_)
{ {
@ -154,14 +154,14 @@ bool Foam::functionObjects::runTimeControls::equationMaxIterCondition::apply()
<< ": satisfied using threshold value: " << threshold_ << nl; << ": satisfied using threshold value: " << threshold_ << nl;
} }
forAll(result, resultI) forAll(result, resulti)
{ {
if (result[resultI] != -1) if (result[resulti] != -1)
{ {
if (log_) if (log_)
{ {
Info<< " field: " << fieldNames_[resultI] Info<< " field: " << fieldNames_[resulti]
<< ", iterations: " << result[resultI] << nl; << ", iterations: " << result[resulti] << nl;
} }
} }
} }

View File

@ -110,9 +110,9 @@ bool Foam::functionObjects::runTimeControls::minMaxCondition::apply()
return satisfied; return satisfied;
} }
forAll(fieldNames_, fieldI) forAll(fieldNames_, fieldi)
{ {
const word& fieldName = fieldNames_[fieldI]; const word& fieldName = fieldNames_[fieldi];
const word valueType = const word valueType =
state_.objectResultType(functionObjectName_, fieldName); state_.objectResultType(functionObjectName_, fieldName);

View File

@ -81,23 +81,23 @@ bool Foam::functionObjects::runTimeControls::runTimeControl::read
const wordList conditionNames(conditionsDict.toc()); const wordList conditionNames(conditionsDict.toc());
conditions_.setSize(conditionNames.size()); conditions_.setSize(conditionNames.size());
label uniqueGroupI = 0; label uniqueGroupi = 0;
forAll(conditionNames, conditionI) forAll(conditionNames, conditioni)
{ {
const word& conditionName = conditionNames[conditionI]; const word& conditionName = conditionNames[conditioni];
const dictionary& dict = conditionsDict.subDict(conditionName); const dictionary& dict = conditionsDict.subDict(conditionName);
conditions_.set conditions_.set
( (
conditionI, conditioni,
runTimeCondition::New(conditionName, obr_, dict, *this) runTimeCondition::New(conditionName, obr_, dict, *this)
); );
label groupI = conditions_[conditionI].groupID(); label groupi = conditions_[conditioni].groupID();
if (groupMap_.insert(groupI, uniqueGroupI)) if (groupMap_.insert(groupi, uniqueGroupi))
{ {
uniqueGroupI++; uniqueGroupi++;
} }
} }
@ -114,9 +114,9 @@ bool Foam::functionObjects::runTimeControls::runTimeControl::read
{ {
// Check that at least one condition is active // Check that at least one condition is active
bool active = false; bool active = false;
forAll(conditions_, conditionI) forAll(conditions_, conditioni)
{ {
if (conditions_[conditionI].active()) if (conditions_[conditioni].active())
{ {
active = true; active = true;
break; break;
@ -146,32 +146,32 @@ bool Foam::functionObjects::runTimeControls::runTimeControl::execute()
List<bool> groupSatisfied(groupMap_.size(), true); List<bool> groupSatisfied(groupMap_.size(), true);
List<bool> groupActive(groupMap_.size(), false); List<bool> groupActive(groupMap_.size(), false);
forAll(conditions_, conditionI) forAll(conditions_, conditioni)
{ {
runTimeCondition& condition = conditions_[conditionI]; runTimeCondition& condition = conditions_[conditioni];
if (condition.active()) if (condition.active())
{ {
bool conditionSatisfied = condition.apply(); bool conditionSatisfied = condition.apply();
label groupI = condition.groupID(); label groupi = condition.groupID();
Map<label>::const_iterator conditionIter = groupMap_.find(groupI); Map<label>::const_iterator conditionIter = groupMap_.find(groupi);
if (conditionIter == groupMap_.end()) if (conditionIter == groupMap_.end())
{ {
FatalErrorInFunction FatalErrorInFunction
<< "group " << groupI << " not found in map" << "group " << groupi << " not found in map"
<< abort(FatalError); << abort(FatalError);
} }
if (conditionSatisfied) if (conditionSatisfied)
{ {
IDs.append(conditionI); IDs.append(conditioni);
groupActive[conditionIter()] = true; groupActive[conditionIter()] = true;
if (groupI == -1) if (groupi == -1)
{ {
// Condition not part of a group - only requires this to be // Condition not part of a group - only requires this to be
// satisfied for completion flag to be set // satisfied for completion flag to be set
@ -187,9 +187,9 @@ bool Foam::functionObjects::runTimeControls::runTimeControl::execute()
} }
bool done = false; bool done = false;
forAll(groupSatisfied, groupI) forAll(groupSatisfied, groupi)
{ {
if (groupSatisfied[groupI] && groupActive[groupI]) if (groupSatisfied[groupi] && groupActive[groupi])
{ {
done = true; done = true;
break; break;
@ -198,10 +198,10 @@ bool Foam::functionObjects::runTimeControls::runTimeControl::execute()
if (done) if (done)
{ {
forAll(IDs, conditionI) forAll(IDs, conditioni)
{ {
Info<< " " << conditions_[conditionI].type() << ": " Info<< " " << conditions_[conditioni].type() << ": "
<< conditions_[conditionI].name() << conditions_[conditioni].name()
<< " condition satisfied" << nl; << " condition satisfied" << nl;
} }
@ -235,9 +235,9 @@ bool Foam::functionObjects::runTimeControls::runTimeControl::execute()
bool Foam::functionObjects::runTimeControls::runTimeControl::write() bool Foam::functionObjects::runTimeControls::runTimeControl::write()
{ {
forAll(conditions_, conditionI) forAll(conditions_, conditioni)
{ {
conditions_[conditionI].write(); conditions_[conditioni].write();
} }
return true; return true;

View File

@ -40,7 +40,7 @@ Description
setTimeStep1 setTimeStep1
{ {
type setTimeStep; type setTimeStep;
functionObjectLibs ("libutilityFunctionObjects.so"); libs ("libutilityFunctionObjects.so");
... ...
} }
\endverbatim \endverbatim

View File

@ -107,9 +107,9 @@ bool Foam::functionObjects::systemCall::read(const dictionary& dict)
bool Foam::functionObjects::systemCall::execute() bool Foam::functionObjects::systemCall::execute()
{ {
forAll(executeCalls_, callI) forAll(executeCalls_, calli)
{ {
Foam::system(executeCalls_[callI]); Foam::system(executeCalls_[calli]);
} }
return true; return true;
@ -118,9 +118,9 @@ bool Foam::functionObjects::systemCall::execute()
bool Foam::functionObjects::systemCall::end() bool Foam::functionObjects::systemCall::end()
{ {
forAll(endCalls_, callI) forAll(endCalls_, calli)
{ {
Foam::system(endCalls_[callI]); Foam::system(endCalls_[calli]);
} }
return true; return true;
@ -129,9 +129,9 @@ bool Foam::functionObjects::systemCall::end()
bool Foam::functionObjects::systemCall::write() bool Foam::functionObjects::systemCall::write()
{ {
forAll(writeCalls_, callI) forAll(writeCalls_, calli)
{ {
Foam::system(writeCalls_[callI]); Foam::system(writeCalls_[calli]);
} }
return true; return true;

View File

@ -50,14 +50,14 @@ namespace functionObjects
bool Foam::functionObjects::writeDictionary::tryDirectory bool Foam::functionObjects::writeDictionary::tryDirectory
( (
const label dictI, const label dicti,
const word& location, const word& location,
bool& firstDict bool& firstDict
) )
{ {
IOobject dictIO IOobject dictIO
( (
dictNames_[dictI], dictNames_[dicti],
location, location,
obr_, obr_,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -69,7 +69,7 @@ bool Foam::functionObjects::writeDictionary::tryDirectory
{ {
IOdictionary dict(dictIO); IOdictionary dict(dictIO);
if (dict.digest() != digests_[dictI]) if (dict.digest() != digests_[dicti])
{ {
if (firstDict) if (firstDict)
{ {
@ -84,7 +84,7 @@ bool Foam::functionObjects::writeDictionary::tryDirectory
IOobject::writeDivider(Info); IOobject::writeDivider(Info);
digests_[dictI] = dict.digest(); digests_[dicti] = dict.digest();
} }
return true; return true;

View File

@ -75,7 +75,7 @@ class writeDictionary
//- Helper function to write the dictionary if found at location //- Helper function to write the dictionary if found at location
bool tryDirectory bool tryDirectory
( (
const label dictI, const label dicti,
const word& location, const word& location,
bool& firstDict bool& firstDict
); );

View File

@ -993,21 +993,21 @@ Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine
cells.size()/100 cells.size()/100
); );
forAll(cells, cellI) forAll(cells, celli)
{ {
const cell& cFaces = cells[cellI]; const cell& cFaces = cells[celli];
label cLevel = cutter.cellLevel()[cellI]; label cLevel = cutter.cellLevel()[celli];
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
label faceI = cFaces[cFaceI]; label facei = cFaces[cFacei];
if (surfaceIndex[faceI] != -1) if (surfaceIndex[facei] != -1)
{ {
label fLevel = cutter.faceLevel(faceI); label fLevel = cutter.faceLevel(facei);
if (fLevel != cLevel) if (fLevel != cLevel)
{ {
transitionCells.insert(cellI); transitionCells.insert(celli);
} }
} }
} }
@ -1025,24 +1025,24 @@ Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine
//forAllConstIter(cellSet, transitionCells, iter) //forAllConstIter(cellSet, transitionCells, iter)
//{ //{
// label cellI = iter.key(); // label celli = iter.key();
// const cell& cFaces = cells[cellI]; // const cell& cFaces = cells[celli];
// const point& cc = cellCentres[cellI]; // const point& cc = cellCentres[celli];
// const scalar rCVol = pow(cellVolumes[cellI], -5.0/3.0); // const scalar rCVol = pow(cellVolumes[celli], -5.0/3.0);
// //
// // Determine principal axes of cell // // Determine principal axes of cell
// symmTensor R(Zero); // symmTensor R(Zero);
// //
// forAll(cFaces, i) // forAll(cFaces, i)
// { // {
// label faceI = cFaces[i]; // label facei = cFaces[i];
// //
// const point& fc = faceCentres[faceI]; // const point& fc = faceCentres[facei];
// //
// // Calculate face-pyramid volume // // Calculate face-pyramid volume
// scalar pyrVol = 1.0/3.0 * fA[faceI] & (fc-cc); // scalar pyrVol = 1.0/3.0 * fA[facei] & (fc-cc);
// //
// if (faceOwner[faceI] != cellI) // if (faceOwner[facei] != celli)
// { // {
// pyrVol = -pyrVol; // pyrVol = -pyrVol;
// } // }
@ -1066,17 +1066,17 @@ Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine
// labelVector plusFaceLevel(labelVector(-1, -1, -1)); // labelVector plusFaceLevel(labelVector(-1, -1, -1));
// labelVector minFaceLevel(labelVector(-1, -1, -1)); // labelVector minFaceLevel(labelVector(-1, -1, -1));
// //
// forAll(cFaces, cFaceI) // forAll(cFaces, cFacei)
// { // {
// label faceI = cFaces[cFaceI]; // label facei = cFaces[cFacei];
// //
// if (surfaceIndex[faceI] != -1) // if (surfaceIndex[facei] != -1)
// { // {
// label fLevel = cutter.faceLevel(faceI); // label fLevel = cutter.faceLevel(facei);
// //
// // Get outwards pointing normal // // Get outwards pointing normal
// vector n = fA[faceI]/mag(fA[faceI]); // vector n = fA[facei]/mag(fA[facei]);
// if (faceOwner[faceI] != cellI) // if (faceOwner[facei] != celli)
// { // {
// n = -n; // n = -n;
// } // }
@ -1129,7 +1129,7 @@ Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine
// && plusFaceLevel[dir] != minFaceLevel[dir] // && plusFaceLevel[dir] != minFaceLevel[dir]
// ) // )
// { // {
// candidateCellSet.insert(cellI); // candidateCellSet.insert(celli);
// } // }
// } // }
//} //}
@ -1138,26 +1138,26 @@ Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine
forAllConstIter(cellSet, transitionCells, iter) forAllConstIter(cellSet, transitionCells, iter)
{ {
label cellI = iter.key(); label celli = iter.key();
const cell& cFaces = cells[cellI]; const cell& cFaces = cells[celli];
label cLevel = cutter.cellLevel()[cellI]; label cLevel = cutter.cellLevel()[celli];
// Detect opposite intersection // Detect opposite intersection
bool foundOpposite = false; bool foundOpposite = false;
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
label faceI = cFaces[cFaceI]; label facei = cFaces[cFacei];
if if
( (
surfaceIndex[faceI] != -1 surfaceIndex[facei] != -1
&& cutter.faceLevel(faceI) > cLevel && cutter.faceLevel(facei) > cLevel
) )
{ {
// Get outwards pointing normal // Get outwards pointing normal
vector n = fA[faceI]/mag(fA[faceI]); vector n = fA[facei]/mag(fA[facei]);
if (faceOwner[faceI] != cellI) if (faceOwner[facei] != celli)
{ {
n = -n; n = -n;
} }
@ -1165,17 +1165,17 @@ Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine
// Check for any opposite intersection // Check for any opposite intersection
forAll(cFaces, cFaceI2) forAll(cFaces, cFaceI2)
{ {
label face2I = cFaces[cFaceI2]; label face2i = cFaces[cFaceI2];
if if
( (
face2I != faceI face2i != facei
&& surfaceIndex[face2I] != -1 && surfaceIndex[face2i] != -1
) )
{ {
// Get outwards pointing normal // Get outwards pointing normal
vector n2 = fA[face2I]/mag(fA[face2I]); vector n2 = fA[face2i]/mag(fA[face2i]);
if (faceOwner[face2I] != cellI) if (faceOwner[face2i] != celli)
{ {
n2 = -n2; n2 = -n2;
} }
@ -1199,7 +1199,7 @@ Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine
if (foundOpposite) if (foundOpposite)
{ {
candidateCellSet.insert(cellI); candidateCellSet.insert(celli);
} }
} }
@ -1813,22 +1813,22 @@ void Foam::snappyRefineDriver::addFaceZones
//const word slaveName = czNames.second()+"_to_"+czNames.first(); //const word slaveName = czNames.second()+"_to_"+czNames.first();
const word& slaveName = patchNames.second(); const word& slaveName = patchNames.second();
label mpI = meshRefiner.addMeshedPatch(masterName, patchInfo); label mpi = meshRefiner.addMeshedPatch(masterName, patchInfo);
Info<< setf(ios_base::left) Info<< setf(ios_base::left)
<< setw(6) << mpI << setw(6) << mpi
<< setw(20) << mesh.boundaryMesh()[mpI].type() << setw(20) << mesh.boundaryMesh()[mpi].type()
<< setw(30) << masterName << setw(30) << masterName
<< setw(30) << fzName << setw(30) << fzName
<< setw(10) << surfaceZonesInfo::faceZoneTypeNames[fzType] << setw(10) << surfaceZonesInfo::faceZoneTypeNames[fzType]
<< nl; << nl;
label slI = meshRefiner.addMeshedPatch(slaveName, patchInfo); label sli = meshRefiner.addMeshedPatch(slaveName, patchInfo);
Info<< setf(ios_base::left) Info<< setf(ios_base::left)
<< setw(6) << slI << setw(6) << sli
<< setw(20) << mesh.boundaryMesh()[slI].type() << setw(20) << mesh.boundaryMesh()[sli].type()
<< setw(30) << slaveName << setw(30) << slaveName
<< setw(30) << fzName << setw(30) << fzName
<< setw(10) << surfaceZonesInfo::faceZoneTypeNames[fzType] << setw(10) << surfaceZonesInfo::faceZoneTypeNames[fzType]

File diff suppressed because it is too large Load Diff

View File

@ -45,15 +45,15 @@ Foam::labelList Foam::snappySnapDriver::getFacePoints
forAll(f, fp) forAll(f, fp)
{ {
label meshPointI = f[fp]; label meshPointi = f[fp];
Map<label>::const_iterator iter = Map<label>::const_iterator iter =
pp.meshPointMap().find(meshPointI); pp.meshPointMap().find(meshPointi);
if (iter != pp.meshPointMap().end()) if (iter != pp.meshPointMap().end())
{ {
label pointI = iter(); label pointi = iter();
pointOnZone[pointI] = true; pointOnZone[pointi] = true;
} }
} }
} }

View File

@ -37,7 +37,7 @@ Description
patchProbes patchProbes
{ {
type patchProbes; type patchProbes;
functionObjectLibs ( "libsampling.so" ); libs ( "libsampling.so" );
// Name of the directory for probe data // Name of the directory for probe data
name patchProbes; name patchProbes;
@ -46,14 +46,11 @@ Description
patches (".*inl.*"); patches (".*inl.*");
// Write at same frequency as fields // Write at same frequency as fields
outputControl outputTime; writeControl writeTime;
outputInterval 1; writeInterval 1;
// Fields to be probed // Fields to be probed
fields fields (p U);
(
p U
);
// Locations to probe. These get snapped onto the nearest point // Locations to probe. These get snapped onto the nearest point
// on the selected patches // on the selected patches

View File

@ -37,20 +37,17 @@ Description
probes probes
{ {
type probes; type probes;
functionObjectLibs ( "libsampling.so" ); libs ("libsampling.so");
// Name of the directory for probe data // Name of the directory for probe data
name probes; name probes;
// Write at same frequency as fields // Write at same frequency as fields
outputControl outputTime; writeControl outputTime;
outputInterval 1; writeInterval 1;
// Fields to be probed // Fields to be probed
fields fields (p U);
(
p U
);
// Optional: do not recalculate cells if mesh moves // Optional: do not recalculate cells if mesh moves
fixedLocations false; fixedLocations false;

View File

@ -56,7 +56,7 @@ functions
{ {
sensitivityAnalysis sensitivityAnalysis
{ {
functionObjectLibs ("libfieldFunctionObjects.so"); libs ("libfieldFunctionObjects.so");
type psiReactionsSensitivityAnalysis; type psiReactionsSensitivityAnalysis;
writeControl writeTime; writeControl writeTime;
} }

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

View File

@ -2,7 +2,7 @@
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile

Some files were not shown because too many files have changed in this diff Show More