mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev
Conflicts: applications/utilities/postProcessing/dataConversion/foamToTecplot360/Allwmake
This commit is contained in:
@ -98,10 +98,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (THeader.headerOk() && Uheader.headerOk())
|
||||
{
|
||||
Info << "Reading T" << endl;
|
||||
Info<< "Reading T" << endl;
|
||||
volScalarField T(THeader, mesh);
|
||||
|
||||
Info << "Reading U" << endl;
|
||||
Info<< "Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
# include "createPhi.H"
|
||||
|
||||
@ -93,10 +93,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (pHeader.headerOk() && Uheader.headerOk())
|
||||
{
|
||||
Info << "Reading p" << endl;
|
||||
Info<< "Reading p" << endl;
|
||||
volScalarField p(pHeader, mesh);
|
||||
|
||||
Info << "Reading U" << endl;
|
||||
Info<< "Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
# include "createPhi.H"
|
||||
|
||||
@ -94,10 +94,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (pHeader.headerOk() && Uheader.headerOk())
|
||||
{
|
||||
Info << "Reading p" << endl;
|
||||
Info<< "Reading p" << endl;
|
||||
volScalarField p(pHeader, mesh);
|
||||
|
||||
Info << "Reading U" << endl;
|
||||
Info<< "Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
# include "createPhi.H"
|
||||
|
||||
@ -99,10 +99,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (THeader.headerOk() && Uheader.headerOk())
|
||||
{
|
||||
Info << "Reading T" << endl;
|
||||
Info<< "Reading T" << endl;
|
||||
volScalarField T(THeader, mesh);
|
||||
|
||||
Info << "Reading U" << endl;
|
||||
Info<< "Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
# include "createPhi.H"
|
||||
|
||||
@ -1015,7 +1015,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
Info << "End\n" << endl;
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -596,7 +596,7 @@ int main(int argc, char *argv[])
|
||||
mesh.write();
|
||||
}
|
||||
|
||||
Info << "End\n" << endl;
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -510,7 +510,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "Mesh unchanged." << endl;
|
||||
}
|
||||
|
||||
Info << "End\n" << endl;
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1,215 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::Tuple
|
||||
|
||||
Description
|
||||
A 2 Tuple. Differs from Tuple in that the two elements can be different
|
||||
type.
|
||||
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Tuple_H
|
||||
#define Tuple_H
|
||||
|
||||
#include "Istream.H"
|
||||
#include "Ostream.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
template<class Type1, class Type2>
|
||||
class Tuple;
|
||||
|
||||
template<class Type1, class Type2>
|
||||
Istream& operator>>(Istream&, Tuple<Type1, Type2>&);
|
||||
|
||||
template<class Type1, class Type2>
|
||||
Ostream& operator<<(Ostream&, const Tuple<Type1, Type2>&);
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Tuple Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type1, class Type2>
|
||||
class Tuple
|
||||
{
|
||||
// Private data
|
||||
|
||||
Type1 first_;
|
||||
Type2 second_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Null constructor for lists
|
||||
inline Tuple()
|
||||
{}
|
||||
|
||||
//- Construct from components
|
||||
inline Tuple(const Type1& first, const Type2& second)
|
||||
:
|
||||
first_(first),
|
||||
second_(second)
|
||||
{}
|
||||
|
||||
//- Construct from Istream
|
||||
inline Tuple(Istream& is)
|
||||
{
|
||||
// Read beginning of pair
|
||||
is.readBegin("pair");
|
||||
|
||||
is >> first_ >> second_;
|
||||
|
||||
// Read end of pair
|
||||
is.readEnd("pair");
|
||||
|
||||
// Check state of Istream
|
||||
is.check("Tuple::Tuple(Istream&)");
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return first
|
||||
inline Type1 first() const
|
||||
{
|
||||
return first_;
|
||||
}
|
||||
|
||||
//- Return first
|
||||
inline Type1& first()
|
||||
{
|
||||
return first_;
|
||||
}
|
||||
|
||||
//- Return second
|
||||
inline Type2 second() const
|
||||
{
|
||||
return second_;
|
||||
}
|
||||
|
||||
//- Return second
|
||||
inline Type2& second()
|
||||
{
|
||||
return second_;
|
||||
}
|
||||
|
||||
//- Return reverse pair
|
||||
inline Tuple<Type1, Type2> reverseTuple() const
|
||||
{
|
||||
return Tuple<Type1, Type2>(second_, first_);
|
||||
}
|
||||
|
||||
|
||||
// Friend Operators
|
||||
|
||||
inline friend bool operator==
|
||||
(
|
||||
const Tuple<Type1, Type2>& a,
|
||||
const Tuple<Type1, Type2>& b
|
||||
)
|
||||
{
|
||||
return
|
||||
(
|
||||
(a.first_ == b.first_) && (a.second_ == b.second_)
|
||||
);
|
||||
}
|
||||
|
||||
inline friend bool operator!=
|
||||
(
|
||||
const Tuple<Type1, Type2>& a,
|
||||
const Tuple<Type1, Type2>& b
|
||||
)
|
||||
{
|
||||
return (!(a == b));
|
||||
}
|
||||
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Istream& operator>> <Type1, Type2>
|
||||
(
|
||||
Istream& is,
|
||||
Tuple<Type1, Type2>& p
|
||||
);
|
||||
friend Ostream& operator<< <Type1, Type2>
|
||||
(
|
||||
Ostream& os,
|
||||
const Tuple<Type1, Type2>& p
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type1, class Type2>
|
||||
Istream& operator>>(Istream& is, Tuple<Type1, Type2>& p)
|
||||
{
|
||||
// Read beginning of Tuple<Type, Type>
|
||||
is.readBegin("Tuple<Type, Type>");
|
||||
|
||||
is >> p.first_ >> p.second_;
|
||||
|
||||
// Read end of Tuple<Type, Type>
|
||||
is.readEnd("Tuple<Type, Type>");
|
||||
|
||||
// Check state of Ostream
|
||||
is.check("Istream& operator>>(Istream&, Tuple<Type, Type>&)");
|
||||
|
||||
return is;
|
||||
}
|
||||
|
||||
template<class Type1, class Type2>
|
||||
Ostream& operator<<(Ostream& os, const Tuple<Type1, Type2>& p)
|
||||
{
|
||||
os << token::BEGIN_LIST
|
||||
<< p.first_ << token::SPACE
|
||||
<< p.second_
|
||||
<< token::END_LIST;
|
||||
|
||||
// Check state of Ostream
|
||||
os.check("Ostream& operator<<(Ostream&, const Tuple<Type, Type>&)");
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -375,8 +375,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
bool cellsToSplit = cellsToPyramidise.size();
|
||||
|
||||
//List<Tuple<pointField,point> >
|
||||
// cellsToCreate(dict.lookup("cellsToCreate"));
|
||||
// List<Tuple2<pointField,point> >
|
||||
// cellsToCreate(dict.lookup("cellsToCreate"));
|
||||
|
||||
Info<< "Read from " << dict.name() << nl
|
||||
<< " Boundary cutting module:" << nl
|
||||
@ -560,7 +560,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Write resulting mesh
|
||||
Info << "Writing modified mesh to time " << runTime.timeName() << endl;
|
||||
Info<< "Writing modified mesh to time " << runTime.timeName() << endl;
|
||||
mesh.write();
|
||||
}
|
||||
else if (edgeToPos.size())
|
||||
@ -613,7 +613,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Write resulting mesh
|
||||
Info << "Writing modified mesh to time " << runTime.timeName() << endl;
|
||||
Info<< "Writing modified mesh to time " << runTime.timeName() << endl;
|
||||
mesh.write();
|
||||
}
|
||||
else
|
||||
@ -656,13 +656,12 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Write resulting mesh
|
||||
Info << "Writing modified mesh to time " << runTime.timeName() << endl;
|
||||
Info<< "Writing modified mesh to time " << runTime.timeName() << endl;
|
||||
mesh.write();
|
||||
}
|
||||
|
||||
|
||||
Info << nl << "End" << endl;
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -234,11 +234,11 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Write resulting mesh
|
||||
Info << "Writing refined morphMesh to time " << runTime.timeName() << endl;
|
||||
Info<< "Writing refined morphMesh to time " << runTime.timeName() << endl;
|
||||
|
||||
mesh.write();
|
||||
|
||||
Info << "End\n" << endl;
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -126,41 +126,41 @@ int main(int argc, char *argv[])
|
||||
// Create bin0. Have upperlimit as factor times lowerlimit.
|
||||
bins.append(DynamicList<label>());
|
||||
lowerLimits.append(sortedVols[0]);
|
||||
upperLimits.append(1.1*lowerLimits[lowerLimits.size()-1]);
|
||||
upperLimits.append(1.1 * lowerLimits.last());
|
||||
|
||||
forAll(sortedVols, i)
|
||||
{
|
||||
if (sortedVols[i] > upperLimits[upperLimits.size()-1])
|
||||
if (sortedVols[i] > upperLimits.last())
|
||||
{
|
||||
// New value outside of current bin
|
||||
|
||||
// Shrink old bin.
|
||||
DynamicList<label>& bin = bins[bins.size()-1];
|
||||
DynamicList<label>& bin = bins.last();
|
||||
|
||||
bin.shrink();
|
||||
|
||||
Info<< "Collected " << bin.size() << " elements in bin "
|
||||
<< lowerLimits[lowerLimits.size()-1] << " .. "
|
||||
<< upperLimits[upperLimits.size()-1] << endl;
|
||||
<< lowerLimits.last() << " .. "
|
||||
<< upperLimits.last() << endl;
|
||||
|
||||
// Create new bin.
|
||||
bins.append(DynamicList<label>());
|
||||
lowerLimits.append(sortedVols[i]);
|
||||
upperLimits.append(1.1*lowerLimits[lowerLimits.size()-1]);
|
||||
upperLimits.append(1.1 * lowerLimits.last());
|
||||
|
||||
Info<< "Creating new bin " << lowerLimits[lowerLimits.size()-1]
|
||||
<< " .. " << upperLimits[upperLimits.size()-1]
|
||||
Info<< "Creating new bin " << lowerLimits.last()
|
||||
<< " .. " << upperLimits.last()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
// Append to current bin.
|
||||
DynamicList<label>& bin = bins[bins.size()-1];
|
||||
DynamicList<label>& bin = bins.last();
|
||||
|
||||
bin.append(sortedVols.indices()[i]);
|
||||
}
|
||||
Info<< endl;
|
||||
|
||||
bins[bins.size()-1].shrink();
|
||||
bins.last().shrink();
|
||||
bins.shrink();
|
||||
lowerLimits.shrink();
|
||||
upperLimits.shrink();
|
||||
@ -355,8 +355,7 @@ int main(int argc, char *argv[])
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info << nl << "End" << endl;
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -469,7 +469,7 @@ int main(int argc, char *argv[])
|
||||
MESH, // meshType
|
||||
NONMESH, // fill type
|
||||
mesh.nCells()
|
||||
);
|
||||
);
|
||||
|
||||
|
||||
Info<< "Removing points connecting cells unconnected by faces ..."
|
||||
@ -510,7 +510,7 @@ int main(int argc, char *argv[])
|
||||
writeSet(selectedCells, "cells selected for meshing");
|
||||
|
||||
|
||||
Info << "End\n" << endl;
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -701,7 +701,7 @@ int main(int argc, char *argv[])
|
||||
mesh.write();
|
||||
}
|
||||
|
||||
Info << "End\n" << endl;
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -264,10 +264,10 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
yyFlexLexer lexer(&ansysStream);
|
||||
while(lexer.yylex() != 0)
|
||||
while (lexer.yylex() != 0)
|
||||
{}
|
||||
|
||||
Info << "Creating points" << endl;
|
||||
Info<< "Creating points" << endl;
|
||||
|
||||
pointField points(slPoints.size());
|
||||
|
||||
@ -297,7 +297,7 @@ int main(int argc, char *argv[])
|
||||
pointMap[pointMapIter()] = i++;
|
||||
}
|
||||
|
||||
Info << "Creating cells" << endl;
|
||||
Info<< "Creating cells" << endl;
|
||||
|
||||
labelList cellMap(maxCelli+1);
|
||||
|
||||
@ -409,7 +409,7 @@ int main(int argc, char *argv[])
|
||||
{ 4, 2, 1, 3, 0, 5}, // hex
|
||||
};
|
||||
|
||||
Info << "Creating boundary patches" << endl;
|
||||
Info<< "Creating boundary patches" << endl;
|
||||
|
||||
faceListList boundary(slPatchCells.size());
|
||||
wordList patchNames(slPatchCells.size());
|
||||
@ -442,11 +442,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
boundary[patchI] = patchFaces;
|
||||
patchNames[patchI] = word("patch") + name(patchI + 1);
|
||||
Info << "Patch " << patchI << " named " << patchNames[patchI]
|
||||
Info<< "Patch " << patchI << " named " << patchNames[patchI]
|
||||
<< ": " << boundary[patchI].size() << " faces" << endl;
|
||||
}
|
||||
|
||||
Info << "ansysToFoam: " << endl
|
||||
Info<< "ansysToFoam: " << endl
|
||||
<< "Ansys file format does not provide information about the type of "
|
||||
<< "the patch (eg. wall, symmetry plane, cyclic etc)." << endl
|
||||
<< "All the patches have been created "
|
||||
@ -491,7 +491,7 @@ int main(int argc, char *argv[])
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
Info << "Writing polyMesh" << endl;
|
||||
Info<< "Writing polyMesh" << endl;
|
||||
pShapeMesh.write();
|
||||
|
||||
Info<< nl << "end" << endl;
|
||||
|
||||
@ -73,7 +73,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
cfxFile >> nblock >> npatch >> nglue >> nelem >> npoint;
|
||||
|
||||
Info << "Reading blocks" << endl;
|
||||
Info<< "Reading blocks" << endl;
|
||||
|
||||
PtrList<hexBlock> blocks(nblock);
|
||||
|
||||
@ -90,7 +90,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
Info << "Reading patch definitions" << endl;
|
||||
Info<< "Reading patch definitions" << endl;
|
||||
|
||||
wordList cfxPatchTypes(npatch);
|
||||
wordList cfxPatchNames(npatch);
|
||||
@ -126,7 +126,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
Info << "Reading block glueing information" << endl;
|
||||
Info<< "Reading block glueing information" << endl;
|
||||
|
||||
labelList glueMasterPatches(nglue, -1);
|
||||
labelList glueSlavePatches(nglue, -1);
|
||||
@ -145,15 +145,15 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
Info << "Reading block points" << endl;
|
||||
Info<< "Reading block points" << endl;
|
||||
|
||||
forAll (blocks, blockI)
|
||||
{
|
||||
Info << "block " << blockI << " is a ";
|
||||
Info<< "block " << blockI << " is a ";
|
||||
blocks[blockI].readPoints(cfxFile);
|
||||
}
|
||||
|
||||
Info << "Calculating block offsets" << endl;
|
||||
Info<< "Calculating block offsets" << endl;
|
||||
|
||||
labelList blockOffsets(nblock, -1);
|
||||
|
||||
@ -172,7 +172,7 @@ int main(int argc, char *argv[])
|
||||
+ blocks[blockI - 1].nBlockPoints();
|
||||
}
|
||||
|
||||
Info << "Assembling patches" << endl;
|
||||
Info<< "Assembling patches" << endl;
|
||||
|
||||
faceListList rawPatches(npatch);
|
||||
|
||||
@ -203,13 +203,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
Info << "Merging points ";
|
||||
Info<< "Merging points ";
|
||||
|
||||
labelList pointMergeList(nMeshPoints, -1);
|
||||
|
||||
// In order to ensure robust merging, it is necessary to traverse
|
||||
// the patch glueing list until the pointMergeList stops changing.
|
||||
//
|
||||
//
|
||||
|
||||
// For efficiency, create merge pairs in the first pass
|
||||
labelListListList glueMergePairs(glueMasterPatches.size());
|
||||
@ -396,7 +396,7 @@ int main(int argc, char *argv[])
|
||||
)
|
||||
{
|
||||
changedPointMerge = true;
|
||||
|
||||
|
||||
pointMergeList[PpointLabel]
|
||||
= pointMergeList[NpointLabel]
|
||||
= min
|
||||
@ -408,10 +408,10 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
}
|
||||
Info << "." << flush;
|
||||
Info<< "." << flush;
|
||||
}
|
||||
while (changedPointMerge && nPasses < 8);
|
||||
Info << endl;
|
||||
Info<< endl;
|
||||
|
||||
if (changedPointMerge == true)
|
||||
{
|
||||
@ -509,7 +509,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
nMeshPoints = nNewPoints;
|
||||
|
||||
Info << "Creating points" << endl;
|
||||
Info<< "Creating points" << endl;
|
||||
|
||||
pointField points(nMeshPoints);
|
||||
|
||||
@ -536,7 +536,7 @@ int main(int argc, char *argv[])
|
||||
points *= scaleFactor;
|
||||
}
|
||||
|
||||
Info << "Creating cells" << endl;
|
||||
Info<< "Creating cells" << endl;
|
||||
|
||||
cellShapeList cellShapes(nMeshCells);
|
||||
|
||||
@ -568,7 +568,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
Info << "Creating boundary patches" << endl;
|
||||
Info<< "Creating boundary patches" << endl;
|
||||
|
||||
faceListList boundary(npatch);
|
||||
wordList patchNames(npatch);
|
||||
@ -600,7 +600,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (existingPatch >= 0)
|
||||
{
|
||||
Info << "CFX patch " << patchI
|
||||
Info<< "CFX patch " << patchI
|
||||
<< ", of type " << cfxPatchTypes[patchI]
|
||||
<< ", name " << cfxPatchNames[patchI]
|
||||
<< " already exists as FOAM patch " << existingPatch
|
||||
@ -652,7 +652,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
Info << "CFX patch " << patchI
|
||||
Info<< "CFX patch " << patchI
|
||||
<< ", of type " << cfxPatchTypes[patchI]
|
||||
<< ", name " << cfxPatchNames[patchI]
|
||||
<< " converted into FOAM patch " << nCreatedPatches
|
||||
@ -660,7 +660,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (cfxPatchTypes[patchI] == "WALL")
|
||||
{
|
||||
Info << "wall." << endl;
|
||||
Info<< "wall." << endl;
|
||||
|
||||
patchTypes[nCreatedPatches] = wallPolyPatch::typeName;
|
||||
patchNames[nCreatedPatches] = cfxPatchNames[patchI];
|
||||
@ -668,7 +668,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (cfxPatchTypes[patchI] == "SYMMET")
|
||||
{
|
||||
Info << "symmetryPlane." << endl;
|
||||
Info<< "symmetryPlane." << endl;
|
||||
|
||||
patchTypes[nCreatedPatches] = symmetryPolyPatch::typeName;
|
||||
patchNames[nCreatedPatches] = cfxPatchNames[patchI];
|
||||
@ -683,7 +683,7 @@ int main(int argc, char *argv[])
|
||||
|| cfxPatchTypes[patchI] == "USER2D"
|
||||
)
|
||||
{
|
||||
Info << "generic." << endl;
|
||||
Info<< "generic." << endl;
|
||||
|
||||
patchTypes[nCreatedPatches] = polyPatch::typeName;
|
||||
patchNames[nCreatedPatches] = cfxPatchNames[patchI];
|
||||
@ -737,10 +737,10 @@ int main(int argc, char *argv[])
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
Info << "Writing polyMesh" << endl;
|
||||
Info<< "Writing polyMesh" << endl;
|
||||
pShapeMesh.write();
|
||||
|
||||
Info << "End\n" << endl;
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -70,12 +70,12 @@ void hexBlock::readPoints(Istream& is)
|
||||
|
||||
if (((i ^ j) & k) > 0)
|
||||
{
|
||||
Info << "right-handed block" << endl;
|
||||
Info<< "right-handed block" << endl;
|
||||
blockHandedness_ = right;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << "left-handed block" << endl;
|
||||
Info<< "left-handed block" << endl;
|
||||
blockHandedness_ = left;
|
||||
}
|
||||
}
|
||||
|
||||
@ -324,7 +324,7 @@ endOfSection {space}")"{space}
|
||||
// point group type skipped
|
||||
strtol(endPtr, &endPtr, 16);
|
||||
|
||||
pointi = pointGroupStartIndex[pointGroupStartIndex.size()-1];
|
||||
pointi = pointGroupStartIndex.last();
|
||||
|
||||
// reset number of components to default
|
||||
pointGroupNumberOfComponents = 3;
|
||||
@ -336,11 +336,11 @@ endOfSection {space}")"{space}
|
||||
}
|
||||
|
||||
Info<< "PointGroup: "
|
||||
<< pointGroupZoneID[pointGroupZoneID.size()-1]
|
||||
<< pointGroupZoneID.last()
|
||||
<< " start: "
|
||||
<< pointGroupStartIndex[pointGroupStartIndex.size()-1]
|
||||
<< pointGroupStartIndex.last()
|
||||
<< " end: "
|
||||
<< pointGroupEndIndex[pointGroupEndIndex.size()-1] << flush;
|
||||
<< pointGroupEndIndex.last() << flush;
|
||||
}
|
||||
|
||||
<readNumberOfPoints,readPointGroupData>{endOfSection} {
|
||||
@ -387,14 +387,14 @@ endOfSection {space}")"{space}
|
||||
Info<< "done." << endl;
|
||||
|
||||
// check read of points
|
||||
if (pointi != pointGroupEndIndex[pointGroupEndIndex.size()-1]+1)
|
||||
if (pointi != pointGroupEndIndex.last()+1)
|
||||
{
|
||||
Warning
|
||||
<< "Problem with reading points: " << nl
|
||||
<< " start index: "
|
||||
<< pointGroupStartIndex[pointGroupStartIndex.size()-1]
|
||||
<< pointGroupStartIndex.last()
|
||||
<< " end index: "
|
||||
<< pointGroupEndIndex[pointGroupEndIndex.size()-1]
|
||||
<< pointGroupEndIndex.last()
|
||||
<< " last points read: " << pointi << nl
|
||||
<< " on line " << lineNo << endl;
|
||||
}
|
||||
@ -440,14 +440,14 @@ endOfSection {space}")"{space}
|
||||
|
||||
faceGroupElementType = strtol(endPtr, &endPtr, 16);
|
||||
|
||||
facei = faceGroupStartIndex[faceGroupStartIndex.size()-1];
|
||||
facei = faceGroupStartIndex.last();
|
||||
|
||||
Info<< "FaceGroup: "
|
||||
<< faceGroupZoneID[faceGroupZoneID.size()-1]
|
||||
<< faceGroupZoneID.last()
|
||||
<< " start: "
|
||||
<< faceGroupStartIndex[faceGroupStartIndex.size()-1]
|
||||
<< faceGroupStartIndex.last()
|
||||
<< " end: "
|
||||
<< faceGroupEndIndex[faceGroupEndIndex.size()-1] << flush;
|
||||
<< faceGroupEndIndex.last() << flush;
|
||||
}
|
||||
|
||||
<readNumberOfFaces,readFaceGroupData>{space}{endOfSection} {
|
||||
@ -507,14 +507,14 @@ endOfSection {space}")"{space}
|
||||
Info<< "done." << endl;
|
||||
|
||||
// check read of fluentFaces
|
||||
if (facei != faceGroupEndIndex[faceGroupEndIndex.size()-1]+1)
|
||||
if (facei != faceGroupEndIndex.last()+1)
|
||||
{
|
||||
Warning
|
||||
<< "Problem with reading fluentFaces: " << nl
|
||||
<< " start index: "
|
||||
<< faceGroupStartIndex[faceGroupStartIndex.size()-1]
|
||||
<< faceGroupStartIndex.last()
|
||||
<< " end index: "
|
||||
<< faceGroupEndIndex[faceGroupEndIndex.size()-1]
|
||||
<< faceGroupEndIndex.last()
|
||||
<< " last fluentFaces read: " << facei << nl
|
||||
<< " on line " << lineNo << endl;
|
||||
}
|
||||
@ -560,13 +560,13 @@ endOfSection {space}")"{space}
|
||||
cellGroupType.append(strtol(endPtr, &endPtr, 16));
|
||||
|
||||
Info<< "CellGroup: "
|
||||
<< cellGroupZoneID[cellGroupZoneID.size()-1]
|
||||
<< cellGroupZoneID.last()
|
||||
<< " start: "
|
||||
<< cellGroupStartIndex[cellGroupStartIndex.size()-1]
|
||||
<< cellGroupStartIndex.last()
|
||||
<< " end: "
|
||||
<< cellGroupEndIndex[cellGroupEndIndex.size()-1]
|
||||
<< cellGroupEndIndex.last()
|
||||
<< " type: "
|
||||
<< cellGroupType[cellGroupType.size()-1]
|
||||
<< cellGroupType.last()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -587,13 +587,13 @@ endOfSection {space}")"{space}
|
||||
strtol(endPtr, &endPtr, 16);
|
||||
|
||||
Info<< "CellGroup: "
|
||||
<< cellGroupZoneID[cellGroupZoneID.size()-1]
|
||||
<< cellGroupZoneID.last()
|
||||
<< " start: "
|
||||
<< cellGroupStartIndex[cellGroupStartIndex.size()-1]
|
||||
<< cellGroupStartIndex.last()
|
||||
<< " end: "
|
||||
<< cellGroupEndIndex[cellGroupEndIndex.size()-1]
|
||||
<< cellGroupEndIndex.last()
|
||||
<< " type: "
|
||||
<< cellGroupType[cellGroupType.size()-1]
|
||||
<< cellGroupType.last()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -813,7 +813,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
yyFlexLexer lexer(&fluentStream.stdStream());
|
||||
|
||||
while(lexer.yylex() != 0)
|
||||
while (lexer.yylex() != 0)
|
||||
{}
|
||||
|
||||
Info<< "\nFINISHED LEXING\n\n";
|
||||
@ -973,7 +973,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Set the owner of these faces to -1 so that they do not get
|
||||
// added to the mesh
|
||||
for(label facei = start; facei <= end; facei++)
|
||||
for (label facei = start; facei <= end; facei++)
|
||||
{
|
||||
owner[facei] = -1;
|
||||
}
|
||||
@ -1356,7 +1356,7 @@ int main(int argc, char *argv[])
|
||||
mesh.write();
|
||||
|
||||
|
||||
Info<< nl << "End" << endl;
|
||||
Info<< "\nEnd\n" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -898,7 +898,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
yyFlexLexer lexer(&fluentStream);
|
||||
while(lexer.yylex() != 0)
|
||||
while (lexer.yylex() != 0)
|
||||
{}
|
||||
|
||||
Info<< "\n\nFINISHED LEXING\n\n\n";
|
||||
@ -1388,7 +1388,7 @@ int main(int argc, char *argv[])
|
||||
meshFaces[j] = cMeshFace;
|
||||
pFaceSet.insert(cMeshFace);
|
||||
}
|
||||
if(writeSets)
|
||||
if (writeSets)
|
||||
{
|
||||
Info<< "Writing patch " << patchNames[patchI]
|
||||
<< " of size " << sz << " to faceSet." << endl;
|
||||
@ -1404,7 +1404,11 @@ int main(int argc, char *argv[])
|
||||
//it will be put in a default wall boundary
|
||||
//internal boundaries are simply ignored
|
||||
|
||||
if(patchTypes[patchI] != "internal" && !pShapeMesh.isInternalFace(meshFaces[0]))
|
||||
if
|
||||
(
|
||||
patchTypes[patchI] != "internal"
|
||||
&& !pShapeMesh.isInternalFace(meshFaces[0])
|
||||
)
|
||||
{
|
||||
//first face is external and has valid non-internal type
|
||||
|
||||
@ -1423,7 +1427,7 @@ int main(int argc, char *argv[])
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if(facePatchID[faceI - pShapeMesh.nInternalFaces()]!= -1)
|
||||
if (facePatchID[faceI - pShapeMesh.nInternalFaces()]!= -1)
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Face " << faceI << " on new patch "
|
||||
@ -1475,7 +1479,7 @@ int main(int argc, char *argv[])
|
||||
DynamicList<label> defaultBoundaryFaces(facePatchID.size());
|
||||
forAll(facePatchID, idI)
|
||||
{
|
||||
if(facePatchID[idI] == -1)
|
||||
if (facePatchID[idI] == -1)
|
||||
{
|
||||
defaultBoundaryFaces.append(idI);
|
||||
facePatchID[idI] = nBoundaries;
|
||||
@ -1575,50 +1579,50 @@ int main(int argc, char *argv[])
|
||||
boundaryZones[pI].append(bPatches[pI].name());
|
||||
}
|
||||
|
||||
label cnt=0;
|
||||
SLList<label>::iterator cg = cellGroupZoneID.begin();
|
||||
SLList<label>::iterator start = cellGroupStartIndex.begin();
|
||||
SLList<label>::iterator end = cellGroupEndIndex.begin();
|
||||
label cnt=0;
|
||||
SLList<label>::iterator cg = cellGroupZoneID.begin();
|
||||
SLList<label>::iterator start = cellGroupStartIndex.begin();
|
||||
SLList<label>::iterator end = cellGroupEndIndex.begin();
|
||||
|
||||
for (; cg != cellGroupZoneID.end(); ++cg, ++start, ++end)
|
||||
{
|
||||
const word& name = patchNameIDs[cg()];
|
||||
const word& type = patchTypeIDs[cg()];
|
||||
for (; cg != cellGroupZoneID.end(); ++cg, ++start, ++end)
|
||||
{
|
||||
const word& name = patchNameIDs[cg()];
|
||||
const word& type = patchTypeIDs[cg()];
|
||||
|
||||
Info<< "Writing cell zone: " << name
|
||||
Info<< "Writing cell zone: " << name
|
||||
<< " of type " << type << " starting at " << start() - 1
|
||||
<< " ending at " << end() - 1 << " to cellSet." << endl;
|
||||
|
||||
labelList cls(end() - start() + 1);
|
||||
labelList cls(end() - start() + 1);
|
||||
|
||||
// Mark zone cells, used for finding faces
|
||||
boolList zoneCell(pShapeMesh.nCells(), false);
|
||||
|
||||
// shift cell indizes by 1
|
||||
label nr=0;
|
||||
for (label celli = (start() - 1); celli < end(); celli++)
|
||||
// shift cell indizes by 1
|
||||
label nr=0;
|
||||
for (label celli = (start() - 1); celli < end(); celli++)
|
||||
{
|
||||
cls[nr]=celli;
|
||||
zoneCell[celli] = true;
|
||||
nr++;
|
||||
}
|
||||
}
|
||||
|
||||
cz[cnt] = new cellZone
|
||||
(
|
||||
cz[cnt] = new cellZone
|
||||
(
|
||||
name,
|
||||
cls,
|
||||
cnt,
|
||||
pShapeMesh.cellZones()
|
||||
);
|
||||
);
|
||||
|
||||
DynamicList<label> zoneFaces(pShapeMesh.nFaces());
|
||||
forAll(pShapeMesh.faceNeighbour(), faceI)
|
||||
{
|
||||
label nei = pShapeMesh.faceNeighbour()[faceI];
|
||||
label own = pShapeMesh.faceOwner()[faceI];
|
||||
if(nei != -1)
|
||||
if (nei != -1)
|
||||
{
|
||||
if(zoneCell[nei] && zoneCell[own])
|
||||
if (zoneCell[nei] && zoneCell[own])
|
||||
{
|
||||
zoneFaces.append(faceI);
|
||||
}
|
||||
@ -1641,7 +1645,7 @@ int main(int argc, char *argv[])
|
||||
const labelList& faceCells = bPatches[pI].faceCells();
|
||||
forAll(faceCells, fcI)
|
||||
{
|
||||
if(zoneCell[faceCells[fcI] ])
|
||||
if (zoneCell[faceCells[fcI] ])
|
||||
{
|
||||
boundaryZones[pI].append(name);
|
||||
break;
|
||||
@ -1649,8 +1653,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
cnt++;
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
|
||||
pShapeMesh.addZones(pz, fz, cz);
|
||||
|
||||
@ -1715,7 +1719,7 @@ int main(int argc, char *argv[])
|
||||
cellSet internal(pShapeMesh, name, end() - start());
|
||||
|
||||
// shift cell indizes by 1
|
||||
for(label celli=start() - 1; celli<=end() - 1; celli++)
|
||||
for (label celli = start() - 1; celli <= end() - 1; celli++)
|
||||
{
|
||||
internal.insert(celli);
|
||||
}
|
||||
@ -1729,7 +1733,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
Info<< nl << "End" << endl;
|
||||
Info<< "\nEnd\n" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
||||
).c_str()
|
||||
);
|
||||
|
||||
Info << "Writing Header" << endl;
|
||||
Info<< "Writing Header" << endl;
|
||||
|
||||
fluentMeshFile
|
||||
<< "(0 \"FOAM to Fluent Mesh File\")" << std::endl << std::endl
|
||||
|
||||
@ -57,7 +57,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
mesh.writeFluentMesh();
|
||||
|
||||
Info << "End\n" << endl;
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ mtype {space}"MTYPE:"{space}
|
||||
|
||||
<readProgramID>{space}{word} {
|
||||
|
||||
Info << "Written by " << YYText() << " ";
|
||||
Info<< "Written by " << YYText() << " ";
|
||||
BEGIN(controlInfo);
|
||||
}
|
||||
|
||||
@ -245,20 +245,20 @@ mtype {space}"MTYPE:"{space}
|
||||
|
||||
<readVersionID>{space}{versionNumber} {
|
||||
|
||||
Info << " version " << YYText() << endl;
|
||||
Info<< " version " << YYText() << endl;
|
||||
BEGIN(controlInfo);
|
||||
}
|
||||
|
||||
|
||||
<controlInfo>{space}{dateDDMonYYYY}{space}{time} {
|
||||
|
||||
Info << "File written on " << YYText() << endl;
|
||||
Info<< "File written on " << YYText() << endl;
|
||||
}
|
||||
|
||||
|
||||
<controlInfo>{space}{dateDDMMYYYY}{space}{time} {
|
||||
|
||||
Info << "File written on " << YYText() << endl;
|
||||
Info<< "File written on " << YYText() << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -304,7 +304,7 @@ mtype {space}"MTYPE:"{space}
|
||||
{nodalCoords}{spaceNl} {
|
||||
|
||||
curNumberOfNodes = 0;
|
||||
Info << "Reading nodal coordinates" << endl;
|
||||
Info<< "Reading nodal coordinates" << endl;
|
||||
BEGIN(nodalCoords);
|
||||
}
|
||||
|
||||
@ -332,7 +332,7 @@ mtype {space}"MTYPE:"{space}
|
||||
{cellsAndElements}{spaceNl} {
|
||||
|
||||
curNumberOfCells = 0;
|
||||
Info << "Reading cells" << endl;
|
||||
Info<< "Reading cells" << endl;
|
||||
BEGIN(cellsAndElements);
|
||||
}
|
||||
|
||||
@ -422,7 +422,7 @@ mtype {space}"MTYPE:"{space}
|
||||
/* ------ Reading element group information ------ */
|
||||
|
||||
{cellStreams}{spaceNl} {
|
||||
Info << "Reading cell streams" << endl;
|
||||
Info<< "Reading cell streams" << endl;
|
||||
BEGIN(cellStreams);
|
||||
}
|
||||
|
||||
@ -504,7 +504,7 @@ mtype {space}"MTYPE:"{space}
|
||||
|
||||
|
||||
<cellStreamFlags>{labelList} {
|
||||
Info << "Reading cell stream labels" << endl;
|
||||
Info<< "Reading cell stream labels" << endl;
|
||||
BEGIN(cellStreamLabels);
|
||||
}
|
||||
|
||||
@ -529,7 +529,7 @@ mtype {space}"MTYPE:"{space}
|
||||
|
||||
<cellStreamLabels>{endOfSection}\n {
|
||||
|
||||
Info << "Finished reading cell stream labels" << endl;
|
||||
Info<< "Finished reading cell stream labels" << endl;
|
||||
|
||||
// reset current group ID and a number of flags
|
||||
curGroupID = 0;
|
||||
@ -541,7 +541,7 @@ mtype {space}"MTYPE:"{space}
|
||||
|
||||
{boundaryPatch}{spaceNl} {
|
||||
curPatchFace = 0;
|
||||
Info << "Reading patches" << endl;
|
||||
Info<< "Reading patches" << endl;
|
||||
BEGIN(boundaryPatchParams);
|
||||
}
|
||||
|
||||
@ -665,10 +665,10 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
yyFlexLexer lexer(&gambitStream);
|
||||
while(lexer.yylex() != 0)
|
||||
while (lexer.yylex() != 0)
|
||||
{}
|
||||
|
||||
Info << "Finished lexing" << endl;
|
||||
Info<< "Finished lexing" << endl;
|
||||
|
||||
// make a point mapping array
|
||||
label maxPointIndex = 0;
|
||||
@ -815,7 +815,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
Info << "gambitToFoam: " << endl
|
||||
Info<< "gambitToFoam: " << endl
|
||||
<< "Gambit file format does not provide information about the type of "
|
||||
<< "the patch (eg. wall, symmetry plane, cyclic etc)." << endl
|
||||
<< "All the patches have been created "
|
||||
@ -864,10 +864,10 @@ int main(int argc, char *argv[])
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
Info << "Writing polyMesh" << endl;
|
||||
Info<< "Writing polyMesh" << endl;
|
||||
pShapeMesh.write();
|
||||
|
||||
Info<< nl << "End" << endl;
|
||||
Info<< "\nEnd\n" << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -314,14 +314,14 @@ void readPhysNames(IFstream& inFile, Map<word>& physicalNames)
|
||||
IStringStream lineStr(line);
|
||||
label nSpaces = lineStr.str().count(' ');
|
||||
|
||||
if(nSpaces == 1)
|
||||
if (nSpaces == 1)
|
||||
{
|
||||
lineStr >> regionI >> regionName;
|
||||
|
||||
Info<< " " << regionI << '\t'
|
||||
<< string::validate<word>(regionName) << endl;
|
||||
}
|
||||
else if(nSpaces == 2)
|
||||
else if (nSpaces == 2)
|
||||
{
|
||||
// >= Gmsh2.4 physical types has tag in front.
|
||||
label physType;
|
||||
@ -885,7 +885,7 @@ int main(int argc, char *argv[])
|
||||
// Now use the patchFaces to patch up the outside faces of the mesh.
|
||||
|
||||
// Get the patch for all the outside faces (= default patch added as last)
|
||||
const polyPatch& pp = mesh.boundaryMesh()[mesh.boundaryMesh().size()-1];
|
||||
const polyPatch& pp = mesh.boundaryMesh().last();
|
||||
|
||||
// Storage for faceZones.
|
||||
List<DynamicList<label> > zoneFaces(patchFaces.size());
|
||||
|
||||
@ -324,13 +324,13 @@ void readCells
|
||||
cellVerts.append(cellShape(tet, cVerts, true));
|
||||
cellMaterial.append(physProp);
|
||||
|
||||
if (cellVerts[cellVerts.size()-1].size() != cVerts.size())
|
||||
if (cellVerts.last().size() != cVerts.size())
|
||||
{
|
||||
Pout<< "Line:" << is.lineNumber()
|
||||
<< " element:" << cellI
|
||||
<< " type:" << feID
|
||||
<< " collapsed from " << cVerts << nl
|
||||
<< " to:" << cellVerts[cellVerts.size()-1]
|
||||
<< " to:" << cellVerts.last()
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
@ -347,13 +347,13 @@ void readCells
|
||||
cellVerts.append(cellShape(prism, cVerts, true));
|
||||
cellMaterial.append(physProp);
|
||||
|
||||
if (cellVerts[cellVerts.size()-1].size() != cVerts.size())
|
||||
if (cellVerts.last().size() != cVerts.size())
|
||||
{
|
||||
Pout<< "Line:" << is.lineNumber()
|
||||
<< " element:" << cellI
|
||||
<< " type:" << feID
|
||||
<< " collapsed from " << cVerts << nl
|
||||
<< " to:" << cellVerts[cellVerts.size()-1]
|
||||
<< " to:" << cellVerts.last()
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
@ -371,13 +371,13 @@ void readCells
|
||||
cellVerts.append(cellShape(hex, cVerts, true));
|
||||
cellMaterial.append(physProp);
|
||||
|
||||
if (cellVerts[cellVerts.size()-1].size() != cVerts.size())
|
||||
if (cellVerts.last().size() != cVerts.size())
|
||||
{
|
||||
Pout<< "Line:" << is.lineNumber()
|
||||
<< " element:" << cellI
|
||||
<< " type:" << feID
|
||||
<< " collapsed from " << cVerts << nl
|
||||
<< " to:" << cellVerts[cellVerts.size()-1]
|
||||
<< " to:" << cellVerts.last()
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
@ -412,7 +412,7 @@ void readPatches
|
||||
Sout<< "Starting reading patches at line " << is.lineNumber() << '.'
|
||||
<< endl;
|
||||
|
||||
while(true)
|
||||
while (true)
|
||||
{
|
||||
string line;
|
||||
is.getLine(line);
|
||||
@ -511,7 +511,7 @@ void readDOFS
|
||||
}
|
||||
|
||||
Info<< "For DOF set " << group
|
||||
<< " named " << patchNames[patchNames.size()-1]
|
||||
<< " named " << patchNames.last()
|
||||
<< " trying to read vertex indices."
|
||||
<< endl;
|
||||
|
||||
@ -534,7 +534,7 @@ void readDOFS
|
||||
}
|
||||
|
||||
Info<< "For DOF set " << group
|
||||
<< " named " << patchNames[patchNames.size()-1]
|
||||
<< " named " << patchNames.last()
|
||||
<< " read " << vertices.size() << " vertex indices." << endl;
|
||||
|
||||
dofVertices.append(vertices.shrink());
|
||||
|
||||
@ -103,7 +103,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "readKivaGrid.H"
|
||||
|
||||
Info << "End\n" << endl;
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ pointField points(nPoints);
|
||||
label i4;
|
||||
labelList idface(nPoints), fv(nPoints);
|
||||
|
||||
for(label i=0; i<nPoints; i++)
|
||||
for (label i=0; i<nPoints; i++)
|
||||
{
|
||||
scalar ffv;
|
||||
kivaFile
|
||||
@ -44,7 +44,7 @@ labelList i1tab(nPoints), i3tab(nPoints), i8tab(nPoints), idreg(nPoints),
|
||||
|
||||
label nBfaces = 0;
|
||||
|
||||
for(label i=0; i<nPoints; i++)
|
||||
for (label i=0; i<nPoints; i++)
|
||||
{
|
||||
label i1, i3, i8;
|
||||
scalar ff, fbcl, fbcf, fbcb;
|
||||
@ -85,7 +85,7 @@ if (mTable == 0)
|
||||
|
||||
labelList imtab(nPoints), jmtab(nPoints), kmtab(nPoints);
|
||||
|
||||
for(label i=0; i<nPoints; i++)
|
||||
for (label i=0; i<nPoints; i++)
|
||||
{
|
||||
label im, jm, km;
|
||||
kivaFile >> i4 >> im >> jm >> km;
|
||||
@ -115,7 +115,7 @@ forAll (pointMap, i)
|
||||
}
|
||||
|
||||
// Initialise all cells to hex and search and set map for collocated points
|
||||
for(label i=0; i<nPoints; i++)
|
||||
for (label i=0; i<nPoints; i++)
|
||||
{
|
||||
if (f[i] > 0.0)
|
||||
{
|
||||
@ -237,7 +237,7 @@ List<SLList<face> > pFaces[nBCs];
|
||||
face quadFace(4);
|
||||
face triFace(3);
|
||||
|
||||
for(label i=0; i<nPoints; i++)
|
||||
for (label i=0; i<nPoints; i++)
|
||||
{
|
||||
if (f[i] > 0)
|
||||
{
|
||||
|
||||
@ -70,7 +70,7 @@ void hexBlock::setHandedness()
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << "Left-handed block." << endl;
|
||||
Info<< "Left-handed block." << endl;
|
||||
blockHandedness_ = left;
|
||||
}
|
||||
return;
|
||||
|
||||
@ -1410,7 +1410,7 @@ void Foam::meshDualiser::setRefinement
|
||||
meshMod
|
||||
);
|
||||
}
|
||||
while(fp != 0);
|
||||
while (fp != 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -111,8 +111,8 @@ void sammMesh::createPolyBoundary()
|
||||
// reset the size of the face list
|
||||
meshFaces_.setSize(nCreatedFaces);
|
||||
|
||||
Info << "Number of boundary faces: " << nBoundaryFacesFound << endl;
|
||||
Info << "Total number of faces: " << nCreatedFaces << endl;
|
||||
Info<< "Number of boundary faces: " << nBoundaryFacesFound << endl;
|
||||
Info<< "Total number of faces: " << nCreatedFaces << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ void sammMesh::createPolyCells()
|
||||
maxFaces += cellFaces_[cellI].size();
|
||||
}
|
||||
|
||||
Info << "Maximum possible number of faces in mesh: " << maxFaces << endl;
|
||||
Info<< "Maximum possible number of faces in mesh: " << maxFaces << endl;
|
||||
|
||||
meshFaces_.setSize(maxFaces);
|
||||
|
||||
@ -72,7 +72,7 @@ void sammMesh::createPolyCells()
|
||||
// Insertion cannot be done in one go as the faces need to be
|
||||
// added into the list in the increasing order of neighbour
|
||||
// cells. Therefore, all neighbours will be detected first
|
||||
// and then added in the correct order.
|
||||
// and then added in the correct order.
|
||||
|
||||
const faceList& curFaces = cellFaces_[cellI];
|
||||
|
||||
@ -109,7 +109,7 @@ void sammMesh::createPolyCells()
|
||||
label curNei = curNeighbours[neiI];
|
||||
|
||||
// reject neighbours with the lower label. This should
|
||||
// also reject current cell.
|
||||
// also reject current cell.
|
||||
if (curNei > cellI)
|
||||
{
|
||||
// get the list of search faces
|
||||
|
||||
@ -55,12 +55,12 @@ void sammMesh::purgeCellShapes()
|
||||
|
||||
if (!found)
|
||||
{
|
||||
Info << "Purging cell shape " << cellI << endl;
|
||||
Info<< "Purging cell shape " << cellI << endl;
|
||||
cellShapes_[cellI] = cellShape(*unknownPtr_, labelList(0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ void sammMesh::readCouples()
|
||||
|
||||
if (couplesFile.good())
|
||||
{
|
||||
Info << "\nReading couples" << endl;
|
||||
Info<< "\nReading couples" << endl;
|
||||
|
||||
// A mesh with couples cannot be a shape mesh
|
||||
isShapeMesh_ = false;
|
||||
@ -71,7 +71,7 @@ void sammMesh::readCouples()
|
||||
// get reference to master cell faces
|
||||
faceList& masterFaces = cellFaces_[masterCell - 1];
|
||||
|
||||
// Info << "Master cell: " << masterCell - 1 << " index: "
|
||||
// Info<< "Master cell: " << masterCell - 1 << " index: "
|
||||
// << cellShapes_[masterCell - 1].model().index()
|
||||
// << " face: " <<
|
||||
// masterFaces
|
||||
@ -116,14 +116,14 @@ void sammMesh::readCouples()
|
||||
[slaveFace]
|
||||
].reverseFace();
|
||||
|
||||
// Info << " slave cell: " << slaveCell - 1 << " index: "
|
||||
// Info<< " slave cell: " << slaveCell - 1 << " index: "
|
||||
// << cellShapes_[slaveCell - 1].model().index()
|
||||
// << " face: " << masterFaces[slaveToAdd] << endl;
|
||||
|
||||
slaveToAdd++;
|
||||
|
||||
}
|
||||
// Info << endl;
|
||||
// Info<< endl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -104,7 +104,7 @@ List<const label*> sammMesh::sammAddressingTable
|
||||
// Make polyhedral mesh data (packing)
|
||||
void sammMesh::createPolyMeshData()
|
||||
{
|
||||
Info << "Creating a polyMesh" << endl;
|
||||
Info<< "Creating a polyMesh" << endl;
|
||||
|
||||
createPolyCells();
|
||||
|
||||
@ -124,7 +124,7 @@ void sammMesh::createPolyMeshData()
|
||||
{
|
||||
if (curFaceLabels[faceI] == -1)
|
||||
{
|
||||
Info << "cell " << cellI
|
||||
Info<< "cell " << cellI
|
||||
<< " has got an unmatched face. "
|
||||
<< "Index: " << cellShapes_[cellI].model().index() << endl
|
||||
// << "cell shape: " << cellShapes_[cellI] << endl
|
||||
@ -142,7 +142,7 @@ void sammMesh::createPolyMeshData()
|
||||
|
||||
if (nProblemCells > 0)
|
||||
{
|
||||
Info << "Number of problem cells: " << nProblemCells << endl;
|
||||
Info<< "Number of problem cells: " << nProblemCells << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -61,10 +61,10 @@ int main(int argc, char *argv[])
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
Info << "Writing mesh" << endl;
|
||||
Info<< "Writing mesh" << endl;
|
||||
makeMesh.writeMesh();
|
||||
|
||||
Info<< nl << "End" << nl << endl;
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ void sammMesh::writeMesh()
|
||||
{
|
||||
if (isShapeMesh_)
|
||||
{
|
||||
Info << "This is a shapeMesh." << endl;
|
||||
Info<< "This is a shapeMesh." << endl;
|
||||
|
||||
polyMesh pShapeMesh
|
||||
(
|
||||
@ -57,7 +57,7 @@ void sammMesh::writeMesh()
|
||||
patchPhysicalTypes_
|
||||
);
|
||||
|
||||
Info << "Writing polyMesh" << endl;
|
||||
Info<< "Writing polyMesh" << endl;
|
||||
pShapeMesh.write();
|
||||
}
|
||||
else
|
||||
@ -66,7 +66,7 @@ void sammMesh::writeMesh()
|
||||
|
||||
createPolyMeshData();
|
||||
|
||||
Info << "This is a polyMesh" << endl;
|
||||
Info<< "This is a polyMesh" << endl;
|
||||
|
||||
polyMesh pMesh
|
||||
(
|
||||
@ -83,7 +83,7 @@ void sammMesh::writeMesh()
|
||||
|
||||
pMesh.addPatches(polyBoundaryPatches(pMesh));
|
||||
|
||||
Info << "Writing polyMesh" << endl;
|
||||
Info<< "Writing polyMesh" << endl;
|
||||
pMesh.write();
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ void starMesh::markBoundaryFaces()
|
||||
{
|
||||
const label curCellIndex = facePointCells[cellI];
|
||||
|
||||
const faceList& curCellFaces =
|
||||
const faceList& curCellFaces =
|
||||
cellFaces_[curCellIndex];
|
||||
|
||||
forAll(curCellFaces, cellFaceI)
|
||||
@ -159,11 +159,11 @@ void starMesh::markBoundaryFaces()
|
||||
{
|
||||
if (curFace[spI] > -1 && curFace[spI] < starPointID_.size())
|
||||
{
|
||||
Info << "," << starPointID_[curFace[spI]];
|
||||
Info<< "," << starPointID_[curFace[spI]];
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << ",???";
|
||||
Info<< ",???";
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ void starMesh::markBoundaryFaces()
|
||||
|
||||
void starMesh::collectBoundaryFaces()
|
||||
{
|
||||
Info << "Collecting boundary faces" << endl;
|
||||
Info<< "Collecting boundary faces" << endl;
|
||||
forAll(boundary_, patchI)
|
||||
{
|
||||
faceList& patchFaces = boundary_[patchI];
|
||||
@ -193,7 +193,7 @@ void starMesh::collectBoundaryFaces()
|
||||
}
|
||||
}
|
||||
|
||||
Info << "Finished collecting boundary faces" << endl;
|
||||
Info<< "Finished collecting boundary faces" << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ void starMesh::createCoupleMatches()
|
||||
{
|
||||
if (coupleI % infoJump == 0)
|
||||
{
|
||||
Info << "Doing couple " << coupleI << ". STAR couple ID: "
|
||||
Info<< "Doing couple " << coupleI << ". STAR couple ID: "
|
||||
<< couples_[coupleI].coupleID() << endl;
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ void starMesh::createCoupleMatches()
|
||||
d -= n*(n & d);
|
||||
|
||||
# ifdef DEBUG_COUPLE_INTERSECTION
|
||||
Info << "curMasterEdge: " << curMasterEdge << endl
|
||||
Info<< "curMasterEdge: " << curMasterEdge << endl
|
||||
<< "P: " << P << endl << "d: " << d << endl;
|
||||
# endif
|
||||
|
||||
@ -198,7 +198,7 @@ void starMesh::createCoupleMatches()
|
||||
scalar det = -(e & (n ^ d));
|
||||
|
||||
# ifdef DEBUG_COUPLE_INTERSECTION
|
||||
Info << "curSlaveEdge: " << curSlaveEdge << endl
|
||||
Info<< "curSlaveEdge: " << curSlaveEdge << endl
|
||||
<< "S: " << S << endl
|
||||
<< "e: " << e << endl;
|
||||
# endif
|
||||
@ -209,7 +209,7 @@ void starMesh::createCoupleMatches()
|
||||
scalar beta = ((S - P) & (n ^ d))/det;
|
||||
|
||||
# ifdef DEBUG_COUPLE_INTERSECTION
|
||||
Info << " beta: " << beta << endl;
|
||||
Info<< " beta: " << beta << endl;
|
||||
# endif
|
||||
|
||||
if (beta > -smallMergeTol_ && beta < 1 + smallMergeTol_)
|
||||
@ -219,7 +219,7 @@ void starMesh::createCoupleMatches()
|
||||
(((S - P) & d) + beta*(d & e))/magSqr(d);
|
||||
|
||||
# ifdef DEBUG_COUPLE_INTERSECTION
|
||||
Info << " alpha: " << alpha << endl;
|
||||
Info<< " alpha: " << alpha << endl;
|
||||
# endif
|
||||
|
||||
if
|
||||
@ -413,7 +413,7 @@ void starMesh::createCoupleMatches()
|
||||
scalar beta1 = (sp & e)/magSqr(e);
|
||||
|
||||
# ifdef DEBUG_COUPLE_INTERSECTION
|
||||
Info << "P: " << P << " S: " << S << " d: " << d
|
||||
Info<< "P: " << P << " S: " << S << " d: " << d
|
||||
<< " e: " << e << " sp: " << sp
|
||||
<< " beta1: " << beta1 << endl;
|
||||
# endif
|
||||
@ -446,7 +446,7 @@ void starMesh::createCoupleMatches()
|
||||
)
|
||||
{
|
||||
# ifdef DEBUG_COUPLE_INTERSECTION
|
||||
Info << "adding irregular slave "
|
||||
Info<< "adding irregular slave "
|
||||
<< "intersection2: "
|
||||
<< points_[masterEdges[masterEdgeI].end()]
|
||||
<< endl;
|
||||
@ -463,10 +463,10 @@ void starMesh::createCoupleMatches()
|
||||
} // end of master edges
|
||||
|
||||
# ifdef DEBUG_COUPLE_INTERSECTION
|
||||
Info << "additional slave edge points: " << endl;
|
||||
Info<< "additional slave edge points: " << endl;
|
||||
forAll (slaveEdgePoints, edgeI)
|
||||
{
|
||||
Info << "edge: " << edgeI << ": " << slaveEdgePoints[edgeI]
|
||||
Info<< "edge: " << edgeI << ": " << slaveEdgePoints[edgeI]
|
||||
<< endl;
|
||||
}
|
||||
# endif
|
||||
@ -475,7 +475,7 @@ void starMesh::createCoupleMatches()
|
||||
if (nLivePoints + coupleFacePoints.size() >= points_.size())
|
||||
{
|
||||
// increase the size of the points list
|
||||
Info << "Resizing points list" << endl;
|
||||
Info<< "Resizing points list" << endl;
|
||||
points_.setSize(points_.size() + couples_.size());
|
||||
}
|
||||
|
||||
@ -511,7 +511,7 @@ void starMesh::createCoupleMatches()
|
||||
label nTmpMasterLabels = 0;
|
||||
|
||||
# ifdef DEBUG_COUPLE_INTERSECTION
|
||||
Info << "masterFace: " << masterFace << endl
|
||||
Info<< "masterFace: " << masterFace << endl
|
||||
<< "nAdditionalMasterPoints: " << nAdditionalMasterPoints
|
||||
<< endl;
|
||||
# endif
|
||||
@ -545,7 +545,7 @@ void starMesh::createCoupleMatches()
|
||||
points_[masterEdges[masterEdgeI].start()];
|
||||
|
||||
// loop until the next label to add is -1
|
||||
for(;;)
|
||||
for (;;)
|
||||
{
|
||||
label nextPointLabel = -1;
|
||||
label usedI = -1;
|
||||
@ -588,7 +588,7 @@ void starMesh::createCoupleMatches()
|
||||
}
|
||||
|
||||
# ifdef DEBUG_FACE_ORDERING
|
||||
Info << "nextPointLabel: " << nextPointLabel << endl;
|
||||
Info<< "nextPointLabel: " << nextPointLabel << endl;
|
||||
# endif
|
||||
|
||||
i++;
|
||||
@ -619,7 +619,7 @@ void starMesh::createCoupleMatches()
|
||||
tmpMasterFace.setSize(nTmpMasterLabels);
|
||||
|
||||
# ifdef DEBUG_FACE_ORDERING
|
||||
Info << "tmpMasterFace: " << tmpMasterFace << endl;
|
||||
Info<< "tmpMasterFace: " << tmpMasterFace << endl;
|
||||
# endif
|
||||
|
||||
// Eliminate all zero-length edges
|
||||
@ -657,7 +657,7 @@ void starMesh::createCoupleMatches()
|
||||
);
|
||||
|
||||
# ifdef DEBUG_FACE_ORDERING
|
||||
Info << "Collapsed: nMaster: " << nMaster
|
||||
Info<< "Collapsed: nMaster: " << nMaster
|
||||
<< " label: " << newMasterFace[nMaster] << endl;
|
||||
# endif
|
||||
|
||||
@ -727,7 +727,7 @@ void starMesh::createCoupleMatches()
|
||||
vector edgeVector = slaveEdges[slaveEdgeI].vec(points_);
|
||||
|
||||
# ifdef DEBUG_FACE_ORDERING
|
||||
Info << "curSEdgePoints.size(): "
|
||||
Info<< "curSEdgePoints.size(): "
|
||||
<< curSEdgePoints.size() << endl
|
||||
<< "edgeVector: " << edgeVector << endl;
|
||||
# endif
|
||||
@ -739,7 +739,7 @@ void starMesh::createCoupleMatches()
|
||||
points_[slaveEdges[slaveEdgeI].start()];
|
||||
|
||||
// loop until the next label to add is -1
|
||||
for(;;)
|
||||
for (;;)
|
||||
{
|
||||
label nextPointLabel = -1;
|
||||
label usedI = -1;
|
||||
@ -782,7 +782,7 @@ void starMesh::createCoupleMatches()
|
||||
}
|
||||
|
||||
# ifdef DEBUG_FACE_ORDERING
|
||||
Info << "nextPointLabel: " << nextPointLabel << endl;
|
||||
Info<< "nextPointLabel: " << nextPointLabel << endl;
|
||||
# endif
|
||||
|
||||
i++;
|
||||
@ -813,7 +813,7 @@ void starMesh::createCoupleMatches()
|
||||
tmpSlaveFace.setSize(nTmpSlaveLabels);
|
||||
|
||||
# ifdef DEBUG_FACE_ORDERING
|
||||
Info << "tmpSlaveFace: " << tmpSlaveFace << endl;
|
||||
Info<< "tmpSlaveFace: " << tmpSlaveFace << endl;
|
||||
# endif
|
||||
|
||||
// Eliminate all zero-length edges
|
||||
@ -834,7 +834,7 @@ void starMesh::createCoupleMatches()
|
||||
forAll(slvEdgesToCollapse, edgeI)
|
||||
{
|
||||
# ifdef DEBUG_FACE_ORDERING
|
||||
Info << "slave edge length: " << edgeI << ", "
|
||||
Info<< "slave edge length: " << edgeI << ", "
|
||||
<< slvEdgesToCollapse[edgeI].mag(points_)<< endl;
|
||||
# endif
|
||||
|
||||
@ -880,7 +880,7 @@ void starMesh::createCoupleMatches()
|
||||
edgeList newSlaveEdges = newSlaveFace.edges();
|
||||
|
||||
# ifdef DEBUG_RIGHT_HAND_WALK
|
||||
Info << "newMasterEdges: " << newMasterEdges << endl
|
||||
Info<< "newMasterEdges: " << newMasterEdges << endl
|
||||
<< "newSlaveEdges: " << newSlaveEdges << endl;
|
||||
# endif
|
||||
|
||||
@ -926,7 +926,7 @@ void starMesh::createCoupleMatches()
|
||||
startEdgeFound = 2;
|
||||
|
||||
# ifdef DEBUG_RIGHT_HAND_WALK
|
||||
Info << "slave edge found" << endl;
|
||||
Info<< "slave edge found" << endl;
|
||||
# endif
|
||||
|
||||
break;
|
||||
@ -969,7 +969,7 @@ void starMesh::createCoupleMatches()
|
||||
startEdgeFound = 1;
|
||||
|
||||
# ifdef DEBUG_RIGHT_HAND_WALK
|
||||
Info << "master edge found" << endl;
|
||||
Info<< "master edge found" << endl;
|
||||
# endif
|
||||
|
||||
break;
|
||||
@ -986,7 +986,7 @@ void starMesh::createCoupleMatches()
|
||||
if (startEdgeFound > 0)
|
||||
{
|
||||
# ifdef DEBUG_RIGHT_HAND_WALK
|
||||
Info << "start edge: " << startEdge << endl;
|
||||
Info<< "start edge: " << startEdge << endl;
|
||||
# endif
|
||||
|
||||
// Loop through both faces and add all edges
|
||||
@ -1004,7 +1004,7 @@ void starMesh::createCoupleMatches()
|
||||
planeNormal /= mag(planeNormal) + VSMALL;
|
||||
|
||||
# ifdef DEBUG_RIGHT_HAND_WALK
|
||||
Info << "planeNormal: " << planeNormal << endl;
|
||||
Info<< "planeNormal: " << planeNormal << endl;
|
||||
# endif
|
||||
|
||||
// Do a check to control the right-hand turn. This is
|
||||
@ -1034,7 +1034,7 @@ void starMesh::createCoupleMatches()
|
||||
if (tripleProduct < 0)
|
||||
{
|
||||
# ifdef DEBUG_RIGHT_HAND_WALK
|
||||
Info << "Turning edge for right-hand turn rule" << endl;
|
||||
Info<< "Turning edge for right-hand turn rule" << endl;
|
||||
# endif
|
||||
startEdge = startEdge.reverseEdge();
|
||||
}
|
||||
@ -1155,7 +1155,7 @@ void starMesh::createCoupleMatches()
|
||||
scalar curGoStraight = newDir & ahead;
|
||||
|
||||
# ifdef DEBUG_RIGHT_HAND_WALK
|
||||
Info << "curRightTurn: " << curRightTurn
|
||||
Info<< "curRightTurn: " << curRightTurn
|
||||
<< " curGoStraight: " << curGoStraight << endl;
|
||||
# endif
|
||||
|
||||
@ -1167,7 +1167,7 @@ void starMesh::createCoupleMatches()
|
||||
if (curGoStraight > goStraight)
|
||||
{
|
||||
# ifdef DEBUG_RIGHT_HAND_WALK
|
||||
Info << "a" << endl;
|
||||
Info<< "a" << endl;
|
||||
# endif
|
||||
|
||||
// Good edge, turning left less than before
|
||||
@ -1179,7 +1179,7 @@ void starMesh::createCoupleMatches()
|
||||
else // new edge turning right
|
||||
{
|
||||
# ifdef DEBUG_RIGHT_HAND_WALK
|
||||
Info << "b" << endl;
|
||||
Info<< "b" << endl;
|
||||
# endif
|
||||
|
||||
// good edge, turning right
|
||||
@ -1197,7 +1197,7 @@ void starMesh::createCoupleMatches()
|
||||
if (curGoStraight < goStraight)
|
||||
{
|
||||
# ifdef DEBUG_RIGHT_HAND_WALK
|
||||
Info << "c" << endl;
|
||||
Info<< "c" << endl;
|
||||
# endif
|
||||
|
||||
// good edge, turning right more than before
|
||||
@ -1256,7 +1256,7 @@ void starMesh::createCoupleMatches()
|
||||
intersectedFace.setSize(nIntFacePoints);
|
||||
|
||||
# ifdef DEBUG_COUPLE
|
||||
Info << "intersectedFace: " << intersectedFace << endl;
|
||||
Info<< "intersectedFace: " << intersectedFace << endl;
|
||||
# endif
|
||||
|
||||
// check the intersection face for duplicate points
|
||||
@ -1315,7 +1315,7 @@ void starMesh::createCoupleMatches()
|
||||
forAll (intersectedFace, intPointI)
|
||||
{
|
||||
# ifdef DEBUG_COUPLE_PROJECTION
|
||||
Info << "Proj: old point: "
|
||||
Info<< "Proj: old point: "
|
||||
<< points_[intersectedFace[intPointI]] << endl;
|
||||
# endif
|
||||
|
||||
@ -1501,7 +1501,7 @@ void starMesh::createCoupleMatches()
|
||||
points_.setSize(nLivePoints);
|
||||
|
||||
// Finished
|
||||
Info << "Finished doing couples" << endl;
|
||||
Info<< "Finished doing couples" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ void starMesh::createPolyBoundary()
|
||||
<< curCellFaces[cellFaceI]
|
||||
<< endl;
|
||||
|
||||
Info << "PROSTAR Command: vset,news,vlis";
|
||||
Info<< "PROSTAR Command: vset,news,vlis";
|
||||
forAll (curCellFaces[cellFaceI], spI)
|
||||
{
|
||||
// check if the point is given by STAR
|
||||
@ -118,10 +118,10 @@ void starMesh::createPolyBoundary()
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << ",???";
|
||||
Info<< ",???";
|
||||
}
|
||||
}
|
||||
Info << " $ bset,add,vset,all" << endl;
|
||||
Info<< " $ bset,add,vset,all" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -135,7 +135,7 @@ void starMesh::createPolyBoundary()
|
||||
<< curCellFaces[cellFaceI]
|
||||
<< endl;
|
||||
|
||||
Info << "PROSTAR Command: vset,news,vlis";
|
||||
Info<< "PROSTAR Command: vset,news,vlis";
|
||||
forAll (curCellFaces[cellFaceI], spI)
|
||||
{
|
||||
// check if the point is given by STAR
|
||||
@ -154,10 +154,10 @@ void starMesh::createPolyBoundary()
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << ",???";
|
||||
Info<< ",???";
|
||||
}
|
||||
}
|
||||
Info << " $ bset,add,vset,all" << endl;
|
||||
Info<< " $ bset,add,vset,all" << endl;
|
||||
|
||||
}
|
||||
}
|
||||
@ -191,7 +191,7 @@ void starMesh::createPolyBoundary()
|
||||
{
|
||||
const face& missingFace = cellFaces_[cellI][faceI];
|
||||
|
||||
Info << "starMesh::createPolyBoundary() : "
|
||||
Info<< "starMesh::createPolyBoundary() : "
|
||||
<< "missing face found in cell " << cellI
|
||||
<< ".\nType: " << cellShapes_[cellI].model().name()
|
||||
<< ". STAR cell number: " << starCellID_[cellI]
|
||||
@ -199,7 +199,7 @@ void starMesh::createPolyBoundary()
|
||||
|
||||
nMissingFaceFound++;
|
||||
|
||||
Info << "PROSTAR Command: vset,news,vlis";
|
||||
Info<< "PROSTAR Command: vset,news,vlis";
|
||||
forAll (missingFace, spI)
|
||||
{
|
||||
// check if the point is given by STAR or created locally
|
||||
@ -209,21 +209,21 @@ void starMesh::createPolyBoundary()
|
||||
&& missingFace[spI] < starPointID_.size()
|
||||
)
|
||||
{
|
||||
Info << "," << starPointID_[missingFace[spI]];
|
||||
Info<< "," << starPointID_[missingFace[spI]];
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << ",???";
|
||||
Info<< ",???";
|
||||
}
|
||||
}
|
||||
Info << " $ bset,add,vset,all" << endl;
|
||||
Info<< " $ bset,add,vset,all" << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nMissingFaceFound > 0)
|
||||
{
|
||||
Info << "Number of unmatched faces: " << nMissingFaceFound << endl;
|
||||
Info<< "Number of unmatched faces: " << nMissingFaceFound << endl;
|
||||
}
|
||||
|
||||
// reset the size of the face list
|
||||
@ -256,14 +256,14 @@ void starMesh::createPolyBoundary()
|
||||
{
|
||||
const face& problemFace = meshFaces_[faceI];
|
||||
|
||||
Info << "starMesh::createPolyBoundary() : "
|
||||
Info<< "starMesh::createPolyBoundary() : "
|
||||
<< "problem with face " << faceI << ": addressed "
|
||||
<< markupFaces[faceI] << " times (should be 2!). Face: "
|
||||
<< problemFace << endl;
|
||||
|
||||
nProblemFacesFound++;
|
||||
|
||||
Info << "PROSTAR Command: vset,news,vlis";
|
||||
Info<< "PROSTAR Command: vset,news,vlis";
|
||||
forAll (problemFace, spI)
|
||||
{
|
||||
// check if the point is given by STAR or created locally
|
||||
@ -273,25 +273,25 @@ void starMesh::createPolyBoundary()
|
||||
&& problemFace[spI] < starPointID_.size()
|
||||
)
|
||||
{
|
||||
Info << "," << starPointID_[problemFace[spI]];
|
||||
Info<< "," << starPointID_[problemFace[spI]];
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << ",???";
|
||||
Info<< ",???";
|
||||
}
|
||||
}
|
||||
Info << " $ bset,add,vset,all" << endl;
|
||||
Info<< " $ bset,add,vset,all" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (nProblemFacesFound > 0)
|
||||
{
|
||||
Info << "Number of incorrectly matched faces: "
|
||||
Info<< "Number of incorrectly matched faces: "
|
||||
<< nProblemFacesFound << endl;
|
||||
}
|
||||
|
||||
Info << "Number of boundary faces: " << nBoundaryFacesFound << endl;
|
||||
Info << "Total number of faces: " << nCreatedFaces << endl;
|
||||
Info<< "Number of boundary faces: " << nBoundaryFacesFound << endl;
|
||||
Info<< "Total number of faces: " << nCreatedFaces << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ void starMesh::createPolyCells()
|
||||
maxFaces += cellFaces_[cellI].size();
|
||||
}
|
||||
|
||||
Info << "Maximum possible number of faces in mesh: " << maxFaces << endl;
|
||||
Info<< "Maximum possible number of faces in mesh: " << maxFaces << endl;
|
||||
|
||||
meshFaces_.setSize(maxFaces);
|
||||
|
||||
@ -72,7 +72,7 @@ void starMesh::createPolyCells()
|
||||
// Insertion cannot be done in one go as the faces need to be
|
||||
// added into the list in the increasing order of neighbour
|
||||
// cells. Therefore, all neighbours will be detected first
|
||||
// and then added in the correct order.
|
||||
// and then added in the correct order.
|
||||
|
||||
const faceList& curFaces = cellFaces_[cellI];
|
||||
|
||||
@ -109,7 +109,7 @@ void starMesh::createPolyCells()
|
||||
label curNei = curNeighbours[neiI];
|
||||
|
||||
// reject neighbours with the lower label. This should
|
||||
// also reject current cell.
|
||||
// also reject current cell.
|
||||
if (curNei > cellI)
|
||||
{
|
||||
// get the list of search faces
|
||||
|
||||
@ -48,9 +48,9 @@ void starMesh::mergeCoupleFacePoints()
|
||||
// merge set. Once all cells (and thus points) are visited, go
|
||||
// through the renumbering list and for each merging point use the
|
||||
// label of the merge set as the new point label.
|
||||
// This is VERY fancy. Use care if/when changing.
|
||||
// This is VERY fancy. Use care if/when changing.
|
||||
|
||||
Info << endl << "Creating merge sets" << endl;
|
||||
Info<< endl << "Creating merge sets" << endl;
|
||||
|
||||
// Create a renumbering list for points
|
||||
// In the first instance the renumbering list is used as a
|
||||
@ -162,7 +162,7 @@ void starMesh::mergeCoupleFacePoints()
|
||||
|
||||
if (nMergeSets >= mergeSetID.size())
|
||||
{
|
||||
Info << "Resizing mergeSetID" << endl;
|
||||
Info<< "Resizing mergeSetID" << endl;
|
||||
|
||||
mergeSetID.setSize
|
||||
(mergeSetID.size() + mergeIncrement);
|
||||
@ -327,7 +327,7 @@ void starMesh::mergeCoupleFacePoints()
|
||||
// This should be OK as the compressed points list will always
|
||||
// have less points that the original lists. Even if there is
|
||||
// no points removed, this will copy the list back onto itself
|
||||
//
|
||||
//
|
||||
renumberPoints[pointI] = nUsedPoints;
|
||||
points_[nUsedPoints] = points_[pointI];
|
||||
|
||||
@ -345,7 +345,7 @@ void starMesh::mergeCoupleFacePoints()
|
||||
// reset number of points which need to be sorted
|
||||
points_.setSize(nUsedPoints);
|
||||
|
||||
Info << "Renumbering all faces" << endl;
|
||||
Info<< "Renumbering all faces" << endl;
|
||||
|
||||
forAll (cellFaces_, cellI)
|
||||
{
|
||||
@ -374,7 +374,7 @@ void starMesh::mergeCoupleFacePoints()
|
||||
}
|
||||
}
|
||||
|
||||
Info << "Renumbering all cell shapes" << endl;
|
||||
Info<< "Renumbering all cell shapes" << endl;
|
||||
|
||||
forAll (cellShapes_, cellI)
|
||||
{
|
||||
@ -402,7 +402,7 @@ void starMesh::mergeCoupleFacePoints()
|
||||
}
|
||||
}
|
||||
|
||||
Info << "Renumbering STAR point lookup" << endl;
|
||||
Info<< "Renumbering STAR point lookup" << endl;
|
||||
|
||||
labelList oldStarPointID = starPointID_;
|
||||
|
||||
|
||||
@ -55,12 +55,12 @@ void starMesh::purgeCellShapes()
|
||||
|
||||
if (!found)
|
||||
{
|
||||
Info << "Purging cell shape " << cellI << endl;
|
||||
Info<< "Purging cell shape " << cellI << endl;
|
||||
cellShapes_[cellI] = cellShape(*unknownPtr_, labelList(0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ void starMesh::readCouples()
|
||||
|
||||
if (couplesFile.good())
|
||||
{
|
||||
Info << "\nReading couples" << endl;
|
||||
Info<< "\nReading couples" << endl;
|
||||
|
||||
label matchLabel, nEntries, typeFlag;
|
||||
label starMasterCell, rotXMasterFace;
|
||||
@ -178,7 +178,7 @@ void starMesh::readCouples()
|
||||
}
|
||||
}
|
||||
|
||||
Info << "finished reading couples" << endl;
|
||||
Info<< "finished reading couples" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ const label starMesh::sammAddressingTable[9][12] =
|
||||
// (first index) and STAR face number
|
||||
// - first column is always -1
|
||||
// - last column is -1 for all but hexagonal prism
|
||||
// WARNING: Possible bug for sammTrim2
|
||||
// WARNING: Possible bug for sammTrim2
|
||||
// The lookup table for SAMM shapes is based on the rotation of the
|
||||
// shape. This would imply that the table below needs to be split between
|
||||
// the regular shapes (3-9), which are OK, and the SAMM shapes, for which
|
||||
@ -95,7 +95,7 @@ const label starMesh::sammAddressingTable[9][12] =
|
||||
// cell, firts find out the face index in the normal rotation using the cell
|
||||
// face permutation table and then use the index from the shape face lookup.
|
||||
// Additionally, have in mind that this silliness does not allow matches
|
||||
// on face 7 and 8 of the samm cell.
|
||||
// on face 7 and 8 of the samm cell.
|
||||
|
||||
const label starMesh::sammFacePermutationTable[24][8] =
|
||||
{
|
||||
@ -180,7 +180,7 @@ const label starMesh::shapeFaceLookup[19][9] =
|
||||
// samm trim 8:
|
||||
// star number: 1 2 3 4 5 6 7 8 In ROTATION 0
|
||||
// foam number: 2 5 4 7 1 0 3 6
|
||||
// confirmed: 1 0 6
|
||||
// confirmed: 1 0 6
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -188,7 +188,7 @@ const label starMesh::shapeFaceLookup[19][9] =
|
||||
// Make polyhedral mesh data (packing)
|
||||
void starMesh::createPolyMeshData()
|
||||
{
|
||||
Info << "Creating a polyMesh" << endl;
|
||||
Info<< "Creating a polyMesh" << endl;
|
||||
|
||||
createPolyCells();
|
||||
|
||||
@ -203,7 +203,7 @@ void starMesh::createPolyMeshData()
|
||||
// a memory peak
|
||||
void starMesh::clearExtraStorage()
|
||||
{
|
||||
Info << "Clearing extra storage" << endl;
|
||||
Info<< "Clearing extra storage" << endl;
|
||||
|
||||
starPointLabelLookup_.setSize(0);
|
||||
starPointID_.setSize(0);
|
||||
|
||||
@ -61,10 +61,10 @@ int main(int argc, char *argv[])
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
Info << "Writing mesh" << endl;
|
||||
Info<< "Writing mesh" << endl;
|
||||
makeMesh.writeMesh();
|
||||
|
||||
Info<< nl << "End" << nl << endl;
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -37,9 +37,9 @@ void starMesh::writeMesh()
|
||||
{
|
||||
if (isShapeMesh_)
|
||||
{
|
||||
Info << "This is a shapeMesh." << endl;
|
||||
Info<< "This is a shapeMesh." << endl;
|
||||
|
||||
Info << "Default patch type set to empty" << endl;
|
||||
Info<< "Default patch type set to empty" << endl;
|
||||
|
||||
clearExtraStorage();
|
||||
|
||||
@ -61,7 +61,7 @@ void starMesh::writeMesh()
|
||||
patchPhysicalTypes_
|
||||
);
|
||||
|
||||
Info << "Writing polyMesh" << endl;
|
||||
Info<< "Writing polyMesh" << endl;
|
||||
pShapeMesh.write();
|
||||
}
|
||||
else
|
||||
@ -70,7 +70,7 @@ void starMesh::writeMesh()
|
||||
|
||||
createPolyMeshData();
|
||||
|
||||
Info << "This is a polyMesh" << endl;
|
||||
Info<< "This is a polyMesh" << endl;
|
||||
|
||||
clearExtraStorage();
|
||||
|
||||
@ -90,7 +90,7 @@ void starMesh::writeMesh()
|
||||
// adding patches also checks the mesh
|
||||
pMesh.addPatches(polyBoundaryPatches(pMesh));
|
||||
|
||||
Info << "Writing polyMesh" << endl;
|
||||
Info<< "Writing polyMesh" << endl;
|
||||
pMesh.write();
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ void writePoints(const polyMesh& mesh, const fileName& timeName)
|
||||
|
||||
fileName pointFile(mesh.time().path()/"meshPoints_" + timeName + ".obj");
|
||||
|
||||
Info << "Writing mesh points and edges to " << pointFile << endl;
|
||||
Info<< "Writing mesh points and edges to " << pointFile << endl;
|
||||
|
||||
OFstream pointStream(pointFile);
|
||||
|
||||
@ -91,7 +91,7 @@ void writePoints
|
||||
{
|
||||
fileName fName(mesh.time().path()/"meshPoints_" + timeName + ".obj");
|
||||
|
||||
Info << "Writing mesh points and edges to " << fName << endl;
|
||||
Info<< "Writing mesh points and edges to " << fName << endl;
|
||||
|
||||
OFstream str(fName);
|
||||
|
||||
@ -162,7 +162,7 @@ void writePoints
|
||||
/ "meshPoints_" + timeName + '_' + name(cellI) + ".obj"
|
||||
);
|
||||
|
||||
Info << "Writing mesh points and edges to " << fName << endl;
|
||||
Info<< "Writing mesh points and edges to " << fName << endl;
|
||||
|
||||
OFstream pointStream(fName);
|
||||
|
||||
@ -182,7 +182,7 @@ void writeFaceCentres(const polyMesh& mesh,const fileName& timeName)
|
||||
/ "meshFaceCentres_" + timeName + ".obj"
|
||||
);
|
||||
|
||||
Info << "Writing mesh face centres to " << faceFile << endl;
|
||||
Info<< "Writing mesh face centres to " << faceFile << endl;
|
||||
|
||||
OFstream faceStream(faceFile);
|
||||
|
||||
@ -200,7 +200,7 @@ void writeCellCentres(const polyMesh& mesh, const fileName& timeName)
|
||||
mesh.time().path()/"meshCellCentres_" + timeName + ".obj"
|
||||
);
|
||||
|
||||
Info << "Writing mesh cell centres to " << cellFile << endl;
|
||||
Info<< "Writing mesh cell centres to " << cellFile << endl;
|
||||
|
||||
OFstream cellStream(cellFile);
|
||||
|
||||
@ -228,7 +228,7 @@ void writePatchCentres
|
||||
mesh.time().path()/"patch_" + pp.name() + '_' + timeName + ".obj"
|
||||
);
|
||||
|
||||
Info << "Writing patch face centres to " << faceFile << endl;
|
||||
Info<< "Writing patch face centres to " << faceFile << endl;
|
||||
|
||||
OFstream patchFaceStream(faceFile);
|
||||
|
||||
@ -258,7 +258,7 @@ void writePatchFaces
|
||||
/ "patchFaces_" + pp.name() + '_' + timeName + ".obj"
|
||||
);
|
||||
|
||||
Info << "Writing patch faces to " << faceFile << endl;
|
||||
Info<< "Writing patch faces to " << faceFile << endl;
|
||||
|
||||
OFstream patchFaceStream(faceFile);
|
||||
|
||||
@ -301,7 +301,7 @@ void writePatchBoundaryEdges
|
||||
/ "patchEdges_" + pp.name() + '_' + timeName + ".obj"
|
||||
);
|
||||
|
||||
Info << "Writing patch edges to " << edgeFile << endl;
|
||||
Info<< "Writing patch edges to " << edgeFile << endl;
|
||||
|
||||
OFstream patchEdgeStream(edgeFile);
|
||||
|
||||
@ -351,7 +351,7 @@ void writePointCells
|
||||
/ "pointEdges_" + timeName + '_' + name(pointI) + ".obj"
|
||||
);
|
||||
|
||||
Info << "Writing pointEdges to " << pFile << endl;
|
||||
Info<< "Writing pointEdges to " << pFile << endl;
|
||||
|
||||
OFstream pointStream(pFile);
|
||||
|
||||
@ -492,7 +492,7 @@ int main(int argc, char *argv[])
|
||||
+ ".obj"
|
||||
);
|
||||
|
||||
Info << "Writing mesh points and edges to " << fName << endl;
|
||||
Info<< "Writing mesh points and edges to " << fName << endl;
|
||||
|
||||
OFstream str(fName);
|
||||
|
||||
@ -506,7 +506,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if
|
||||
(
|
||||
!patchFaces
|
||||
!patchFaces
|
||||
&& !patchEdges
|
||||
&& !doCell
|
||||
&& !doPoint
|
||||
@ -530,14 +530,14 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << "No mesh." << endl;
|
||||
Info<< "No mesh." << endl;
|
||||
}
|
||||
|
||||
Info << nl << endl;
|
||||
Info<< nl << endl;
|
||||
}
|
||||
|
||||
|
||||
Info << "End\n" << endl;
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -382,7 +382,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
Info<< nl << "End" << endl;
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -83,11 +83,11 @@
|
||||
);
|
||||
} // end of all merge pairs
|
||||
|
||||
Info << "Adding point and face zones" << endl;
|
||||
Info<< "Adding point and face zones" << endl;
|
||||
mesh.addZones(pz, fz, cz);
|
||||
|
||||
|
||||
Info << "Creating attachPolyTopoChanger" << endl;
|
||||
Info<< "Creating attachPolyTopoChanger" << endl;
|
||||
attachPolyTopoChanger polyMeshAttacher(mesh);
|
||||
polyMeshAttacher.setSize(mergePatchPairs.size());
|
||||
|
||||
|
||||
@ -418,8 +418,8 @@ int main(int argc, char *argv[])
|
||||
frontPatchFaces.setSize(layerFaces.size());
|
||||
forAll(backPatchFaces, i)
|
||||
{
|
||||
backPatchFaces[i] = layerFaces[i][0];
|
||||
frontPatchFaces[i] = layerFaces[i][layerFaces[i].size()-1];
|
||||
backPatchFaces[i] = layerFaces[i].first();
|
||||
frontPatchFaces[i] = layerFaces[i].last();
|
||||
}
|
||||
|
||||
// Create dummy fvSchemes, fvSolution
|
||||
@ -693,7 +693,7 @@ int main(int argc, char *argv[])
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
Info << "End\n" << endl;
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EXE_INC = \
|
||||
/* -g -DFULLDEBUG -O0 */ \
|
||||
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/mesh/autoMesh/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/triSurface/lnInclude \
|
||||
|
||||
@ -189,7 +189,7 @@ int main(int argc, char *argv[])
|
||||
currentSet.write();
|
||||
}
|
||||
|
||||
Info << nl << "End" << endl;
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << "\nMesh OK.\n" << endl;
|
||||
Info<< "\nMesh OK.\n" << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
|
||||
label nTetWedge = 0;
|
||||
label nUnknown = 0;
|
||||
|
||||
for(label cellI = 0; cellI < mesh.nCells(); cellI++)
|
||||
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
|
||||
{
|
||||
if (hex.isA(mesh, cellI))
|
||||
{
|
||||
|
||||
@ -186,7 +186,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
newPatches.append(findPatchID(mesh, patchNames[i]));
|
||||
Info<< "Using additional patch " << patchNames[i]
|
||||
<< " at index " << newPatches[newPatches.size()-1] << endl;
|
||||
<< " at index " << newPatches.last() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -189,7 +189,7 @@ int main(int argc, char *argv[])
|
||||
currentSet.write();
|
||||
}
|
||||
|
||||
Info << nl << "End" << endl;
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ int main(int argc, char *argv[])
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
Info << "Writing points into directory " << points.path() << nl << endl;
|
||||
Info<< "Writing points into directory " << points.path() << nl << endl;
|
||||
points.write();
|
||||
|
||||
return 0;
|
||||
|
||||
@ -89,7 +89,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
insideCells.write();
|
||||
|
||||
Info << "End\n" << endl;
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ int main(int argc, char *argv[])
|
||||
masterMesh.merge();
|
||||
masterMesh.polyMesh::write();
|
||||
|
||||
Info << nl << "End" << endl;
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -385,7 +385,7 @@ void Foam::mergePolyMesh::merge()
|
||||
// Add the patches if necessary
|
||||
if (patchNames_.size() != boundaryMesh().size())
|
||||
{
|
||||
Info << "Copying old patches" << endl;
|
||||
Info<< "Copying old patches" << endl;
|
||||
|
||||
List<polyPatch*> newPatches(patchNames_.size());
|
||||
|
||||
@ -399,7 +399,7 @@ void Foam::mergePolyMesh::merge()
|
||||
newPatches[patchI] = oldPatches[patchI].clone(oldPatches).ptr();
|
||||
}
|
||||
|
||||
Info << "Adding new patches. " << endl;
|
||||
Info<< "Adding new patches. " << endl;
|
||||
|
||||
label endOfLastPatch =
|
||||
oldPatches[patchI - 1].start() + oldPatches[patchI - 1].size();
|
||||
|
||||
@ -33,8 +33,8 @@ License
|
||||
const Foam::label Foam::mirrorFvMesh::cellRenumber[8][8] =
|
||||
{
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1}, // unknown
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1}, //
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1}, //
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1}, //
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1}, //
|
||||
{ 0, 3, 2, 1, 4, 7, 6, 5}, // hex
|
||||
{ 2, 1, 0, 5, 4, 3, 6, -1}, // wedge
|
||||
{ 0, 2, 1, 3, 5, 4, -1, -1}, // prism
|
||||
@ -74,7 +74,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
const polyPatchList& oldPatches = boundaryMesh();
|
||||
|
||||
// Mirror the points
|
||||
Info << "Mirroring points. Old points: " << oldPoints.size();
|
||||
Info<< "Mirroring points. Old points: " << oldPoints.size();
|
||||
|
||||
pointField newPoints(2*oldPoints.size());
|
||||
label nNewPoints = 0;
|
||||
@ -120,10 +120,10 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
}
|
||||
|
||||
// Reset the size of the point list
|
||||
Info << " New points: " << nNewPoints << endl;
|
||||
Info<< " New points: " << nNewPoints << endl;
|
||||
newPoints.setSize(nNewPoints);
|
||||
|
||||
Info << "Mirroring faces. Old faces: " << oldFaces.size();
|
||||
Info<< "Mirroring faces. Old faces: " << oldFaces.size();
|
||||
|
||||
// Algorithm:
|
||||
// During mirroring, the faces that were previously boundary faces
|
||||
@ -329,14 +329,14 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
|
||||
// Tidy up the lists
|
||||
newFaces.setSize(nNewFaces);
|
||||
Info << " New faces: " << nNewFaces << endl;
|
||||
Info<< " New faces: " << nNewFaces << endl;
|
||||
|
||||
newPatchTypes.setSize(nNewPatches);
|
||||
newPatchNames.setSize(nNewPatches);
|
||||
newPatchSizes.setSize(nNewPatches);
|
||||
newPatchStarts.setSize(nNewPatches);
|
||||
|
||||
Info << "Mirroring patches. Old patches: " << boundary().size()
|
||||
Info<< "Mirroring patches. Old patches: " << boundary().size()
|
||||
<< " New patches: " << nNewPatches << endl;
|
||||
|
||||
Info<< "Mirroring cells. Old cells: " << oldCells.size()
|
||||
@ -378,9 +378,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
}
|
||||
|
||||
// Mirror the cell shapes
|
||||
Info << "Mirroring cell shapes." << endl;
|
||||
Info<< "Mirroring cell shapes." << endl;
|
||||
|
||||
Info << nl << "Creating new mesh" << endl;
|
||||
Info<< nl << "Creating new mesh" << endl;
|
||||
mirrorMeshPtr_ = new fvMesh
|
||||
(
|
||||
io,
|
||||
|
||||
@ -54,10 +54,10 @@ int main(int argc, char *argv[])
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
Info << "Writing mirrored mesh" << endl;
|
||||
Info<< "Writing mirrored mesh" << endl;
|
||||
mesh.mirrorMesh().write();
|
||||
|
||||
Info << "End" << endl;
|
||||
Info<< "End" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -266,7 +266,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
Info << "End\n" << endl;
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -189,7 +189,7 @@ int main(int argc, char *argv[])
|
||||
currentSet.write();
|
||||
}
|
||||
|
||||
Info << nl << "End" << endl;
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude
|
||||
-I$(LIB_SRC)/parallel/decompositionMethods/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
|
||||
@ -103,7 +103,7 @@ int main(int argc, char *argv[])
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
Info << "Writing points into directory " << points.path() << nl << endl;
|
||||
Info<< "Writing points into directory " << points.path() << nl << endl;
|
||||
points.write();
|
||||
}
|
||||
|
||||
|
||||
@ -284,10 +284,10 @@ void printHelp(Ostream& os)
|
||||
<< endl
|
||||
<< "Zones can be set using zoneSets from corresponding sets:" << endl
|
||||
<< " cellZoneSet c0Zone new setToCellZone c0" << endl
|
||||
<< " faceZoneSet f0Zone new setToFaceZone f0" << endl
|
||||
<< " faceZoneSet f0Zone new setToFaceZone f0" << endl
|
||||
<< endl
|
||||
<< "or if orientation is important:" << endl
|
||||
<< " faceZoneSet f0Zone new setsToFaceZone f0 c0" << endl
|
||||
<< " faceZoneSet f0Zone new setsToFaceZone f0 c0" << endl
|
||||
<< endl
|
||||
<< "ZoneSets can be manipulated using the general actions:" << endl
|
||||
<< " list - prints the contents of the set" << endl
|
||||
@ -992,7 +992,7 @@ int main(int argc, char *argv[])
|
||||
delete fileStreamPtr;
|
||||
}
|
||||
|
||||
Pout<< "\nEnd" << endl;
|
||||
Pout<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -341,7 +341,7 @@ int main(int argc, char *argv[])
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
Info<< nl << "End" << endl;
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ int main(int argc, char *argv[])
|
||||
mesh.faceZones()
|
||||
);
|
||||
|
||||
Info << "Adding point and face zones" << endl;
|
||||
Info<< "Adding point and face zones" << endl;
|
||||
mesh.addZones(pz, fz, cz);
|
||||
|
||||
attachPolyTopoChanger splitter(mesh);
|
||||
|
||||
@ -172,7 +172,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// set up the tolerances for the sliding mesh
|
||||
dictionary slidingTolerances;
|
||||
if (args.options().found("toleranceDict"))
|
||||
if (args.options().found("toleranceDict"))
|
||||
{
|
||||
IOdictionary toleranceFile(
|
||||
IOobject(
|
||||
@ -180,7 +180,7 @@ int main(int argc, char *argv[])
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
slidingTolerances += toleranceFile;
|
||||
@ -231,7 +231,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Note: make sure to add the zones BEFORE constructing polyMeshModifier
|
||||
// (since looks up various zones at construction time)
|
||||
Info << "Adding point and face zones" << endl;
|
||||
Info<< "Adding point and face zones" << endl;
|
||||
mesh.addZones(pz.shrink(), fz.shrink(), cz.shrink());
|
||||
|
||||
// Add the perfect interface mesh modifier
|
||||
@ -316,7 +316,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Note: make sure to add the zones BEFORE constructing polyMeshModifier
|
||||
// (since looks up various zones at construction time)
|
||||
Info << "Adding point and face zones" << endl;
|
||||
Info<< "Adding point and face zones" << endl;
|
||||
mesh.addZones(pz.shrink(), fz.shrink(), cz.shrink());
|
||||
|
||||
// Add the sliding interface mesh modifier
|
||||
@ -393,7 +393,7 @@ int main(int argc, char *argv[])
|
||||
mesh.setInstance(oldInstance);
|
||||
stitcher.instance() = oldInstance;
|
||||
}
|
||||
Info << nl << "Writing polyMesh to time " << runTime.timeName() << endl;
|
||||
Info<< nl << "Writing polyMesh to time " << runTime.timeName() << endl;
|
||||
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
|
||||
@ -439,7 +439,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
Info << nl << "End" << endl;
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -267,7 +267,7 @@ int main(int argc, char *argv[])
|
||||
// Set the precision of the points data to 10
|
||||
IOstream::defaultPrecision(10);
|
||||
|
||||
Info << "Writing points into directory " << points.path() << nl << endl;
|
||||
Info<< "Writing points into directory " << points.path() << nl << endl;
|
||||
points.write();
|
||||
|
||||
return 0;
|
||||
|
||||
@ -98,11 +98,11 @@ int main(int argc, char *argv[])
|
||||
outputFieldList<sphericalTensor>(vsptf, patchI);
|
||||
outputFieldList<symmTensor>(vsytf, patchI);
|
||||
outputFieldList<tensor>(vtf, patchI);
|
||||
Info << endl;
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
Info << "End\n" << endl;
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
decomposeMesh.C
|
||||
decomposePar.C
|
||||
domainDecomposition.C
|
||||
distributeCells.C
|
||||
domainDecompositionMesh.C
|
||||
domainDecompositionDistribute.C
|
||||
fvFieldDecomposer.C
|
||||
pointFieldDecomposer.C
|
||||
lagrangianFieldDecomposer.C
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
@ -106,7 +106,6 @@ int main(int argc, char *argv[])
|
||||
Info<< "Decomposing mesh " << regionName << nl << endl;
|
||||
}
|
||||
|
||||
|
||||
bool writeCellDist = args.optionFound("cellDist");
|
||||
bool copyUniform = args.optionFound("copyUniform");
|
||||
bool decomposeFieldsOnly = args.optionFound("fields");
|
||||
|
||||
@ -38,7 +38,7 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void domainDecomposition::mark
|
||||
void Foam::domainDecomposition::mark
|
||||
(
|
||||
const labelList& zoneElems,
|
||||
const label zoneI,
|
||||
@ -66,7 +66,7 @@ void domainDecomposition::mark
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// from components
|
||||
domainDecomposition::domainDecomposition(const IOobject& io)
|
||||
Foam::domainDecomposition::domainDecomposition(const IOobject& io)
|
||||
:
|
||||
fvMesh(io),
|
||||
decompositionDict_
|
||||
@ -105,13 +105,13 @@ domainDecomposition::domainDecomposition(const IOobject& io)
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
domainDecomposition::~domainDecomposition()
|
||||
Foam::domainDecomposition::~domainDecomposition()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool domainDecomposition::writeDecomposition()
|
||||
bool Foam::domainDecomposition::writeDecomposition()
|
||||
{
|
||||
Info<< "\nConstructing processor meshes" << endl;
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ Class
|
||||
Foam::domainDecomposition
|
||||
|
||||
Description
|
||||
Automatic domain decomposition class for FOAM meshes
|
||||
Automatic domain decomposition class for finite-volume meshes
|
||||
|
||||
SourceFiles
|
||||
domainDecomposition.C
|
||||
@ -42,13 +42,11 @@ SourceFiles
|
||||
#include "PtrList.H"
|
||||
#include "point.H"
|
||||
|
||||
#ifndef namespaceFoam
|
||||
#define namespaceFoam
|
||||
using namespace Foam;
|
||||
#endif
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class domainDecomposition Declaration
|
||||
Class domainDecomposition Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class domainDecomposition
|
||||
@ -79,7 +77,7 @@ class domainDecomposition
|
||||
// original face. In order to do this properly, all face
|
||||
// indices will be incremented by 1 and the decremented as
|
||||
// necessary t avoid the problem of face number zero having no
|
||||
// sign.
|
||||
// sign.
|
||||
labelListList procFaceAddressing_;
|
||||
|
||||
//- Labels of cells for each processor
|
||||
@ -165,6 +163,11 @@ public:
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
@ -33,7 +33,7 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
void domainDecomposition::distributeCells()
|
||||
void Foam::domainDecomposition::distributeCells()
|
||||
{
|
||||
Info<< "\nCalculating distribution of cells" << endl;
|
||||
|
||||
@ -40,7 +40,7 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
void Foam::domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
{
|
||||
// Decide which cell goes to which processor
|
||||
distributeCells();
|
||||
@ -87,7 +87,7 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
}
|
||||
}
|
||||
|
||||
Info << "\nDistributing faces to processors" << endl;
|
||||
Info<< "\nDistributing faces to processors" << endl;
|
||||
|
||||
// Loop through all internal faces and decide which processor they belong to
|
||||
// First visit all internal faces. If cells at both sides belong to the
|
||||
@ -158,7 +158,7 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
SLList<label>::iterator curInterProcBdrsNeiIter =
|
||||
interProcBoundaries[neighbourProc].begin();
|
||||
|
||||
SLList<SLList<label> >::iterator
|
||||
SLList<SLList<label> >::iterator
|
||||
curInterProcBFacesNeiIter =
|
||||
interProcBFaces[neighbourProc].begin();
|
||||
|
||||
@ -307,7 +307,7 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
SLList<label>::iterator curInterProcBdrsOwnIter =
|
||||
interProcBoundaries[ownerProc].begin();
|
||||
|
||||
SLList<SLList<label> >::iterator
|
||||
SLList<SLList<label> >::iterator
|
||||
curInterProcBFacesOwnIter =
|
||||
interProcBFaces[ownerProc].begin();
|
||||
|
||||
@ -432,7 +432,7 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
// Note: I cannot add the other side of the cyclic
|
||||
// boundary here because this would violate the order.
|
||||
// They will be added in a separate loop below
|
||||
//
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
@ -483,7 +483,7 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
// calculate the size
|
||||
label nFacesOnProcessor = curProcFaces.size();
|
||||
|
||||
for
|
||||
for
|
||||
(
|
||||
SLList<SLList<label> >::iterator curInterProcBFacesIter =
|
||||
interProcBFaces[procI].begin();
|
||||
@ -506,7 +506,7 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
|
||||
// Add internal and boundary faces
|
||||
// Remember to increment the index by one such that the
|
||||
// turning index works properly.
|
||||
// turning index works properly.
|
||||
for
|
||||
(
|
||||
SLList<label>::iterator curProcFacesIter = curProcFaces.begin();
|
||||
@ -576,7 +576,7 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
// add the face
|
||||
|
||||
// Remember to increment the index by one such that the
|
||||
// turning index works properly.
|
||||
// turning index works properly.
|
||||
if (cellToProc_[owner[curFacesIter()]] == procI)
|
||||
{
|
||||
curProcFaceAddressing[nFaces] = curFacesIter() + 1;
|
||||
@ -598,7 +598,7 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
}
|
||||
}
|
||||
|
||||
Info << "\nCalculating processor boundary addressing" << endl;
|
||||
Info<< "\nCalculating processor boundary addressing" << endl;
|
||||
// For every patch of processor boundary, find the index of the original
|
||||
// patch. Mis-alignment is caused by the fact that patches with zero size
|
||||
// are omitted. For processor patches, set index to -1.
|
||||
@ -656,7 +656,7 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
curBoundaryAddressing.setSize(nPatches);
|
||||
}
|
||||
|
||||
Info << "\nDistributing points to processors" << endl;
|
||||
Info<< "\nDistributing points to processors" << endl;
|
||||
// For every processor, loop through the list of faces for the processor.
|
||||
// For every face, loop through the list of points and mark the point as
|
||||
// used for the processor. Collect the list of used points for the
|
||||
@ -748,7 +748,7 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
{
|
||||
// Mark the original face as used
|
||||
// Remember to decrement the index by one (turning index)
|
||||
//
|
||||
//
|
||||
const label curF = mag(curFaceLabels[facei]) - 1;
|
||||
|
||||
const face& f = fcs[curF];
|
||||
@ -775,3 +775,5 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
sort(globallySharedPoints_);
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -26,14 +26,10 @@ License
|
||||
|
||||
#include "fvFieldDecomposer.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
fvFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
Foam::fvFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
(
|
||||
const unallocLabelList& addressingSlice,
|
||||
const label addressingOffset
|
||||
@ -41,15 +37,15 @@ fvFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
:
|
||||
directAddressing_(addressingSlice)
|
||||
{
|
||||
forAll (directAddressing_, i)
|
||||
forAll(directAddressing_, i)
|
||||
{
|
||||
// Subtract one to align addressing.
|
||||
// Subtract one to align addressing.
|
||||
directAddressing_[i] -= addressingOffset + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fvFieldDecomposer::processorVolPatchFieldDecomposer::
|
||||
Foam::fvFieldDecomposer::processorVolPatchFieldDecomposer::
|
||||
processorVolPatchFieldDecomposer
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
@ -61,9 +57,9 @@ processorVolPatchFieldDecomposer
|
||||
const labelList& own = mesh.faceOwner();
|
||||
const labelList& neighb = mesh.faceNeighbour();
|
||||
|
||||
forAll (directAddressing_, i)
|
||||
forAll(directAddressing_, i)
|
||||
{
|
||||
// Subtract one to align addressing.
|
||||
// Subtract one to align addressing.
|
||||
label ai = mag(addressingSlice[i]) - 1;
|
||||
|
||||
if (ai < neighb.size())
|
||||
@ -97,7 +93,7 @@ processorVolPatchFieldDecomposer
|
||||
}
|
||||
|
||||
|
||||
fvFieldDecomposer::processorSurfacePatchFieldDecomposer::
|
||||
Foam::fvFieldDecomposer::processorSurfacePatchFieldDecomposer::
|
||||
processorSurfacePatchFieldDecomposer
|
||||
(
|
||||
const unallocLabelList& addressingSlice
|
||||
@ -106,7 +102,7 @@ processorSurfacePatchFieldDecomposer
|
||||
addressing_(addressingSlice.size()),
|
||||
weights_(addressingSlice.size())
|
||||
{
|
||||
forAll (addressing_, i)
|
||||
forAll(addressing_, i)
|
||||
{
|
||||
addressing_[i].setSize(1);
|
||||
weights_[i].setSize(1);
|
||||
@ -117,7 +113,7 @@ processorSurfacePatchFieldDecomposer
|
||||
}
|
||||
|
||||
|
||||
fvFieldDecomposer::fvFieldDecomposer
|
||||
Foam::fvFieldDecomposer::fvFieldDecomposer
|
||||
(
|
||||
const fvMesh& completeMesh,
|
||||
const fvMesh& procMesh,
|
||||
@ -147,7 +143,7 @@ fvFieldDecomposer::fvFieldDecomposer
|
||||
static_cast<processorSurfacePatchFieldDecomposer*>(NULL)
|
||||
)
|
||||
{
|
||||
forAll (boundaryAddressing_, patchi)
|
||||
forAll(boundaryAddressing_, patchi)
|
||||
{
|
||||
if (boundaryAddressing_[patchi] >= 0)
|
||||
{
|
||||
@ -162,14 +158,14 @@ fvFieldDecomposer::fvFieldDecomposer
|
||||
}
|
||||
else
|
||||
{
|
||||
processorVolPatchFieldDecomposerPtrs_[patchi] =
|
||||
processorVolPatchFieldDecomposerPtrs_[patchi] =
|
||||
new processorVolPatchFieldDecomposer
|
||||
(
|
||||
completeMesh_,
|
||||
procMesh_.boundary()[patchi].patchSlice(faceAddressing_)
|
||||
);
|
||||
|
||||
processorSurfacePatchFieldDecomposerPtrs_[patchi] =
|
||||
processorSurfacePatchFieldDecomposerPtrs_[patchi] =
|
||||
new processorSurfacePatchFieldDecomposer
|
||||
(
|
||||
static_cast<const unallocLabelList&>
|
||||
@ -187,9 +183,9 @@ fvFieldDecomposer::fvFieldDecomposer
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
fvFieldDecomposer::~fvFieldDecomposer()
|
||||
Foam::fvFieldDecomposer::~fvFieldDecomposer()
|
||||
{
|
||||
forAll (patchFieldDecomposerPtrs_, patchi)
|
||||
forAll(patchFieldDecomposerPtrs_, patchi)
|
||||
{
|
||||
if (patchFieldDecomposerPtrs_[patchi])
|
||||
{
|
||||
@ -197,7 +193,7 @@ fvFieldDecomposer::~fvFieldDecomposer()
|
||||
}
|
||||
}
|
||||
|
||||
forAll (processorVolPatchFieldDecomposerPtrs_, patchi)
|
||||
forAll(processorVolPatchFieldDecomposerPtrs_, patchi)
|
||||
{
|
||||
if (processorVolPatchFieldDecomposerPtrs_[patchi])
|
||||
{
|
||||
@ -205,7 +201,7 @@ fvFieldDecomposer::~fvFieldDecomposer()
|
||||
}
|
||||
}
|
||||
|
||||
forAll (processorSurfacePatchFieldDecomposerPtrs_, patchi)
|
||||
forAll(processorSurfacePatchFieldDecomposerPtrs_, patchi)
|
||||
{
|
||||
if (processorSurfacePatchFieldDecomposerPtrs_[patchi])
|
||||
{
|
||||
@ -214,9 +210,4 @@ fvFieldDecomposer::~fvFieldDecomposer()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -28,16 +28,11 @@ License
|
||||
#include "processorFvPatchField.H"
|
||||
#include "processorFvsPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> >
|
||||
fvFieldDecomposer::decomposeField
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::fvFieldDecomposer::decomposeField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field
|
||||
) const
|
||||
@ -106,8 +101,8 @@ fvFieldDecomposer::decomposeField
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
fvFieldDecomposer::decomposeField
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >
|
||||
Foam::fvFieldDecomposer::decomposeField
|
||||
(
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh>& field
|
||||
) const
|
||||
@ -217,7 +212,7 @@ fvFieldDecomposer::decomposeField
|
||||
|
||||
|
||||
template<class GeoField>
|
||||
void fvFieldDecomposer::decomposeFields
|
||||
void Foam::fvFieldDecomposer::decomposeFields
|
||||
(
|
||||
const PtrList<GeoField>& fields
|
||||
) const
|
||||
@ -229,8 +224,4 @@ void fvFieldDecomposer::decomposeFields
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -29,16 +29,10 @@ Description
|
||||
|
||||
#include "lagrangianFieldDecomposer.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct from components
|
||||
lagrangianFieldDecomposer::lagrangianFieldDecomposer
|
||||
Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const polyMesh& procMesh,
|
||||
@ -88,6 +82,4 @@ lagrangianFieldDecomposer::lagrangianFieldDecomposer
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -27,15 +27,10 @@ License
|
||||
#include "lagrangianFieldDecomposer.H"
|
||||
#include "IOobjectList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
void lagrangianFieldDecomposer::readFields
|
||||
void Foam::lagrangianFieldDecomposer::readFields
|
||||
(
|
||||
const label cloudI,
|
||||
const IOobjectList& lagrangianObjects,
|
||||
@ -70,7 +65,8 @@ void lagrangianFieldDecomposer::readFields
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<IOField<Type> > lagrangianFieldDecomposer::decomposeField
|
||||
Foam::tmp<Foam::IOField<Type> >
|
||||
Foam::lagrangianFieldDecomposer::decomposeField
|
||||
(
|
||||
const word& cloudName,
|
||||
const IOField<Type>& field
|
||||
@ -100,7 +96,7 @@ tmp<IOField<Type> > lagrangianFieldDecomposer::decomposeField
|
||||
|
||||
|
||||
template<class GeoField>
|
||||
void lagrangianFieldDecomposer::decomposeFields
|
||||
void Foam::lagrangianFieldDecomposer::decomposeFields
|
||||
(
|
||||
const word& cloudName,
|
||||
const PtrList<GeoField>& fields
|
||||
@ -116,8 +112,4 @@ void lagrangianFieldDecomposer::decomposeFields
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -26,14 +26,9 @@ License
|
||||
|
||||
#include "pointFieldDecomposer.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
|
||||
Foam::pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
(
|
||||
const pointPatch& completeMeshPatch,
|
||||
const pointPatch& procMeshPatch,
|
||||
@ -52,7 +47,7 @@ pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
|
||||
const labelList& completeMeshPatchPoints = completeMeshPatch.meshPoints();
|
||||
|
||||
forAll (completeMeshPatchPoints, pointi)
|
||||
forAll(completeMeshPatchPoints, pointi)
|
||||
{
|
||||
pointMap[completeMeshPatchPoints[pointi]] = pointi;
|
||||
}
|
||||
@ -61,7 +56,7 @@ pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
// patch
|
||||
const labelList& procMeshPatchPoints = procMeshPatch.meshPoints();
|
||||
|
||||
forAll (procMeshPatchPoints, pointi)
|
||||
forAll(procMeshPatchPoints, pointi)
|
||||
{
|
||||
directAddressing_[pointi] =
|
||||
pointMap[directAddr[procMeshPatchPoints[pointi]]];
|
||||
@ -79,7 +74,7 @@ pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
}
|
||||
|
||||
|
||||
pointFieldDecomposer::pointFieldDecomposer
|
||||
Foam::pointFieldDecomposer::pointFieldDecomposer
|
||||
(
|
||||
const pointMesh& completeMesh,
|
||||
const pointMesh& procMesh,
|
||||
@ -97,7 +92,7 @@ pointFieldDecomposer::pointFieldDecomposer
|
||||
static_cast<patchFieldDecomposer*>(NULL)
|
||||
)
|
||||
{
|
||||
forAll (boundaryAddressing_, patchi)
|
||||
forAll(boundaryAddressing_, patchi)
|
||||
{
|
||||
if (boundaryAddressing_[patchi] >= 0)
|
||||
{
|
||||
@ -114,9 +109,9 @@ pointFieldDecomposer::pointFieldDecomposer
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
pointFieldDecomposer::~pointFieldDecomposer()
|
||||
Foam::pointFieldDecomposer::~pointFieldDecomposer()
|
||||
{
|
||||
forAll (patchFieldDecomposerPtrs_, patchi)
|
||||
forAll(patchFieldDecomposerPtrs_, patchi)
|
||||
{
|
||||
if (patchFieldDecomposerPtrs_[patchi])
|
||||
{
|
||||
@ -128,6 +123,4 @@ pointFieldDecomposer::~pointFieldDecomposer()
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -28,16 +28,11 @@ License
|
||||
#include "processorPointPatchFields.H"
|
||||
#include "globalPointPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh> >
|
||||
pointFieldDecomposer::decomposeField
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> >
|
||||
Foam::pointFieldDecomposer::decomposeField
|
||||
(
|
||||
const GeometricField<Type, pointPatchField, pointMesh>& field
|
||||
) const
|
||||
@ -117,7 +112,7 @@ pointFieldDecomposer::decomposeField
|
||||
|
||||
|
||||
template<class GeoField>
|
||||
void pointFieldDecomposer::decomposeFields
|
||||
void Foam::pointFieldDecomposer::decomposeFields
|
||||
(
|
||||
const PtrList<GeoField>& fields
|
||||
) const
|
||||
@ -131,6 +126,4 @@ void pointFieldDecomposer::decomposeFields
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -1,7 +1,3 @@
|
||||
processorMeshes.C
|
||||
fvFieldReconstructor.C
|
||||
pointFieldReconstructor.C
|
||||
reconstructLagrangianPositions.C
|
||||
reconstructPar.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/reconstructPar
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/reconstruct/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-llagrangian \
|
||||
-lmeshTools
|
||||
-lmeshTools \
|
||||
-lreconstruct
|
||||
|
||||
@ -1,48 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvFieldReconstructor.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::fvFieldReconstructor::fvFieldReconstructor
|
||||
(
|
||||
fvMesh& mesh,
|
||||
const PtrList<fvMesh>& procMeshes,
|
||||
const PtrList<labelIOList>& faceProcAddressing,
|
||||
const PtrList<labelIOList>& cellProcAddressing,
|
||||
const PtrList<labelIOList>& boundaryProcAddressing
|
||||
)
|
||||
:
|
||||
mesh_(mesh),
|
||||
procMeshes_(procMeshes),
|
||||
faceProcAddressing_(faceProcAddressing),
|
||||
cellProcAddressing_(cellProcAddressing),
|
||||
boundaryProcAddressing_(boundaryProcAddressing)
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,186 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::fvFieldReconstructor
|
||||
|
||||
Description
|
||||
FV volume and surface field reconstructor.
|
||||
|
||||
SourceFiles
|
||||
fvFieldReconstructor.C
|
||||
fvFieldReconstructorReconstructFields.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef fvFieldReconstructor_H
|
||||
#define fvFieldReconstructor_H
|
||||
|
||||
#include "PtrList.H"
|
||||
#include "fvMesh.H"
|
||||
#include "IOobjectList.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
#include "labelIOList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class fvFieldReconstructor Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class fvFieldReconstructor
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Reconstructed mesh reference
|
||||
fvMesh& mesh_;
|
||||
|
||||
//- List of processor meshes
|
||||
const PtrList<fvMesh>& procMeshes_;
|
||||
|
||||
//- List of processor face addressing lists
|
||||
const PtrList<labelIOList>& faceProcAddressing_;
|
||||
|
||||
//- List of processor cell addressing lists
|
||||
const PtrList<labelIOList>& cellProcAddressing_;
|
||||
|
||||
//- List of processor boundary addressing lists
|
||||
const PtrList<labelIOList>& boundaryProcAddressing_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
fvFieldReconstructor(const fvFieldReconstructor&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const fvFieldReconstructor&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
class fvPatchFieldReconstructor
|
||||
:
|
||||
public fvPatchFieldMapper
|
||||
{
|
||||
label size_;
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given size
|
||||
fvPatchFieldReconstructor(const label size)
|
||||
:
|
||||
size_(size)
|
||||
{}
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
label size() const
|
||||
{
|
||||
return size_;
|
||||
}
|
||||
|
||||
bool direct() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const unallocLabelList& directAddressing() const
|
||||
{
|
||||
return unallocLabelList::null();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
fvFieldReconstructor
|
||||
(
|
||||
fvMesh& mesh,
|
||||
const PtrList<fvMesh>& procMeshes,
|
||||
const PtrList<labelIOList>& faceProcAddressing,
|
||||
const PtrList<labelIOList>& cellProcAddressing,
|
||||
const PtrList<labelIOList>& boundaryProcAddressing
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Reconstruct volume field
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> >
|
||||
reconstructFvVolumeField
|
||||
(
|
||||
const IOobject& fieldIoObject
|
||||
);
|
||||
|
||||
//- Reconstruct surface field
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
reconstructFvSurfaceField
|
||||
(
|
||||
const IOobject& fieldIoObject
|
||||
);
|
||||
|
||||
//- Reconstruct and write all/selected volume fields
|
||||
template<class Type>
|
||||
void reconstructFvVolumeFields
|
||||
(
|
||||
const IOobjectList& objects,
|
||||
const HashSet<word>& selectedFields
|
||||
);
|
||||
|
||||
//- Reconstruct and write all/selected volume fields
|
||||
template<class Type>
|
||||
void reconstructFvSurfaceFields
|
||||
(
|
||||
const IOobjectList& objects,
|
||||
const HashSet<word>& selectedFields
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "fvFieldReconstructorReconstructFields.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,524 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvFieldReconstructor.H"
|
||||
#include "Time.H"
|
||||
#include "PtrList.H"
|
||||
#include "fvPatchFields.H"
|
||||
#include "emptyFvPatch.H"
|
||||
#include "emptyFvPatchField.H"
|
||||
#include "emptyFvsPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::fvFieldReconstructor::reconstructFvVolumeField
|
||||
(
|
||||
const IOobject& fieldIoObject
|
||||
)
|
||||
{
|
||||
// Read the field for all the processors
|
||||
PtrList<GeometricField<Type, fvPatchField, volMesh> > procFields
|
||||
(
|
||||
procMeshes_.size()
|
||||
);
|
||||
|
||||
forAll (procMeshes_, procI)
|
||||
{
|
||||
procFields.set
|
||||
(
|
||||
procI,
|
||||
new GeometricField<Type, fvPatchField, volMesh>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
fieldIoObject.name(),
|
||||
procMeshes_[procI].time().timeName(),
|
||||
procMeshes_[procI],
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
procMeshes_[procI]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Create the internalField
|
||||
Field<Type> internalField(mesh_.nCells());
|
||||
|
||||
// Create the patch fields
|
||||
PtrList<fvPatchField<Type> > patchFields(mesh_.boundary().size());
|
||||
|
||||
|
||||
forAll (procMeshes_, procI)
|
||||
{
|
||||
const GeometricField<Type, fvPatchField, volMesh>& procField =
|
||||
procFields[procI];
|
||||
|
||||
// Set the cell values in the reconstructed field
|
||||
internalField.rmap
|
||||
(
|
||||
procField.internalField(),
|
||||
cellProcAddressing_[procI]
|
||||
);
|
||||
|
||||
// Set the boundary patch values in the reconstructed field
|
||||
forAll(boundaryProcAddressing_[procI], patchI)
|
||||
{
|
||||
// Get patch index of the original patch
|
||||
const label curBPatch = boundaryProcAddressing_[procI][patchI];
|
||||
|
||||
// Get addressing slice for this patch
|
||||
const labelList::subList cp =
|
||||
procMeshes_[procI].boundary()[patchI].patchSlice
|
||||
(
|
||||
faceProcAddressing_[procI]
|
||||
);
|
||||
|
||||
// check if the boundary patch is not a processor patch
|
||||
if (curBPatch >= 0)
|
||||
{
|
||||
// Regular patch. Fast looping
|
||||
|
||||
if (!patchFields(curBPatch))
|
||||
{
|
||||
patchFields.set
|
||||
(
|
||||
curBPatch,
|
||||
fvPatchField<Type>::New
|
||||
(
|
||||
procField.boundaryField()[patchI],
|
||||
mesh_.boundary()[curBPatch],
|
||||
DimensionedField<Type, volMesh>::null(),
|
||||
fvPatchFieldReconstructor
|
||||
(
|
||||
mesh_.boundary()[curBPatch].size()
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
const label curPatchStart =
|
||||
mesh_.boundaryMesh()[curBPatch].start();
|
||||
|
||||
labelList reverseAddressing(cp.size());
|
||||
|
||||
forAll(cp, faceI)
|
||||
{
|
||||
// Subtract one to take into account offsets for
|
||||
// face direction.
|
||||
reverseAddressing[faceI] = cp[faceI] - 1 - curPatchStart;
|
||||
}
|
||||
|
||||
patchFields[curBPatch].rmap
|
||||
(
|
||||
procField.boundaryField()[patchI],
|
||||
reverseAddressing
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
const Field<Type>& curProcPatch =
|
||||
procField.boundaryField()[patchI];
|
||||
|
||||
// In processor patches, there's a mix of internal faces (some
|
||||
// of them turned) and possible cyclics. Slow loop
|
||||
forAll(cp, faceI)
|
||||
{
|
||||
// Subtract one to take into account offsets for
|
||||
// face direction.
|
||||
label curF = cp[faceI] - 1;
|
||||
|
||||
// Is the face on the boundary?
|
||||
if (curF >= mesh_.nInternalFaces())
|
||||
{
|
||||
label curBPatch = mesh_.boundaryMesh().whichPatch(curF);
|
||||
|
||||
if (!patchFields(curBPatch))
|
||||
{
|
||||
patchFields.set
|
||||
(
|
||||
curBPatch,
|
||||
fvPatchField<Type>::New
|
||||
(
|
||||
mesh_.boundary()[curBPatch].type(),
|
||||
mesh_.boundary()[curBPatch],
|
||||
DimensionedField<Type, volMesh>::null()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// add the face
|
||||
label curPatchFace =
|
||||
mesh_.boundaryMesh()
|
||||
[curBPatch].whichFace(curF);
|
||||
|
||||
patchFields[curBPatch][curPatchFace] =
|
||||
curProcPatch[faceI];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
forAll(mesh_.boundary(), patchI)
|
||||
{
|
||||
// add empty patches
|
||||
if
|
||||
(
|
||||
isType<emptyFvPatch>(mesh_.boundary()[patchI])
|
||||
&& !patchFields(patchI)
|
||||
)
|
||||
{
|
||||
patchFields.set
|
||||
(
|
||||
patchI,
|
||||
fvPatchField<Type>::New
|
||||
(
|
||||
emptyFvPatchField<Type>::typeName,
|
||||
mesh_.boundary()[patchI],
|
||||
DimensionedField<Type, volMesh>::null()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Now construct and write the field
|
||||
// setting the internalField and patchFields
|
||||
return tmp<GeometricField<Type, fvPatchField, volMesh> >
|
||||
(
|
||||
new GeometricField<Type, fvPatchField, volMesh>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
fieldIoObject.name(),
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
procFields[0].dimensions(),
|
||||
internalField,
|
||||
patchFields
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >
|
||||
Foam::fvFieldReconstructor::reconstructFvSurfaceField
|
||||
(
|
||||
const IOobject& fieldIoObject
|
||||
)
|
||||
{
|
||||
// Read the field for all the processors
|
||||
PtrList<GeometricField<Type, fvsPatchField, surfaceMesh> > procFields
|
||||
(
|
||||
procMeshes_.size()
|
||||
);
|
||||
|
||||
forAll (procMeshes_, procI)
|
||||
{
|
||||
procFields.set
|
||||
(
|
||||
procI,
|
||||
new GeometricField<Type, fvsPatchField, surfaceMesh>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
fieldIoObject.name(),
|
||||
procMeshes_[procI].time().timeName(),
|
||||
procMeshes_[procI],
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
procMeshes_[procI]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Create the internalField
|
||||
Field<Type> internalField(mesh_.nInternalFaces());
|
||||
|
||||
// Create the patch fields
|
||||
PtrList<fvsPatchField<Type> > patchFields(mesh_.boundary().size());
|
||||
|
||||
|
||||
forAll (procMeshes_, procI)
|
||||
{
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh>& procField =
|
||||
procFields[procI];
|
||||
|
||||
// Set the face values in the reconstructed field
|
||||
|
||||
// It is necessary to create a copy of the addressing array to
|
||||
// take care of the face direction offset trick.
|
||||
//
|
||||
{
|
||||
labelList curAddr(faceProcAddressing_[procI]);
|
||||
|
||||
forAll (curAddr, addrI)
|
||||
{
|
||||
curAddr[addrI] -= 1;
|
||||
}
|
||||
|
||||
internalField.rmap
|
||||
(
|
||||
procField.internalField(),
|
||||
curAddr
|
||||
);
|
||||
}
|
||||
|
||||
// Set the boundary patch values in the reconstructed field
|
||||
forAll(boundaryProcAddressing_[procI], patchI)
|
||||
{
|
||||
// Get patch index of the original patch
|
||||
const label curBPatch = boundaryProcAddressing_[procI][patchI];
|
||||
|
||||
// Get addressing slice for this patch
|
||||
const labelList::subList cp =
|
||||
procMeshes_[procI].boundary()[patchI].patchSlice
|
||||
(
|
||||
faceProcAddressing_[procI]
|
||||
);
|
||||
|
||||
// check if the boundary patch is not a processor patch
|
||||
if (curBPatch >= 0)
|
||||
{
|
||||
// Regular patch. Fast looping
|
||||
|
||||
if (!patchFields(curBPatch))
|
||||
{
|
||||
patchFields.set
|
||||
(
|
||||
curBPatch,
|
||||
fvsPatchField<Type>::New
|
||||
(
|
||||
procField.boundaryField()[patchI],
|
||||
mesh_.boundary()[curBPatch],
|
||||
DimensionedField<Type, surfaceMesh>::null(),
|
||||
fvPatchFieldReconstructor
|
||||
(
|
||||
mesh_.boundary()[curBPatch].size()
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
const label curPatchStart =
|
||||
mesh_.boundaryMesh()[curBPatch].start();
|
||||
|
||||
labelList reverseAddressing(cp.size());
|
||||
|
||||
forAll(cp, faceI)
|
||||
{
|
||||
// Subtract one to take into account offsets for
|
||||
// face direction.
|
||||
reverseAddressing[faceI] = cp[faceI] - 1 - curPatchStart;
|
||||
}
|
||||
|
||||
patchFields[curBPatch].rmap
|
||||
(
|
||||
procField.boundaryField()[patchI],
|
||||
reverseAddressing
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
const Field<Type>& curProcPatch =
|
||||
procField.boundaryField()[patchI];
|
||||
|
||||
// In processor patches, there's a mix of internal faces (some
|
||||
// of them turned) and possible cyclics. Slow loop
|
||||
forAll(cp, faceI)
|
||||
{
|
||||
label curF = cp[faceI] - 1;
|
||||
|
||||
// Is the face turned the right side round
|
||||
if (curF >= 0)
|
||||
{
|
||||
// Is the face on the boundary?
|
||||
if (curF >= mesh_.nInternalFaces())
|
||||
{
|
||||
label curBPatch =
|
||||
mesh_.boundaryMesh().whichPatch(curF);
|
||||
|
||||
if (!patchFields(curBPatch))
|
||||
{
|
||||
patchFields.set
|
||||
(
|
||||
curBPatch,
|
||||
fvsPatchField<Type>::New
|
||||
(
|
||||
mesh_.boundary()[curBPatch].type(),
|
||||
mesh_.boundary()[curBPatch],
|
||||
DimensionedField<Type, surfaceMesh>
|
||||
::null()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// add the face
|
||||
label curPatchFace =
|
||||
mesh_.boundaryMesh()
|
||||
[curBPatch].whichFace(curF);
|
||||
|
||||
patchFields[curBPatch][curPatchFace] =
|
||||
curProcPatch[faceI];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Internal face
|
||||
internalField[curF] = curProcPatch[faceI];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
forAll(mesh_.boundary(), patchI)
|
||||
{
|
||||
// add empty patches
|
||||
if
|
||||
(
|
||||
isType<emptyFvPatch>(mesh_.boundary()[patchI])
|
||||
&& !patchFields(patchI)
|
||||
)
|
||||
{
|
||||
patchFields.set
|
||||
(
|
||||
patchI,
|
||||
fvsPatchField<Type>::New
|
||||
(
|
||||
emptyFvsPatchField<Type>::typeName,
|
||||
mesh_.boundary()[patchI],
|
||||
DimensionedField<Type, surfaceMesh>::null()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Now construct and write the field
|
||||
// setting the internalField and patchFields
|
||||
return tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
(
|
||||
new GeometricField<Type, fvsPatchField, surfaceMesh>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
fieldIoObject.name(),
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
procFields[0].dimensions(),
|
||||
internalField,
|
||||
patchFields
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Reconstruct and write all/selected volume fields
|
||||
template<class Type>
|
||||
void Foam::fvFieldReconstructor::reconstructFvVolumeFields
|
||||
(
|
||||
const IOobjectList& objects,
|
||||
const HashSet<word>& selectedFields
|
||||
)
|
||||
{
|
||||
const word& fieldClassName =
|
||||
GeometricField<Type, fvPatchField, volMesh>::typeName;
|
||||
|
||||
IOobjectList fields = objects.lookupClass(fieldClassName);
|
||||
|
||||
if (fields.size())
|
||||
{
|
||||
Info<< " Reconstructing " << fieldClassName << "s\n" << endl;
|
||||
|
||||
forAllConstIter(IOobjectList, fields, fieldIter)
|
||||
{
|
||||
if
|
||||
(
|
||||
!selectedFields.size()
|
||||
|| selectedFields.found(fieldIter()->name())
|
||||
)
|
||||
{
|
||||
Info<< " " << fieldIter()->name() << endl;
|
||||
|
||||
reconstructFvVolumeField<Type>(*fieldIter())().write();
|
||||
}
|
||||
}
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Reconstruct and write all/selected surface fields
|
||||
template<class Type>
|
||||
void Foam::fvFieldReconstructor::reconstructFvSurfaceFields
|
||||
(
|
||||
const IOobjectList& objects,
|
||||
const HashSet<word>& selectedFields
|
||||
)
|
||||
{
|
||||
const word& fieldClassName =
|
||||
GeometricField<Type, fvsPatchField, surfaceMesh>::typeName;
|
||||
|
||||
IOobjectList fields = objects.lookupClass(fieldClassName);
|
||||
|
||||
if (fields.size())
|
||||
{
|
||||
Info<< " Reconstructing " << fieldClassName << "s\n" << endl;
|
||||
|
||||
forAllConstIter(IOobjectList, fields, fieldIter)
|
||||
{
|
||||
if
|
||||
(
|
||||
!selectedFields.size()
|
||||
|| selectedFields.found(fieldIter()->name())
|
||||
)
|
||||
{
|
||||
Info<< " " << fieldIter()->name() << endl;
|
||||
|
||||
reconstructFvSurfaceField<Type>(*fieldIter())().write();
|
||||
}
|
||||
}
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,105 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "pointFieldReconstructor.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::pointFieldReconstructor::pointFieldReconstructor
|
||||
(
|
||||
const pointMesh& mesh,
|
||||
const PtrList<pointMesh>& procMeshes,
|
||||
const PtrList<labelIOList>& pointProcAddressing,
|
||||
const PtrList<labelIOList>& boundaryProcAddressing
|
||||
)
|
||||
:
|
||||
mesh_(mesh),
|
||||
procMeshes_(procMeshes),
|
||||
pointProcAddressing_(pointProcAddressing),
|
||||
boundaryProcAddressing_(boundaryProcAddressing),
|
||||
patchPointAddressing_(procMeshes.size())
|
||||
{
|
||||
// Inverse-addressing of the patch point labels.
|
||||
labelList pointMap(mesh_.size(), -1);
|
||||
|
||||
// Create the pointPatch addressing
|
||||
forAll(procMeshes_, proci)
|
||||
{
|
||||
const pointMesh& procMesh = procMeshes_[proci];
|
||||
|
||||
patchPointAddressing_[proci].setSize(procMesh.boundary().size());
|
||||
|
||||
forAll(procMesh.boundary(), patchi)
|
||||
{
|
||||
if (boundaryProcAddressing_[proci][patchi] >= 0)
|
||||
{
|
||||
labelList& procPatchAddr = patchPointAddressing_[proci][patchi];
|
||||
procPatchAddr.setSize(procMesh.boundary()[patchi].size(), -1);
|
||||
|
||||
const labelList& patchPointLabels =
|
||||
mesh_.boundary()[boundaryProcAddressing_[proci][patchi]]
|
||||
.meshPoints();
|
||||
|
||||
// Create the inverse-addressing of the patch point labels.
|
||||
forAll (patchPointLabels, pointi)
|
||||
{
|
||||
pointMap[patchPointLabels[pointi]] = pointi;
|
||||
}
|
||||
|
||||
const labelList& procPatchPoints =
|
||||
procMesh.boundary()[patchi].meshPoints();
|
||||
|
||||
forAll (procPatchPoints, pointi)
|
||||
{
|
||||
procPatchAddr[pointi] =
|
||||
pointMap
|
||||
[
|
||||
pointProcAddressing_[proci][procPatchPoints[pointi]]
|
||||
];
|
||||
}
|
||||
|
||||
if (procPatchAddr.size() && min(procPatchAddr) < 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"pointFieldReconstructor::pointFieldReconstructor"
|
||||
"(\n"
|
||||
" const pointMesh& mesh,\n"
|
||||
" const PtrList<pointMesh>& procMeshes,\n"
|
||||
" const PtrList<labelIOList>& pointProcAddressing,\n"
|
||||
" const PtrList<labelIOList>& "
|
||||
"boundaryProcAddressing\n"
|
||||
")"
|
||||
) << "Incomplete patch point addressing"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,162 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::pointFieldReconstructor
|
||||
|
||||
Description
|
||||
Point field reconstructor.
|
||||
|
||||
SourceFiles
|
||||
pointFieldReconstructor.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef pointFieldReconstructor_H
|
||||
#define pointFieldReconstructor_H
|
||||
|
||||
#include "pointMesh.H"
|
||||
#include "pointFields.H"
|
||||
#include "pointPatchFieldMapperPatchRef.H"
|
||||
#include "IOobjectList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class pointFieldReconstructor Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class pointFieldReconstructor
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Reconstructed mesh reference
|
||||
const pointMesh& mesh_;
|
||||
|
||||
//- List of processor meshes
|
||||
const PtrList<pointMesh>& procMeshes_;
|
||||
|
||||
//- List of processor point addressing lists
|
||||
const PtrList<labelIOList>& pointProcAddressing_;
|
||||
|
||||
//- List of processor boundary addressing lists
|
||||
const PtrList<labelIOList>& boundaryProcAddressing_;
|
||||
|
||||
//- Point patch addressing
|
||||
labelListListList patchPointAddressing_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
pointFieldReconstructor
|
||||
(
|
||||
const pointFieldReconstructor&
|
||||
);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const pointFieldReconstructor&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
class pointPatchFieldReconstructor
|
||||
:
|
||||
public pointPatchFieldMapper
|
||||
{
|
||||
label size_;
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given size
|
||||
pointPatchFieldReconstructor(const label size)
|
||||
:
|
||||
size_(size)
|
||||
{}
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
label size() const
|
||||
{
|
||||
return size_;
|
||||
}
|
||||
|
||||
bool direct() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const unallocLabelList& directAddressing() const
|
||||
{
|
||||
return unallocLabelList::null();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
pointFieldReconstructor
|
||||
(
|
||||
const pointMesh& mesh,
|
||||
const PtrList<pointMesh>& procMeshes,
|
||||
const PtrList<labelIOList>& pointProcAddressing,
|
||||
const PtrList<labelIOList>& boundaryProcAddressing
|
||||
);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Reconstruct field
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh> >
|
||||
reconstructField(const IOobject& fieldIoObject);
|
||||
|
||||
//- Reconstruct and write all fields
|
||||
template<class Type>
|
||||
void reconstructFields(const IOobjectList& objects);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "pointFieldReconstructorReconstructFields.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,177 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "pointFieldReconstructor.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> >
|
||||
Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject)
|
||||
{
|
||||
// Read the field for all the processors
|
||||
PtrList<GeometricField<Type, pointPatchField, pointMesh> > procFields
|
||||
(
|
||||
procMeshes_.size()
|
||||
);
|
||||
|
||||
forAll (procMeshes_, proci)
|
||||
{
|
||||
procFields.set
|
||||
(
|
||||
proci,
|
||||
new GeometricField<Type, pointPatchField, pointMesh>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
fieldIoObject.name(),
|
||||
procMeshes_[proci]().time().timeName(),
|
||||
procMeshes_[proci](),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
procMeshes_[proci]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Create the internalField
|
||||
Field<Type> internalField(mesh_.size());
|
||||
|
||||
// Create the patch fields
|
||||
PtrList<pointPatchField<Type> > patchFields(mesh_.boundary().size());
|
||||
|
||||
|
||||
forAll (procMeshes_, proci)
|
||||
{
|
||||
const GeometricField<Type, pointPatchField, pointMesh>&
|
||||
procField = procFields[proci];
|
||||
|
||||
// Get processor-to-global addressing for use in rmap
|
||||
const labelList& procToGlobalAddr = pointProcAddressing_[proci];
|
||||
|
||||
// Set the cell values in the reconstructed field
|
||||
internalField.rmap
|
||||
(
|
||||
procField.internalField(),
|
||||
procToGlobalAddr
|
||||
);
|
||||
|
||||
// Set the boundary patch values in the reconstructed field
|
||||
forAll(boundaryProcAddressing_[proci], patchi)
|
||||
{
|
||||
// Get patch index of the original patch
|
||||
const label curBPatch = boundaryProcAddressing_[proci][patchi];
|
||||
|
||||
// check if the boundary patch is not a processor patch
|
||||
if (curBPatch >= 0)
|
||||
{
|
||||
if (!patchFields(curBPatch))
|
||||
{
|
||||
patchFields.set(
|
||||
curBPatch,
|
||||
pointPatchField<Type>::New
|
||||
(
|
||||
procField.boundaryField()[patchi],
|
||||
mesh_.boundary()[curBPatch],
|
||||
DimensionedField<Type, pointMesh>::null(),
|
||||
pointPatchFieldReconstructor
|
||||
(
|
||||
mesh_.boundary()[curBPatch].size()
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
patchFields[curBPatch].rmap
|
||||
(
|
||||
procField.boundaryField()[patchi],
|
||||
patchPointAddressing_[proci][patchi]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Construct and write the field
|
||||
// setting the internalField and patchFields
|
||||
return tmp<GeometricField<Type, pointPatchField, pointMesh> >
|
||||
(
|
||||
new GeometricField<Type, pointPatchField, pointMesh>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
fieldIoObject.name(),
|
||||
mesh_().time().timeName(),
|
||||
mesh_(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
procFields[0].dimensions(),
|
||||
internalField,
|
||||
patchFields
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Reconstruct and write all point fields
|
||||
template<class Type>
|
||||
void Foam::pointFieldReconstructor::reconstructFields
|
||||
(
|
||||
const IOobjectList& objects
|
||||
)
|
||||
{
|
||||
word fieldClassName
|
||||
(
|
||||
GeometricField<Type, pointPatchField, pointMesh>::typeName
|
||||
);
|
||||
|
||||
IOobjectList fields = objects.lookupClass(fieldClassName);
|
||||
|
||||
if (fields.size())
|
||||
{
|
||||
Info<< " Reconstructing " << fieldClassName << "s\n" << endl;
|
||||
|
||||
for
|
||||
(
|
||||
IOobjectList::iterator fieldIter = fields.begin();
|
||||
fieldIter != fields.end();
|
||||
++fieldIter
|
||||
)
|
||||
{
|
||||
Info<< " " << fieldIter()->name() << endl;
|
||||
|
||||
reconstructField<Type>(*fieldIter())().write();
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,254 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "processorMeshes.H"
|
||||
#include "Time.H"
|
||||
#include "primitiveMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::processorMeshes::read()
|
||||
{
|
||||
forAll (databases_, procI)
|
||||
{
|
||||
meshes_.set
|
||||
(
|
||||
procI,
|
||||
new fvMesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
meshName_,
|
||||
databases_[procI].timeName(),
|
||||
databases_[procI]
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
pointProcAddressing_.set
|
||||
(
|
||||
procI,
|
||||
new labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pointProcAddressing",
|
||||
meshes_[procI].facesInstance(),
|
||||
meshes_[procI].meshSubDir,
|
||||
meshes_[procI],
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
faceProcAddressing_.set
|
||||
(
|
||||
procI,
|
||||
new labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"faceProcAddressing",
|
||||
meshes_[procI].facesInstance(),
|
||||
meshes_[procI].meshSubDir,
|
||||
meshes_[procI],
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
cellProcAddressing_.set
|
||||
(
|
||||
procI,
|
||||
new labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"cellProcAddressing",
|
||||
meshes_[procI].facesInstance(),
|
||||
meshes_[procI].meshSubDir,
|
||||
meshes_[procI],
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
boundaryProcAddressing_.set
|
||||
(
|
||||
procI,
|
||||
new labelIOList
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"boundaryProcAddressing",
|
||||
meshes_[procI].facesInstance(),
|
||||
meshes_[procI].meshSubDir,
|
||||
meshes_[procI],
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::processorMeshes::processorMeshes
|
||||
(
|
||||
PtrList<Time>& databases,
|
||||
const word& meshName
|
||||
)
|
||||
:
|
||||
databases_(databases),
|
||||
meshName_(meshName),
|
||||
meshes_(databases.size()),
|
||||
pointProcAddressing_(databases.size()),
|
||||
faceProcAddressing_(databases.size()),
|
||||
cellProcAddressing_(databases.size()),
|
||||
boundaryProcAddressing_(databases.size())
|
||||
{
|
||||
read();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::fvMesh::readUpdateState Foam::processorMeshes::readUpdate()
|
||||
{
|
||||
fvMesh::readUpdateState stat = fvMesh::UNCHANGED;
|
||||
|
||||
forAll (databases_, procI)
|
||||
{
|
||||
// Check if any new meshes need to be read.
|
||||
fvMesh::readUpdateState procStat = meshes_[procI].readUpdate();
|
||||
|
||||
/*
|
||||
if (procStat != fvMesh::UNCHANGED)
|
||||
{
|
||||
Info<< "Processor " << procI
|
||||
<< " at time " << databases_[procI].timeName()
|
||||
<< " detected mesh change " << procStat
|
||||
<< endl;
|
||||
}
|
||||
*/
|
||||
|
||||
// Combine into overall mesh change status
|
||||
if (stat == fvMesh::UNCHANGED)
|
||||
{
|
||||
stat = procStat;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (stat != procStat)
|
||||
{
|
||||
FatalErrorIn("processorMeshes::readUpdate()")
|
||||
<< "Processor " << procI
|
||||
<< " has a different polyMesh at time "
|
||||
<< databases_[procI].timeName()
|
||||
<< " compared to any previous processors." << nl
|
||||
<< "Please check time " << databases_[procI].timeName()
|
||||
<< " directories on all processors for consistent"
|
||||
<< " mesh files."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
stat == fvMesh::TOPO_CHANGE
|
||||
|| stat == fvMesh::TOPO_PATCH_CHANGE
|
||||
)
|
||||
{
|
||||
// Reread all meshes and addresssing
|
||||
read();
|
||||
}
|
||||
return stat;
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorMeshes::reconstructPoints(fvMesh& mesh)
|
||||
{
|
||||
// Read the field for all the processors
|
||||
PtrList<pointIOField> procsPoints(meshes_.size());
|
||||
|
||||
forAll (meshes_, procI)
|
||||
{
|
||||
procsPoints.set
|
||||
(
|
||||
procI,
|
||||
new pointIOField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"points",
|
||||
meshes_[procI].time().timeName(),
|
||||
polyMesh::meshSubDir,
|
||||
meshes_[procI],
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Create the new points
|
||||
vectorField newPoints(mesh.nPoints());
|
||||
|
||||
forAll (meshes_, procI)
|
||||
{
|
||||
const vectorField& procPoints = procsPoints[procI];
|
||||
|
||||
// Set the cell values in the reconstructed field
|
||||
|
||||
const labelList& pointProcAddressingI = pointProcAddressing_[procI];
|
||||
|
||||
if (pointProcAddressingI.size() != procPoints.size())
|
||||
{
|
||||
FatalErrorIn("processorMeshes")
|
||||
<< "problem :"
|
||||
<< " pointProcAddressingI:" << pointProcAddressingI.size()
|
||||
<< " procPoints:" << procPoints.size()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
forAll(pointProcAddressingI, pointI)
|
||||
{
|
||||
newPoints[pointProcAddressingI[pointI]] = procPoints[pointI];
|
||||
}
|
||||
}
|
||||
|
||||
mesh.movePoints(newPoints);
|
||||
mesh.write();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,141 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::processorMeshes
|
||||
|
||||
Description
|
||||
Container for processor mesh addressing.
|
||||
|
||||
SourceFiles
|
||||
processorMeshes.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef processorMeshes_H
|
||||
#define processorMeshes_H
|
||||
|
||||
#include "PtrList.H"
|
||||
#include "fvMesh.H"
|
||||
#include "IOobjectList.H"
|
||||
#include "labelIOList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class processorMeshes Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class processorMeshes
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Processor databases
|
||||
PtrList<Time>& databases_;
|
||||
|
||||
const word meshName_;
|
||||
|
||||
//- List of processor meshes
|
||||
PtrList<fvMesh> meshes_;
|
||||
|
||||
//- List of processor point addressing lists
|
||||
PtrList<labelIOList> pointProcAddressing_;
|
||||
|
||||
//- List of processor face addressing lists
|
||||
PtrList<labelIOList> faceProcAddressing_;
|
||||
|
||||
//- List of processor cell addressing lists
|
||||
PtrList<labelIOList> cellProcAddressing_;
|
||||
|
||||
//- List of processor boundary addressing lists
|
||||
PtrList<labelIOList> boundaryProcAddressing_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Read all meshes
|
||||
void read();
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
processorMeshes(const processorMeshes&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const processorMeshes&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
processorMeshes(PtrList<Time>& databases, const word& meshName);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Update the meshes based on the mesh files saved in
|
||||
// time directories
|
||||
fvMesh::readUpdateState readUpdate();
|
||||
|
||||
//- Reconstruct point position after motion in parallel
|
||||
void reconstructPoints(fvMesh& mesh);
|
||||
|
||||
PtrList<fvMesh>& meshes()
|
||||
{
|
||||
return meshes_;
|
||||
}
|
||||
const PtrList<labelIOList>& pointProcAddressing() const
|
||||
{
|
||||
return pointProcAddressing_;
|
||||
}
|
||||
PtrList<labelIOList>& faceProcAddressing()
|
||||
{
|
||||
return faceProcAddressing_;
|
||||
}
|
||||
const PtrList<labelIOList>& cellProcAddressing() const
|
||||
{
|
||||
return cellProcAddressing_;
|
||||
}
|
||||
const PtrList<labelIOList>& boundaryProcAddressing() const
|
||||
{
|
||||
return boundaryProcAddressing_;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,95 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
InClass
|
||||
Foam::reconstructLagrangian
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
reconstructLagrangianPositions.C
|
||||
reconstructLagrangianFields.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef reconstructLagrangian_H
|
||||
#define reconstructLagrangian_H
|
||||
|
||||
#include "cloud.H"
|
||||
#include "polyMesh.H"
|
||||
#include "IOobjectList.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
void reconstructLagrangianPositions
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const word& cloudName,
|
||||
const PtrList<fvMesh>& meshes,
|
||||
const PtrList<labelIOList>& faceProcAddressing,
|
||||
const PtrList<labelIOList>& cellProcAddressing
|
||||
);
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<IOField<Type> > reconstructLagrangianField
|
||||
(
|
||||
const word& cloudName,
|
||||
const polyMesh& mesh,
|
||||
const PtrList<fvMesh>& meshes,
|
||||
const word& fieldName
|
||||
);
|
||||
|
||||
|
||||
template<class Type>
|
||||
void reconstructLagrangianFields
|
||||
(
|
||||
const word& cloudName,
|
||||
const polyMesh& mesh,
|
||||
const PtrList<fvMesh>& meshes,
|
||||
const IOobjectList& objects
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "reconstructLagrangianFields.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,126 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "IOField.H"
|
||||
#include "Time.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::IOField<Type> > Foam::reconstructLagrangianField
|
||||
(
|
||||
const word& cloudName,
|
||||
const polyMesh& mesh,
|
||||
const PtrList<fvMesh>& meshes,
|
||||
const word& fieldName
|
||||
)
|
||||
{
|
||||
// Construct empty field on mesh
|
||||
tmp<IOField<Type> > tfield
|
||||
(
|
||||
new IOField<Type>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
fieldName,
|
||||
mesh.time().timeName(),
|
||||
cloud::prefix/cloudName,
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
Field<Type>(0)
|
||||
)
|
||||
);
|
||||
Field<Type>& field = tfield();
|
||||
|
||||
forAll(meshes, i)
|
||||
{
|
||||
// Check object on local mesh
|
||||
IOobject localIOobject
|
||||
(
|
||||
fieldName,
|
||||
meshes[i].time().timeName(),
|
||||
cloud::prefix/cloudName,
|
||||
meshes[i],
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
if (localIOobject.headerOk())
|
||||
{
|
||||
IOField<Type> fieldi(localIOobject);
|
||||
|
||||
label offset = field.size();
|
||||
field.setSize(offset + fieldi.size());
|
||||
|
||||
forAll(fieldi, j)
|
||||
{
|
||||
field[offset + j] = fieldi[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tfield;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::reconstructLagrangianFields
|
||||
(
|
||||
const word& cloudName,
|
||||
const polyMesh& mesh,
|
||||
const PtrList<fvMesh>& meshes,
|
||||
const IOobjectList& objects
|
||||
)
|
||||
{
|
||||
word fieldClassName(IOField<Type>::typeName);
|
||||
|
||||
IOobjectList fields = objects.lookupClass(fieldClassName);
|
||||
|
||||
if (fields.size())
|
||||
{
|
||||
Info<< " Reconstructing lagrangian "
|
||||
<< fieldClassName << "s\n" << endl;
|
||||
|
||||
forAllIter(IOobjectList, fields, fieldIter)
|
||||
{
|
||||
Info<< " " << fieldIter()->name() << endl;
|
||||
reconstructLagrangianField<Type>
|
||||
(
|
||||
cloudName,
|
||||
mesh,
|
||||
meshes,
|
||||
fieldIter()->name()
|
||||
)().write();
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,76 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "reconstructLagrangian.H"
|
||||
#include "labelIOList.H"
|
||||
#include "Cloud.H"
|
||||
#include "passiveParticle.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::reconstructLagrangianPositions
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const word& cloudName,
|
||||
const PtrList<fvMesh>& meshes,
|
||||
const PtrList<labelIOList>& faceProcAddressing,
|
||||
const PtrList<labelIOList>& cellProcAddressing
|
||||
)
|
||||
{
|
||||
Cloud<passiveParticle> lagrangianPositions
|
||||
(
|
||||
mesh,
|
||||
cloudName,
|
||||
IDLList<passiveParticle>()
|
||||
);
|
||||
|
||||
forAll(meshes, i)
|
||||
{
|
||||
const labelList& cellMap = cellProcAddressing[i];
|
||||
|
||||
Cloud<passiveParticle> lpi(meshes[i], cloudName, false);
|
||||
|
||||
forAllIter(Cloud<passiveParticle>, lpi, iter)
|
||||
{
|
||||
const passiveParticle& ppi = iter();
|
||||
|
||||
lagrangianPositions.append
|
||||
(
|
||||
new passiveParticle
|
||||
(
|
||||
lagrangianPositions,
|
||||
ppi.position(),
|
||||
cellMap[ppi.cell()]
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
IOPosition<passiveParticle>(lagrangianPositions).write();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -137,7 +137,7 @@ int main(int argc, char *argv[])
|
||||
// Set time for global database
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
|
||||
Info << "Time = " << runTime.timeName() << endl << endl;
|
||||
Info<< "Time = " << runTime.timeName() << endl << endl;
|
||||
|
||||
// Set time for all databases
|
||||
forAll (databases, procI)
|
||||
@ -183,7 +183,7 @@ int main(int argc, char *argv[])
|
||||
|| objects.lookupClass(surfaceScalarField::typeName).size()
|
||||
)
|
||||
{
|
||||
Info << "Reconstructing FV fields" << nl << endl;
|
||||
Info<< "Reconstructing FV fields" << nl << endl;
|
||||
|
||||
fvFieldReconstructor fvReconstructor
|
||||
(
|
||||
@ -228,7 +228,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << "No FV fields" << nl << endl;
|
||||
Info<< "No FV fields" << nl << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -242,7 +242,7 @@ int main(int argc, char *argv[])
|
||||
|| objects.lookupClass(pointTensorField::typeName).size()
|
||||
)
|
||||
{
|
||||
Info << "Reconstructing point fields" << nl << endl;
|
||||
Info<< "Reconstructing point fields" << nl << endl;
|
||||
|
||||
pointMesh pMesh(mesh);
|
||||
PtrList<pointMesh> pMeshes(procMeshes.meshes().size());
|
||||
@ -268,7 +268,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << "No point fields" << nl << endl;
|
||||
Info<< "No point fields" << nl << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -388,7 +388,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << "No lagrangian fields" << nl << endl;
|
||||
Info<< "No lagrangian fields" << nl << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude
|
||||
|
||||
@ -33,11 +33,11 @@ Description
|
||||
Balances mesh and writes new mesh to new time directory.
|
||||
|
||||
Can also work like decomposePar:
|
||||
|
||||
@verbatim
|
||||
mkdir processor0
|
||||
cp -r constant processor0
|
||||
mpirun -np ddd redistributeMeshPar -parallel
|
||||
|
||||
@endverbatim
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "Field.H"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user