INT: Integration updates in preparation for merge into the develop branch

This commit is contained in:
Andrew Heather
2017-09-27 09:30:59 +01:00
committed by Andrew Heather
parent 9aff74aaaf
commit 50d1ac15ef
307 changed files with 3565 additions and 7316 deletions

View File

@ -31,23 +31,17 @@ Description
#include "faMesh.H"
#include "primitiveMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(faBoundaryMesh, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
defineTypeNameAndDebug(faBoundaryMesh, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from dictionary
faBoundaryMesh::faBoundaryMesh
Foam::faBoundaryMesh::faBoundaryMesh
(
const IOobject& io,
const faMesh& mesh
@ -83,19 +77,14 @@ faBoundaryMesh::faBoundaryMesh
}
// Check state of IOstream
is.check
(
"faBoundaryMesh::polyBoundaryMesh"
"(const IOobject&, const faMesh&)"
);
is.check(FUNCTION_NAME);
close();
}
}
// Construct given size. Patches will be set later
faBoundaryMesh::faBoundaryMesh
Foam::faBoundaryMesh::faBoundaryMesh
(
const IOobject& io,
const faMesh& pm,
@ -110,8 +99,7 @@ faBoundaryMesh::faBoundaryMesh
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Calculate the geometry for the patches (transformation tensors etc.)
void faBoundaryMesh::calcGeometry()
void Foam::faBoundaryMesh::calcGeometry()
{
forAll(*this, patchi)
{
@ -125,25 +113,24 @@ void faBoundaryMesh::calcGeometry()
}
// Return the mesh reference
const faMesh& faBoundaryMesh::mesh() const
const Foam::faMesh& Foam::faBoundaryMesh::mesh() const
{
return mesh_;
}
lduInterfacePtrsList faBoundaryMesh::interfaces() const
Foam::lduInterfacePtrsList Foam::faBoundaryMesh::interfaces() const
{
lduInterfacePtrsList interfaces(size());
forAll (interfaces, patchi)
forAll(interfaces, patchi)
{
if (isA<lduInterface>(this->operator[](patchi)))
{
interfaces.set
(
patchi,
&refCast<const lduInterface>(this->operator[](patchi))
&refCast<const lduInterface>(this->operator[](patchi))
);
}
}
@ -152,14 +139,13 @@ lduInterfacePtrsList faBoundaryMesh::interfaces() const
}
// Return a list of patch types
wordList faBoundaryMesh::types() const
Foam::wordList Foam::faBoundaryMesh::types() const
{
const faPatchList& patches = *this;
wordList t(patches.size());
forAll (patches, patchI)
forAll(patches, patchI)
{
t[patchI] = patches[patchI].type();
}
@ -168,14 +154,13 @@ wordList faBoundaryMesh::types() const
}
// Return a list of patch names
wordList faBoundaryMesh::names() const
Foam::wordList Foam::faBoundaryMesh::names() const
{
const faPatchList& patches = *this;
wordList t(patches.size());
forAll (patches, patchI)
forAll(patches, patchI)
{
t[patchI] = patches[patchI].name();
}
@ -184,11 +169,11 @@ wordList faBoundaryMesh::names() const
}
label faBoundaryMesh::findPatchID(const word& patchName) const
Foam::label Foam::faBoundaryMesh::findPatchID(const word& patchName) const
{
const faPatchList& patches = *this;
forAll (patches, patchI)
forAll(patches, patchI)
{
if (patches[patchI].name() == patchName)
{
@ -236,8 +221,7 @@ Foam::labelList Foam::faBoundaryMesh::findIndices
}
// Return patch index for a given edge label
label faBoundaryMesh::whichPatch(const label edgeIndex) const
Foam::label Foam::faBoundaryMesh::whichPatch(const label edgeIndex) const
{
// Find out which patch the current face belongs to by comparing label
// with patch start labels.
@ -245,10 +229,8 @@ label faBoundaryMesh::whichPatch(const label edgeIndex) const
// if it is off the end of the list, abort
if (edgeIndex >= mesh().nEdges())
{
FatalErrorIn
(
"faBoundaryMesh::whichPatch(const label edgeIndex) const"
) << "given label greater than the number of edges"
FatalErrorInFunction
<< "given label greater than the number of edges"
<< abort(FatalError);
}
@ -257,7 +239,7 @@ label faBoundaryMesh::whichPatch(const label edgeIndex) const
return -1;
}
forAll (*this, patchI)
forAll(*this, patchI)
{
label start = mesh_.patchStarts()[patchI];
label size = operator[](patchI).faPatch::size();
@ -273,32 +255,28 @@ label faBoundaryMesh::whichPatch(const label edgeIndex) const
}
// If not in any of above, it's trouble!
FatalErrorIn
(
"label faBoundaryMesh::whichPatch(const label edgeIndex) const"
) << "error in patch search algorithm"
FatalErrorInFunction
<< "error in patch search algorithm"
<< abort(FatalError);
return -1;
}
bool faBoundaryMesh::checkDefinition(const bool report) const
bool Foam::faBoundaryMesh::checkDefinition(const bool report) const
{
label nextPatchStart = mesh().nInternalEdges();
const faBoundaryMesh& bm = *this;
bool boundaryError = false;
forAll (bm, patchI)
forAll(bm, patchI)
{
if (bm[patchI].start() != nextPatchStart)
{
boundaryError = true;
Info
<< "bool faBoundaryMesh::checkDefinition("
<< "const bool report) const : "
InfoInFunction
<< "Problem with boundary patch " << patchI
<< ".\nThe patch should start on face no " << nextPatchStart
<< " and the boundary file specifies " << bm[patchI].start()
@ -310,11 +288,8 @@ bool faBoundaryMesh::checkDefinition(const bool report) const
if (boundaryError)
{
SeriousErrorIn
(
"bool faBoundaryMesh::checkDefinition("
"const bool report) const"
) << "This mesh is not valid: boundary definition is in error."
SeriousErrorInFunction
<< "This mesh is not valid: boundary definition is in error."
<< endl;
}
else
@ -329,24 +304,23 @@ bool faBoundaryMesh::checkDefinition(const bool report) const
}
// Correct faBoundaryMesh after moving points
void faBoundaryMesh::movePoints(const pointField& p)
void Foam::faBoundaryMesh::movePoints(const pointField& p)
{
faPatchList& patches = *this;
forAll (patches, patchI)
forAll(patches, patchI)
{
patches[patchI].initMovePoints(p);
}
forAll (patches, patchI)
forAll(patches, patchI)
{
patches[patchI].movePoints(p);
}
}
void faBoundaryMesh::updateMesh()
void Foam::faBoundaryMesh::updateMesh()
{
faPatchList& patches = *this;
@ -362,8 +336,7 @@ void faBoundaryMesh::updateMesh()
}
// writeData member function required by regIOobject
bool faBoundaryMesh::writeData(Ostream& os) const
bool Foam::faBoundaryMesh::writeData(Ostream& os) const
{
const faPatchList& patches = *this;
@ -380,21 +353,17 @@ bool faBoundaryMesh::writeData(Ostream& os) const
os << decrIndent << token::END_LIST;
// Check state of IOstream
os.check("polyBoundaryMesh::writeData(Ostream& os) const");
os.check(FUNCTION_NAME);
return os.good();
}
Ostream& operator<<(Ostream& os, const faBoundaryMesh& bm)
Foam::Ostream& Foam::operator<<(Ostream& os, const faBoundaryMesh& bm)
{
bm.writeData(os);
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -24,7 +24,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
faBoundaryMesh
Foam::faBoundaryMesh
Description
Finite area boundary mesh
@ -142,6 +142,7 @@ public:
//- Check boundary definition
bool checkDefinition(const bool report = false) const;
// Edit
//- Correct faBoundaryMesh after moving points

View File

@ -63,11 +63,9 @@ const Foam::faMesh& Foam::faGlobalMeshData::mesh() const
}
// Update all data after morph
void Foam::faGlobalMeshData::updateMesh()
{
label polyMeshNGlobalPoints =
mesh_().globalData().nGlobalPoints();
label polyMeshNGlobalPoints = mesh_().globalData().nGlobalPoints();
const labelList& polyMeshSharedPointLabels =
mesh_().globalData().sharedPointLabels();
@ -81,10 +79,11 @@ void Foam::faGlobalMeshData::updateMesh()
forAll(mesh_.boundary(), patchI)
{
if(mesh_.boundary()[patchI].type() == processorFaPatch::typeName)
const faPatch& fap = mesh_.boundary()[patchI];
if (isA<processorFaPatch>(fap))
{
const labelList& localPointLabels =
mesh_.boundary()[patchI].pointLabels();
const labelList& localPointLabels = fap.pointLabels();
forAll(localPointLabels, pointI)
{
@ -111,12 +110,12 @@ void Foam::faGlobalMeshData::updateMesh()
sharedPointLabels_ = sharedPointLabels.toc();
combineReduce(globalList, plusEqOp<labelField >());
combineReduce(globalList, plusEqOp<labelField>());
nGlobalPoints_ = 0;
for (label i=0; i<globalList.size(); i++)
for (label i=0; i<globalList.size(); ++i)
{
if(globalList[i] > 0)
if (globalList[i] > 0)
{
globalList[i] = ++nGlobalPoints_;
}
@ -137,4 +136,5 @@ void Foam::faGlobalMeshData::updateMesh()
}
}
// ************************************************************************* //

View File

@ -24,7 +24,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
faGlobalMeshData
Foam::faGlobalMeshData
Description
Various mesh related information for a parallel run
@ -87,16 +87,11 @@ public:
//- Runtime type information
ClassName("faGlobalMeshData");
//- Construct from mesh
faGlobalMeshData(const faMesh& mesh);
// Constructors
//- Construct from mesh
faGlobalMeshData(const faMesh& mesh);
// Destructor
~faGlobalMeshData();
//- Destructor
~faGlobalMeshData();
// Member Functions

View File

@ -23,8 +23,8 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
faProcessorTopology
Typedef
Foam::faProcessorTopology
Description

View File

@ -23,8 +23,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "faMesh.H"
@ -57,11 +55,8 @@ const int Foam::faMesh::quadricsFit_ = 0;
void Foam::faMesh::setPrimitiveMeshData()
{
if (debug)
{
Info<< "void faMesh::setPrimitiveMeshData() const : "
<< "Setting primitive data" << endl;
}
DebugInFunction
<< "Setting primitive data" << endl;
const indirectPrimitivePatch& bp = patch();
@ -70,19 +65,18 @@ void Foam::faMesh::setPrimitiveMeshData()
label edgeI = -1;
label nIntEdges = bp.nInternalEdges();
for (label curEdge = 0; curEdge < nIntEdges; curEdge++)
for (label curEdge = 0; curEdge < nIntEdges; ++curEdge)
{
edges_[++edgeI] = bp.edges()[curEdge];
}
forAll (boundary(), patchI)
forAll(boundary(), patchI)
{
const labelList& curP = boundary()[patchI];
forAll (curP, eI)
forAll(curP, eI)
{
edges_[++edgeI] = bp.edges()[curP[eI]];
}
@ -100,18 +94,18 @@ void Foam::faMesh::setPrimitiveMeshData()
const labelListList& bpef = bp.edgeFaces();
for (label curEdge = 0; curEdge < nIntEdges; curEdge++)
for (label curEdge = 0; curEdge < nIntEdges; ++curEdge)
{
edgeOwner_[++edgeI] = bpef[curEdge][0];
edgeNeighbour_[edgeI] = bpef[curEdge][1];
}
forAll (boundary(), patchI)
forAll(boundary(), patchI)
{
const labelList& curP = boundary()[patchI];
forAll (curP, eI)
forAll(curP, eI)
{
edgeOwner_[++edgeI] = bpef[curP[eI]][0];
}
@ -216,24 +210,24 @@ Foam::faMesh::faMesh(const polyMesh& pMesh)
*this
),
comm_(Pstream::worldComm),
patchPtr_(NULL),
lduPtr_(NULL),
patchPtr_(nullptr),
lduPtr_(nullptr),
curTimeIndex_(time().timeIndex()),
SPtr_(NULL),
S0Ptr_(NULL),
S00Ptr_(NULL),
patchStartsPtr_(NULL),
LePtr_(NULL),
magLePtr_(NULL),
centresPtr_(NULL),
edgeCentresPtr_(NULL),
faceAreaNormalsPtr_(NULL),
edgeAreaNormalsPtr_(NULL),
pointAreaNormalsPtr_(NULL),
faceCurvaturesPtr_(NULL),
edgeTransformTensorsPtr_(NULL),
correctPatchPointNormalsPtr_(NULL),
globalMeshDataPtr_(NULL)
SPtr_(nullptr),
S0Ptr_(nullptr),
S00Ptr_(nullptr),
patchStartsPtr_(nullptr),
LePtr_(nullptr),
magLePtr_(nullptr),
centresPtr_(nullptr),
edgeCentresPtr_(nullptr),
faceAreaNormalsPtr_(nullptr),
edgeAreaNormalsPtr_(nullptr),
pointAreaNormalsPtr_(nullptr),
faceCurvaturesPtr_(nullptr),
edgeTransformTensorsPtr_(nullptr),
correctPatchPointNormalsPtr_(nullptr),
globalMeshDataPtr_(nullptr)
{
if (debug)
{
@ -274,7 +268,6 @@ Foam::faMesh::faMesh(const polyMesh& pMesh)
}
// Construct from components without boundary.
Foam::faMesh::faMesh
(
const polyMesh& pMesh,
@ -312,24 +305,24 @@ Foam::faMesh::faMesh
0
),
comm_(Pstream::worldComm),
patchPtr_(NULL),
lduPtr_(NULL),
patchPtr_(nullptr),
lduPtr_(nullptr),
curTimeIndex_(time().timeIndex()),
SPtr_(NULL),
S0Ptr_(NULL),
S00Ptr_(NULL),
patchStartsPtr_(NULL),
LePtr_(NULL),
magLePtr_(NULL),
centresPtr_(NULL),
edgeCentresPtr_(NULL),
faceAreaNormalsPtr_(NULL),
edgeAreaNormalsPtr_(NULL),
pointAreaNormalsPtr_(NULL),
faceCurvaturesPtr_(NULL),
edgeTransformTensorsPtr_(NULL),
correctPatchPointNormalsPtr_(NULL),
globalMeshDataPtr_(NULL)
SPtr_(nullptr),
S0Ptr_(nullptr),
S00Ptr_(nullptr),
patchStartsPtr_(nullptr),
LePtr_(nullptr),
magLePtr_(nullptr),
centresPtr_(nullptr),
edgeCentresPtr_(nullptr),
faceAreaNormalsPtr_(nullptr),
edgeAreaNormalsPtr_(nullptr),
pointAreaNormalsPtr_(nullptr),
faceCurvaturesPtr_(nullptr),
edgeTransformTensorsPtr_(nullptr),
correctPatchPointNormalsPtr_(nullptr),
globalMeshDataPtr_(nullptr)
{
if (debug)
{
@ -339,7 +332,6 @@ Foam::faMesh::faMesh
}
// Construct from definition field
Foam::faMesh::faMesh
(
const polyMesh& pMesh,
@ -377,30 +369,27 @@ Foam::faMesh::faMesh
0
),
comm_(Pstream::worldComm),
patchPtr_(NULL),
lduPtr_(NULL),
patchPtr_(nullptr),
lduPtr_(nullptr),
curTimeIndex_(time().timeIndex()),
SPtr_(NULL),
S0Ptr_(NULL),
S00Ptr_(NULL),
patchStartsPtr_(NULL),
LePtr_(NULL),
magLePtr_(NULL),
centresPtr_(NULL),
edgeCentresPtr_(NULL),
faceAreaNormalsPtr_(NULL),
edgeAreaNormalsPtr_(NULL),
pointAreaNormalsPtr_(NULL),
faceCurvaturesPtr_(NULL),
edgeTransformTensorsPtr_(NULL),
correctPatchPointNormalsPtr_(NULL),
globalMeshDataPtr_(NULL)
SPtr_(nullptr),
S0Ptr_(nullptr),
S00Ptr_(nullptr),
patchStartsPtr_(nullptr),
LePtr_(nullptr),
magLePtr_(nullptr),
centresPtr_(nullptr),
edgeCentresPtr_(nullptr),
faceAreaNormalsPtr_(nullptr),
edgeAreaNormalsPtr_(nullptr),
pointAreaNormalsPtr_(nullptr),
faceCurvaturesPtr_(nullptr),
edgeTransformTensorsPtr_(nullptr),
correctPatchPointNormalsPtr_(nullptr),
globalMeshDataPtr_(nullptr)
{
if (debug)
{
Info<< "faMesh::faMesh(...) : "
<< "Creating faMesh from definition file" << endl;
}
DebugInFunction
<< "Creating faMesh from definition file" << endl;
// Reading faMeshDefinition dictionary
IOdictionary faMeshDefinition
@ -416,38 +405,29 @@ Foam::faMesh::faMesh
)
);
wordList polyMeshPatches
(
faMeshDefinition.lookup("polyMeshPatches")
);
const wordList polyMeshPatches(faMeshDefinition.lookup("polyMeshPatches"));
dictionary bndDict = faMeshDefinition.subDict("boundary");
const dictionary& bndDict = faMeshDefinition.subDict("boundary");
wordList faPatchNames = bndDict.toc();
const wordList faPatchNames(bndDict.toc());
List<faPatchData> faPatches(faPatchNames.size() + 1);
forAll (faPatchNames, patchI)
const polyBoundaryMesh& pbm = pMesh.boundaryMesh();
forAll(faPatchNames, patchI)
{
dictionary curPatchDict =
bndDict.subDict(faPatchNames[patchI]);
dictionary curPatchDict = bndDict.subDict(faPatchNames[patchI]);
faPatches[patchI].name_ = faPatchNames[patchI];
faPatches[patchI].type_ =
word(curPatchDict.lookup("type"));
faPatches[patchI].type_ = word(curPatchDict.lookup("type"));
faPatches[patchI].ownPolyPatchID_ =
mesh().boundaryMesh().findPatchID
(
word(curPatchDict.lookup("ownerPolyPatch"))
);
pbm.findPatchID(word(curPatchDict.lookup("ownerPolyPatch")));
faPatches[patchI].ngbPolyPatchID_ =
mesh().boundaryMesh().findPatchID
(
word(curPatchDict.lookup("neighbourPolyPatch"))
);
faPatches[patchI].ngbPolyPatchID_ =
pbm.findPatchID(word(curPatchDict.lookup("neighbourPolyPatch")));
}
@ -456,12 +436,11 @@ Foam::faMesh::faMesh
labelList patchIDs(polyMeshPatches.size(), -1);
forAll (polyMeshPatches, patchI)
forAll(polyMeshPatches, patchI)
{
patchIDs[patchI] =
mesh().boundaryMesh().findPatchID(polyMeshPatches[patchI]);
patchIDs[patchI] = pbm.findPatchID(polyMeshPatches[patchI]);
size += mesh().boundaryMesh()[patchIDs[patchI]].size();
size += pbm[patchIDs[patchI]].size();
}
faceLabels_ = labelList(size, -1);
@ -472,12 +451,12 @@ Foam::faMesh::faMesh
sort(patchIDs);
forAll (polyMeshPatches, patchI)
forAll(polyMeshPatches, patchI)
{
label start = mesh().boundaryMesh()[patchIDs[patchI]].start();
label size = mesh().boundaryMesh()[patchIDs[patchI]].size();
label start = pbm[patchIDs[patchI]].start();
label size = pbm[patchIDs[patchI]].size();
for (label i = 0; i < size; i++)
for (label i = 0; i < size; ++i)
{
faceLabels_[++faceI] = start + i;
}
@ -488,7 +467,7 @@ Foam::faMesh::faMesh
// Result is in the bndEdgeFaPatchIDs list
labelList faceCells(faceLabels_.size(), -1);
forAll (faceCells, faceI)
forAll(faceCells, faceI)
{
label faceID = faceLabels_[faceI];
@ -510,7 +489,7 @@ Foam::faMesh::faMesh
labelList bndEdgeFaPatchIDs(nTotalEdges - nInternalEdges, -1);
for (label edgeI = nInternalEdges; edgeI < nTotalEdges; edgeI++)
for (label edgeI = nInternalEdges; edgeI < nTotalEdges; ++edgeI)
{
label curMeshEdge = meshEdges[edgeI];
@ -518,11 +497,11 @@ Foam::faMesh::faMesh
label patchI = -1;
forAll (edgeFaces[curMeshEdge], faceI)
forAll(edgeFaces[curMeshEdge], faceI)
{
label curFace = edgeFaces[curMeshEdge][faceI];
label curPatchID = mesh().boundaryMesh().whichPatch(curFace);
label curPatchID = pbm.whichPatch(curFace);
if (curPatchID != -1)
{
@ -530,7 +509,7 @@ Foam::faMesh::faMesh
}
}
for (label pI = 0; pI < faPatches.size() - 1; pI++)
for (label pI = 0; pI < faPatches.size() - 1; ++pI)
{
if
(
@ -553,11 +532,11 @@ Foam::faMesh::faMesh
// Set edgeLabels for each faPatch
for (label pI = 0; pI < (faPatches.size() - 1); pI++)
for (label pI = 0; pI < (faPatches.size() - 1); ++pI)
{
SLList<label> tmpList;
forAll (bndEdgeFaPatchIDs, eI)
forAll(bndEdgeFaPatchIDs, eI)
{
if (bndEdgeFaPatchIDs[eI] == pI)
{
@ -571,7 +550,7 @@ Foam::faMesh::faMesh
// Check for undefined edges
SLList<label> tmpList;
forAll (bndEdgeFaPatchIDs, eI)
forAll(bndEdgeFaPatchIDs, eI)
{
if (bndEdgeFaPatchIDs[eI] == -1)
{
@ -582,22 +561,21 @@ Foam::faMesh::faMesh
if (tmpList.size() > 0)
{
// Check for processor edges
labelList allUndefEdges = labelList(tmpList);
labelList allUndefEdges(tmpList);
labelList ngbPolyPatch(allUndefEdges.size(), -1);
forAll (ngbPolyPatch, edgeI)
forAll(ngbPolyPatch, edgeI)
{
label curEdge = allUndefEdges[edgeI];
label curPMeshEdge = meshEdges[curEdge];
forAll (edgeFaces[curPMeshEdge], faceI)
forAll(edgeFaces[curPMeshEdge], faceI)
{
label curFace = edgeFaces[curPMeshEdge][faceI];
if (findIndex(faceLabels_, curFace) == -1)
{
label polyPatchID =
pMesh.boundaryMesh().whichPatch(curFace);
label polyPatchID = pbm.whichPatch(curFace);
if (polyPatchID != -1)
{
@ -609,33 +587,24 @@ Foam::faMesh::faMesh
// Count ngb processorPolyPatch-es
labelHashSet processorPatchSet;
forAll (ngbPolyPatch, edgeI)
forAll(ngbPolyPatch, edgeI)
{
if (ngbPolyPatch[edgeI] != -1)
{
if
(
isA<processorPolyPatch>
(
pMesh.boundaryMesh()[ngbPolyPatch[edgeI]]
)
)
if (isA<processorPolyPatch>(pbm[ngbPolyPatch[edgeI]]))
{
if (!processorPatchSet.found(ngbPolyPatch[edgeI]))
{
processorPatchSet.insert(ngbPolyPatch[edgeI]);
}
processorPatchSet.insert(ngbPolyPatch[edgeI]);
}
}
}
labelList processorPatches(processorPatchSet.toc());
faPatches.setSize(faPatches.size() + processorPatches.size());
for (label i = 0; i < processorPatches.size(); i++)
for (label i = 0; i < processorPatches.size(); ++i)
{
SLList<label> tmpLst;
forAll (ngbPolyPatch, eI)
forAll(ngbPolyPatch, eI)
{
if (ngbPolyPatch[eI] == processorPatches[i])
{
@ -646,7 +615,7 @@ Foam::faMesh::faMesh
faPatches[faPatchNames.size() + i].edgeLabels_ = tmpLst;
faPatches[faPatchNames.size() + i].name_ =
pMesh.boundaryMesh()[processorPatches[i]].name();
pbm[processorPatches[i]].name();
faPatches[faPatchNames.size() + i].type_ =
processorFaPatch::typeName;
@ -657,19 +626,13 @@ Foam::faMesh::faMesh
// Remaining undefined edges
SLList<label> undefEdges;
forAll (ngbPolyPatch, eI)
forAll(ngbPolyPatch, eI)
{
if (ngbPolyPatch[eI] == -1)
{
undefEdges.append(allUndefEdges[eI]);
}
else if
(
!isA<processorPolyPatch>
(
pMesh.boundaryMesh()[ngbPolyPatch[eI]]
)
)
else if (!isA<processorPolyPatch>(pbm[ngbPolyPatch[eI]]))
{
undefEdges.append(allUndefEdges[eI]);
}
@ -696,24 +659,23 @@ Foam::faMesh::faMesh
// Reorder processorFaPatch using
// ordering of ngb processorPolyPatch
forAll (faPatches, patchI)
forAll(faPatches, patchI)
{
if (faPatches[patchI].type_ == processorFaPatch::typeName)
{
labelList ngbFaces(faPatches[patchI].edgeLabels_.size(), -1);
forAll (ngbFaces, edgeI)
forAll(ngbFaces, edgeI)
{
label curEdge = faPatches[patchI].edgeLabels_[edgeI];
label curPMeshEdge = meshEdges[curEdge];
forAll (edgeFaces[curPMeshEdge], faceI)
forAll(edgeFaces[curPMeshEdge], faceI)
{
label curFace = edgeFaces[curPMeshEdge][faceI];
label curPatchID =
pMesh.boundaryMesh().whichPatch(curFace);
label curPatchID = pbm.whichPatch(curFace);
if (curPatchID == faPatches[patchI].ngbPolyPatchID_)
{
@ -724,7 +686,7 @@ Foam::faMesh::faMesh
SortableList<label> sortedNgbFaces(ngbFaces);
labelList reorderedEdgeLabels(ngbFaces.size(), -1);
for (label i = 0; i < reorderedEdgeLabels.size(); i++)
for (label i = 0; i < reorderedEdgeLabels.size(); ++i)
{
reorderedEdgeLabels[i] =
faPatches[patchI].edgeLabels_
@ -741,7 +703,7 @@ Foam::faMesh::faMesh
// Add good patches to faMesh
SLList<faPatch*> faPatchLst;
for (label pI = 0; pI < faPatches.size(); pI++)
for (label pI = 0; pI < faPatches.size(); ++pI)
{
faPatches[pI].dict_.add("type", faPatches[pI].type_);
faPatches[pI].dict_.add("edgeLabels", faPatches[pI].edgeLabels_);
@ -755,19 +717,16 @@ Foam::faMesh::faMesh
{
if (faPatches[pI].ngbPolyPatchID_ == -1)
{
FatalErrorIn
(
"void faMesh::faMesh(const polyMesh&, const fileName&)"
)
FatalErrorInFunction
<< "ngbPolyPatch is not defined for processorFaPatch: "
<< faPatches[pI].name_
<< abort(FatalError);
<< faPatches[pI].name_
<< abort(FatalError);
}
const processorPolyPatch& procPolyPatch =
refCast<const processorPolyPatch>
(
pMesh.boundaryMesh()[faPatches[pI].ngbPolyPatchID_]
pbm[faPatches[pI].ngbPolyPatchID_]
);
faPatches[pI].dict_.add("myProcNo", procPolyPatch.myProcNo());
@ -823,7 +782,6 @@ Foam::faMesh::faMesh
}
// Construct from polyPatch
Foam::faMesh::faMesh
(
const polyMesh& pMesh,
@ -861,36 +819,34 @@ Foam::faMesh::faMesh
0
),
comm_(Pstream::worldComm),
patchPtr_(NULL),
lduPtr_(NULL),
patchPtr_(nullptr),
lduPtr_(nullptr),
curTimeIndex_(time().timeIndex()),
SPtr_(NULL),
S0Ptr_(NULL),
S00Ptr_(NULL),
patchStartsPtr_(NULL),
LePtr_(NULL),
magLePtr_(NULL),
centresPtr_(NULL),
edgeCentresPtr_(NULL),
faceAreaNormalsPtr_(NULL),
edgeAreaNormalsPtr_(NULL),
pointAreaNormalsPtr_(NULL),
faceCurvaturesPtr_(NULL),
edgeTransformTensorsPtr_(NULL),
correctPatchPointNormalsPtr_(NULL),
globalMeshDataPtr_(NULL)
SPtr_(nullptr),
S0Ptr_(nullptr),
S00Ptr_(nullptr),
patchStartsPtr_(nullptr),
LePtr_(nullptr),
magLePtr_(nullptr),
centresPtr_(nullptr),
edgeCentresPtr_(nullptr),
faceAreaNormalsPtr_(nullptr),
edgeAreaNormalsPtr_(nullptr),
pointAreaNormalsPtr_(nullptr),
faceCurvaturesPtr_(nullptr),
edgeTransformTensorsPtr_(nullptr),
correctPatchPointNormalsPtr_(nullptr),
globalMeshDataPtr_(nullptr)
{
if (debug)
{
Info<< "faMesh::faMesh(...) : "
<< "Creating faMesh from polyPatch" << endl;
}
DebugInFunction
<< "Creating faMesh from polyPatch" << endl;
const polyBoundaryMesh& pbm = pMesh.boundaryMesh();
// Set faceLabels
forAll (faceLabels_, faceI)
forAll(faceLabels_, faceI)
{
faceLabels_[faceI] =
mesh().boundaryMesh()[polyPatchID].start() + faceI;
faceLabels_[faceI] = pbm[polyPatchID].start() + faceI;
}
// Add one faPatch
@ -902,7 +858,7 @@ Foam::faMesh::faMesh
labelList edgeLabels(nTotalEdges - nInternalEdges, -1);
forAll (edgeLabels, edgeI)
forAll(edgeLabels, edgeI)
{
edgeLabels[edgeI] = nInternalEdges + edgeI;
}
@ -915,8 +871,7 @@ Foam::faMesh::faMesh
List<faPatch*> faPatchLst(1);
faPatchLst[0] =
faPatch::New("default", patchDict, 0, boundary()).ptr();
faPatchLst[0] = faPatch::New("default", patchDict, 0, boundary()).ptr();
addFaPatches(faPatchLst);
@ -937,6 +892,7 @@ Foam::faMesh::~faMesh()
clearOut();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::fileName Foam::faMesh::meshDir() const
@ -1021,22 +977,19 @@ const Foam::faceList& Foam::faMesh::faces() const
void Foam::faMesh::addFaPatches(const List<faPatch*>& p)
{
if (debug)
{
Info<< "void faMesh::addFaPatches(const List<faPatch*>& p) : "
<< "Adding patches to faMesh" << endl;
}
DebugInFunction
<< "Adding patches to faMesh" << endl;
if (boundary().size() > 0)
{
FatalErrorIn("void faMesh::addPatches(const List<faPatch*>& p)")
FatalErrorInFunction
<< "boundary already exists"
<< abort(FatalError);
}
boundary_.setSize(p.size());
forAll (p, patchI)
forAll(p, patchI)
{
boundary_.set(patchI, p[patchI]);
}
@ -1143,7 +1096,7 @@ Foam::faMesh::S0() const
{
if (!S0Ptr_)
{
FatalErrorIn("faMesh::S0() const")
FatalErrorInFunction
<< "S0 is not available"
<< abort(FatalError);
}
@ -1238,7 +1191,6 @@ Foam::faMesh::edgeTransformTensors() const
}
// Return global mesh data
const Foam::faGlobalMeshData& Foam::faMesh::globalData() const
{
if (!globalMeshDataPtr_)
@ -1271,22 +1223,18 @@ bool Foam::faMesh::movePoints()
{
if (S00Ptr_ && S0Ptr_)
{
Info<< "Copy old-old S" << endl;
DebugInfo<< "Copy old-old S" << endl;
*S00Ptr_ = *S0Ptr_;
}
if (S0Ptr_)
{
Info<< "Copy old S" << endl;
DebugInfo<< "Copy old S" << endl;
*S0Ptr_ = S();
}
else
{
if (debug)
{
InfoIn("bool faMesh::movePoints()")
<< "Creating old cell volumes." << endl;
}
DebugInfo<< "Creating old cell volumes." << endl;
S0Ptr_ = new DimensionedField<scalar, areaMesh>
(
@ -1309,7 +1257,6 @@ bool Foam::faMesh::movePoints()
clearGeomNotAreas();
// To satisfy the motion interface for MeshObject, const cast is needed
// HJ, 5/Aug/2011
if (patchPtr_)
{
patchPtr_->movePoints(newPoints);
@ -1322,7 +1269,7 @@ bool Foam::faMesh::movePoints()
const edgeInterpolation& cei = *this;
const_cast<edgeInterpolation&>(cei).edgeInterpolation::movePoints();
// Fluxes were dummy? HJ, 28/Jul/2011
// Note: Fluxes were dummy?
return true;
}
@ -1332,10 +1279,8 @@ bool Foam::faMesh::correctPatchPointNormals(const label patchID) const
{
if ((patchID < 0) || (patchID >= boundary().size()))
{
FatalErrorIn
(
"bool correctPatchPointNormals(const label patchID) const"
) << "patchID is not in the valid range"
FatalErrorInFunction
<< "patchID is not in the valid range"
<< abort(FatalError);
}
@ -1348,13 +1293,11 @@ bool Foam::faMesh::correctPatchPointNormals(const label patchID) const
}
//- Set patch point normals corrections
Foam::boolList& Foam::faMesh::correctPatchPointNormals() const
{
if (!correctPatchPointNormalsPtr_)
{
correctPatchPointNormalsPtr_ =
new boolList(boundary().size(), false);
correctPatchPointNormalsPtr_ = new boolList(boundary().size(), false);
}
return *correctPatchPointNormalsPtr_;

View File

@ -24,7 +24,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
faMesh
Foam::faMesh
Description
Finite area mesh. Used for 2-D non-Euclidian finite area method.
@ -56,7 +56,6 @@ Author
#include "indirectPrimitivePatch.H"
#include "edgeInterpolation.H"
#include "labelIOList.H"
#include "scalarIOField.H"
#include "FieldFields.H"
#include "faGlobalMeshData.H"
@ -70,7 +69,7 @@ class faMeshLduAddressing;
class faMeshMapper;
/*---------------------------------------------------------------------------*\
Class faMesh Declaration
Class faMesh Declaration
\*---------------------------------------------------------------------------*/
class faMesh
@ -178,6 +177,7 @@ class faMesh
//- Whether point normals must be corrected for a patch
mutable boolList* correctPatchPointNormalsPtr_;
// Other mesh-related data
//- Parallel info
@ -202,6 +202,7 @@ class faMesh
//- Set primitive mesh data
void setPrimitiveMeshData();
// Private member functions to calculate demand driven data
//- Calculate ldu addressing
@ -340,7 +341,7 @@ public:
const fileName& facesInstance() const;
//- Mesh size parameters
// Mesh size parameters
inline label nPoints() const
{
@ -362,6 +363,7 @@ public:
return nFaces_;
}
// Primitive mesh data
//- Return mesh points
@ -547,7 +549,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "faPatchFaMeshTemplates.C"
#include "faPatchFaMeshTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
faMeshLduAddressing
Foam::faMeshLduAddressing
Description
lduAddressing wrapper for faMesh
@ -50,7 +50,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class faMeshLduAddressing Declaration
Class faMeshLduAddressing Declaration
\*---------------------------------------------------------------------------*/
class faMeshLduAddressing
@ -101,16 +101,15 @@ public:
patchAddr_(mesh.boundary().size()),
patchSchedule_(mesh.globalData().patchSchedule())
{
forAll (mesh.boundary(), patchI)
forAll(mesh.boundary(), patchI)
{
patchAddr_[patchI] = &mesh.boundary()[patchI].edgeFaces();
}
}
// Destructor
virtual ~faMeshLduAddressing()
{}
//-Destructor
virtual ~faMeshLduAddressing()
{}
// Member Functions

View File

@ -45,7 +45,7 @@ void Foam::faAreaMapper::calcAddressing() const
|| insertedObjectLabelsPtr_
)
{
FatalErrorIn("void faAreaMapper::calcAddressing() const)")
FatalErrorInFunction
<< "Addressing already calculated"
<< abort(FatalError);
}
@ -63,7 +63,6 @@ void Foam::faAreaMapper::calcAddressing() const
// Prepare a list of new face labels and (preliminary) addressing
// Note: dimensioned to number of boundary faces of polyMesh
// HJ, 10/Aug/2011
newFaceLabelsPtr_ = new labelList
(
mesh_().nFaces() - mesh_().nInternalFaces(),
@ -86,7 +85,7 @@ void Foam::faAreaMapper::calcAddressing() const
const labelList& reverseFaceMap = mpm_.reverseFaceMap();
// Pick up live old faces
forAll (oldFaces, faceI)
forAll(oldFaces, faceI)
{
if (reverseFaceMap[oldFaces[faceI]] > -1)
{
@ -109,7 +108,7 @@ void Foam::faAreaMapper::calcAddressing() const
labelList& addr = *directAddrPtr_;
// Adjust for creation of a boundary face from an internal face
forAll (addr, faceI)
forAll(addr, faceI)
{
if (newFaceLabelsMap[faceI] < oldNInternal)
{
@ -132,7 +131,7 @@ void Foam::faAreaMapper::calcAddressing() const
scalarListList& w = *weightsPtr_;
// Insert single addressing and weights
for (label addrI = 0; addrI < nNewFaces; addrI++)
for (label addrI = 0; addrI < nNewFaces; ++addrI)
{
addr[addrI] = labelList(1, newFaceLabelsMap[addrI]);
w[addrI] = scalarList(1, scalar(1));
@ -150,7 +149,7 @@ void Foam::faAreaMapper::calcAddressing() const
const List<objectMap>& ffp = mpm_.facesFromPointsMap();
forAll (ffp, ffpI)
forAll(ffp, ffpI)
{
// Get addressing
const labelList& mo = ffp[ffpI].masterObjects();
@ -159,7 +158,7 @@ void Foam::faAreaMapper::calcAddressing() const
labelList validMo(mo.size());
label nValidMo = 0;
forAll (mo, moI)
forAll(mo, moI)
{
if (oldFaceLookup.found(mo[moI]))
{
@ -186,7 +185,7 @@ void Foam::faAreaMapper::calcAddressing() const
const List<objectMap>& ffe = mpm_.facesFromEdgesMap();
forAll (ffe, ffeI)
forAll(ffe, ffeI)
{
// Get addressing
const labelList& mo = ffe[ffeI].masterObjects();
@ -195,7 +194,7 @@ void Foam::faAreaMapper::calcAddressing() const
labelList validMo(mo.size());
label nValidMo = 0;
forAll (mo, moI)
forAll(mo, moI)
{
if (oldFaceLookup.found(mo[moI]))
{
@ -222,7 +221,7 @@ void Foam::faAreaMapper::calcAddressing() const
const List<objectMap>& fff = mpm_.facesFromFacesMap();
forAll (fff, fffI)
forAll(fff, fffI)
{
// Get addressing
const labelList& mo = fff[fffI].masterObjects();
@ -231,7 +230,7 @@ void Foam::faAreaMapper::calcAddressing() const
labelList validMo(mo.size());
label nValidMo = 0;
forAll (mo, moI)
forAll(mo, moI)
{
if (oldFaceLookup.found(mo[moI]))
{
@ -287,7 +286,6 @@ void Foam::faAreaMapper::clearOut()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::faAreaMapper::faAreaMapper
(
const faMesh& mesh,
@ -300,12 +298,12 @@ Foam::faAreaMapper::faAreaMapper
direct_(false),
hasUnmapped_(false),
sizeBeforeMapping_(mesh.nFaces()),
newFaceLabelsPtr_(NULL),
newFaceLabelsMapPtr_(NULL),
directAddrPtr_(NULL),
interpolationAddrPtr_(NULL),
weightsPtr_(NULL),
insertedObjectLabelsPtr_(NULL)
newFaceLabelsPtr_(nullptr),
newFaceLabelsMapPtr_(nullptr),
directAddrPtr_(nullptr),
interpolationAddrPtr_(nullptr),
weightsPtr_(nullptr),
insertedObjectLabelsPtr_(nullptr)
{
// Check for possibility of direct mapping
if
@ -323,7 +321,6 @@ Foam::faAreaMapper::faAreaMapper
}
// Inserted objects not suported: no master
// HJ, 10/Aug/2011
}
@ -363,11 +360,8 @@ const Foam::labelUList& Foam::faAreaMapper::directAddressing() const
{
if (!direct())
{
FatalErrorIn
(
"const labelUList& faAreaMapper::"
"directAddressing() const"
) << "Requested direct addressing for an interpolative mapper."
FatalErrorInFunction
<< "Requested direct addressing for an interpolative mapper."
<< abort(FatalError);
}
@ -384,10 +378,8 @@ const Foam::labelListList& Foam::faAreaMapper::addressing() const
{
if (direct())
{
FatalErrorIn
(
"const labelListList& faAreaMapper::addressing() const"
) << "Requested interpolative addressing for a direct mapper."
FatalErrorInFunction
<< "Requested interpolative addressing for a direct mapper."
<< abort(FatalError);
}
@ -404,10 +396,8 @@ const Foam::scalarListList& Foam::faAreaMapper::weights() const
{
if (direct())
{
FatalErrorIn
(
"const scalarListList& faAreaMapper::weights() const"
) << "Requested interpolative weights for a direct mapper."
FatalErrorInFunction
<< "Requested interpolative weights for a direct mapper."
<< abort(FatalError);
}

View File

@ -102,7 +102,6 @@ class faAreaMapper
mutable labelList* insertedObjectLabelsPtr_;
// Private Member Functions
//- Disallow default bitwise copy construct
@ -111,7 +110,6 @@ class faAreaMapper
//- Disallow default bitwise assignment
void operator=(const faAreaMapper&);
//- Calculate addressing
void calcAddressing() const;
@ -121,19 +119,16 @@ class faAreaMapper
public:
// Constructors
//- Construct from components
faAreaMapper
(
const faMesh& mesh,
const mapPolyMesh& mpm
);
//- Construct from components
faAreaMapper
(
const faMesh& mesh,
const mapPolyMesh& mpm
);
// Destructor
virtual ~faAreaMapper();
//- Destructor
virtual ~faAreaMapper();
// Member Functions

View File

@ -74,7 +74,7 @@ public:
{
const faBoundaryMesh& patches = mesh.boundary();
forAll (patches, patchI)
forAll(patches, patchI)
{
set
(

View File

@ -24,7 +24,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
FV edge mapper.
FA edge mapper.
\*---------------------------------------------------------------------------*/
@ -37,7 +37,7 @@ void Foam::faEdgeMapper::calcAddressing() const
{
if (directAddrPtr_)
{
FatalErrorIn("void faEdgeMapper::calcAddressing() const)")
FatalErrorInFunction
<< "Addressing already calculated"
<< abort(FatalError);
}
@ -58,7 +58,6 @@ void Foam::faEdgeMapper::clearOut()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::faEdgeMapper::faEdgeMapper
(
const faMesh& mesh,
@ -69,7 +68,7 @@ Foam::faEdgeMapper::faEdgeMapper
mpm_(mpm),
sizeBeforeMapping_(mesh.nInternalEdges()),
hasUnmapped_(false),
directAddrPtr_(NULL)
directAddrPtr_(nullptr)
{}
@ -96,10 +95,8 @@ const Foam::labelUList& Foam::faEdgeMapper::directAddressing() const
const Foam::labelListList& Foam::faEdgeMapper::addressing() const
{
FatalErrorIn
(
"const labelListList& faEdgeMapper::addressing() const"
) << "Requested interpolative addressing for a direct mapper."
FatalErrorInFunction
<< "Requested interpolative addressing for a direct mapper."
<< abort(FatalError);
return labelListList::null();
@ -108,10 +105,8 @@ const Foam::labelListList& Foam::faEdgeMapper::addressing() const
const Foam::scalarListList& Foam::faEdgeMapper::weights() const
{
FatalErrorIn
(
"const scalarListList& faEdgeMapper::weights() const"
) << "Requested interpolative weights for a direct mapper."
FatalErrorInFunction
<< "Requested interpolative weights for a direct mapper."
<< abort(FatalError);
return scalarListList::null();

View File

@ -89,7 +89,6 @@ class faEdgeMapper
//- Disallow default bitwise assignment
void operator=(const faEdgeMapper&);
//- Calculate addressing
void calcAddressing() const;
@ -99,19 +98,16 @@ class faEdgeMapper
public:
// Constructors
//- Construct from components
faEdgeMapper
(
const faMesh& mesh,
const mapPolyMesh& mpm
);
//- Construct from components
faEdgeMapper
(
const faMesh& mesh,
const mapPolyMesh& mpm
);
// Destructor
virtual ~faEdgeMapper();
//- Destructor
virtual ~faEdgeMapper();
// Member Functions

View File

@ -27,9 +27,6 @@ License
#include "faMeshMapper.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::faMeshMapper::faMeshMapper
@ -53,7 +50,7 @@ Foam::faMeshMapper::faMeshMapper
// Capture old patch information
const faBoundaryMesh& patches = mesh.boundary();
forAll (patches, patchI)
forAll(patches, patchI)
{
oldPatchSizes_[patchI] = patches[patchI].size();
oldPatchStarts_[patchI] = patches[patchI].start();

View File

@ -38,10 +38,8 @@ void Foam::faPatchMapper::calcAddressing() const
{
if (directAddrPtr_)
{
FatalErrorIn
(
"void faPatchMapper::calcAddressing() const)"
) << "Addressing already calculated"
FatalErrorInFunction
<< "Addressing already calculated"
<< abort(FatalError);
}
@ -59,7 +57,7 @@ void Foam::faPatchMapper::calcAddressing() const
const labelList& reverseFaceMap = mpm_.reverseFaceMap();
forAll (oldEdgeFaces_, oefI)
forAll(oldEdgeFaces_, oefI)
{
if (reverseFaceMap[oldEdgeFaces_[oefI]] > -1)
{
@ -71,7 +69,7 @@ void Foam::faPatchMapper::calcAddressing() const
// Go through new edgeFaces and for each edge try to locate old index
const labelList& ef = patch_.edgeFaces();
forAll (ef, efI)
forAll(ef, efI)
{
if (edgeIndexLookup.found(ef[efI]))
{
@ -98,7 +96,6 @@ void Foam::faPatchMapper::clearOut()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::faPatchMapper::faPatchMapper
(
const faPatch& patch,
@ -110,7 +107,7 @@ Foam::faPatchMapper::faPatchMapper
sizeBeforeMapping_(patch.size()),
oldEdgeFaces_(patch.edgeFaces()),
hasUnmapped_(false),
directAddrPtr_(NULL)
directAddrPtr_(nullptr)
{}
@ -137,10 +134,8 @@ const Foam::labelUList& Foam::faPatchMapper::directAddressing() const
const Foam::labelListList& Foam::faPatchMapper::addressing() const
{
FatalErrorIn
(
"const labelListList& faPatchMapper::addressing() const"
) << "Requested interpolative addressing for a direct mapper."
FatalErrorInFunction
<< "Requested interpolative addressing for a direct mapper."
<< abort(FatalError);
return labelListList::null();
@ -149,10 +144,8 @@ const Foam::labelListList& Foam::faPatchMapper::addressing() const
const Foam::scalarListList& Foam::faPatchMapper::weights() const
{
FatalErrorIn
(
"const scalarListList& faPatchMapper::weights() const"
) << "Requested interpolative weights for a direct mapper."
FatalErrorInFunction
<< "Requested interpolative weights for a direct mapper."
<< abort(FatalError);
return scalarListList::null();

View File

@ -105,14 +105,12 @@ class faPatchMapper
public:
// Constructors
//- Construct from mappers
faPatchMapper
(
const faPatch& patch,
const mapPolyMesh& mpm
);
//- Construct from mappers
faPatchMapper
(
const faPatch& patch,
const mapPolyMesh& mpm
);
// Destructor

View File

@ -23,8 +23,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "faMesh.H"
@ -83,7 +81,7 @@ void Foam::faMesh::updateMesh(const mapPolyMesh& mpm)
const labelListList& oldPatchEdgeFaces = mapper.oldPatchEdgeFaces();
forAll (oldPatchEdgeFaces, patchI)
forAll(oldPatchEdgeFaces, patchI)
{
labelList& curPatchEdges = patchEdges[patchI];
curPatchEdges.setSize(nTotalEdges - nInternalEdges);
@ -95,7 +93,7 @@ void Foam::faMesh::updateMesh(const mapPolyMesh& mpm)
// Make a fast lookup
labelHashSet oldFaceLookup(oldPatchEdgeFaces[patchI]);
for (label edgeI = nInternalEdges; edgeI < nTotalEdges; edgeI++)
for (label edgeI = nInternalEdges; edgeI < nTotalEdges; ++edgeI)
{
if (edgeToPatch[edgeI - nInternalEdges] > -1)
{
@ -125,7 +123,7 @@ void Foam::faMesh::updateMesh(const mapPolyMesh& mpm)
}
// Set new edges for all patches
forAll (m.boundary_, patchI)
forAll(m.boundary_, patchI)
{
m.boundary_[patchI].resetEdges(patchEdges[patchI]);
}
@ -198,7 +196,7 @@ void Foam::faMesh::mapOldAreas(const faMeshMapper& mapper) const
const labelList& faceMap = mapper.areaMap().newFaceLabelsMap();
// Map existing old areas; for new faces set area to zero
forAll (faceMap, faceI)
forAll(faceMap, faceI)
{
if (faceMap[faceI] > -1)
{
@ -227,7 +225,7 @@ void Foam::faMesh::mapOldAreas(const faMeshMapper& mapper) const
const labelList& faceMap = mapper.areaMap().newFaceLabelsMap();
// Map old areas for existing faces; for new faces, set area to zero
forAll (faceMap, faceI)
forAll(faceMap, faceI)
{
if (faceMap[faceI] > -1)
{

View File

@ -32,14 +32,12 @@ License
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(coupledFaPatch, 0);
defineTypeNameAndDebug(coupledFaPatch, 0);
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
void coupledFaPatch::calcTransformTensors
void Foam::coupledFaPatch::calcTransformTensors
(
const vector& Cf,
const vector& Cr,
@ -73,7 +71,7 @@ void coupledFaPatch::calcTransformTensors
}
void coupledFaPatch::calcTransformTensors
void Foam::coupledFaPatch::calcTransformTensors
(
const vectorField& Cf,
const vectorField& Cr,
@ -88,7 +86,7 @@ void coupledFaPatch::calcTransformTensors
forwardT_.setSize(size());
reverseT_.setSize(size());
forAll (forwardT_, facei)
forAll(forwardT_, facei)
{
forwardT_[facei] = rotationTensor(-nr[facei], nf[facei]);
reverseT_[facei] = rotationTensor(nf[facei], -nr[facei]);
@ -121,12 +119,8 @@ void coupledFaPatch::calcTransformTensors
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
coupledFaPatch::~coupledFaPatch()
Foam::coupledFaPatch::~coupledFaPatch()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -24,7 +24,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
coupledFaPatch
Foam::coupledFaPatch
Author
Zeljko Tukovic and Hrvoje Jasak
@ -161,7 +161,7 @@ public:
{
if (!separation_.size())
{
FatalErrorIn("coupledFaPatch::separation() const")
FatalErrorInFunction
<< "Coupled patches are not separated"
<< abort(FatalError);
}
@ -174,7 +174,7 @@ public:
{
if (!forwardT_.size())
{
FatalErrorIn("coupledFaPatch::forwardT() const")
FatalErrorInFunction
<< "Coupled planes do not need transformation"
<< abort(FatalError);
}
@ -187,7 +187,7 @@ public:
{
if (!reverseT_.size())
{
FatalErrorIn("coupledFaPatch::forwardT() const")
FatalErrorInFunction
<< "Coupled planes do not need transformation"
<< abort(FatalError);
}

View File

@ -35,13 +35,11 @@ License
namespace Foam
{
defineTypeNameAndDebug(cyclicFaPatch, 0);
addToRunTimeSelectionTable(faPatch, cyclicFaPatch, dictionary);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(cyclicFaPatch, 0);
addToRunTimeSelectionTable(faPatch, cyclicFaPatch, dictionary);
const Foam::scalar cyclicFaPatch::matchTol_ = 1e-3;
const Foam::scalar Foam::cyclicFaPatch::matchTol_ = 1e-3;
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -52,7 +50,7 @@ void Foam::cyclicFaPatch::calcTransforms()
{
pointField half0Ctrs(size()/2);
pointField half1Ctrs(size()/2);
for (label i=0; i<size()/2; i++)
for (label i=0; i<size()/2; ++i)
{
half0Ctrs[i] = this->edgeCentres()[i];
half1Ctrs[i] = this->edgeCentres()[i+size()/2];
@ -66,7 +64,7 @@ void Foam::cyclicFaPatch::calcTransforms()
scalar maxMatchError = 0;
label errorEdge = -1;
for (label edgei = 0; edgei < size()/2; edgei++)
for (label edgei = 0; edgei < size()/2; ++edgei)
{
half0Normals[edgei] = eN[edgei];
label nbrEdgei = edgei + size()/2;
@ -84,7 +82,7 @@ void Foam::cyclicFaPatch::calcTransforms()
half0Normals[edgei] = point(1, 0, 0);
half1Normals[edgei] = half0Normals[edgei];
}
else if(mag(magLe - nbrMagLe)/avLe > matchTol_)
else if (mag(magLe - nbrMagLe)/avLe > matchTol_)
{
// Error in area matching. Find largest error
maxMatchError =
@ -106,10 +104,8 @@ void Foam::cyclicFaPatch::calcTransforms()
scalar nbrMagLe = mag(half1Normals[errorEdge]);
scalar avLe = (magLe + nbrMagLe)/2.0;
FatalErrorIn
(
"cyclicFaPatch::calcTransforms()"
) << "edge " << errorEdge
FatalErrorInFunction
<< "edge " << errorEdge
<< " area does not match neighbour "
<< nbrEdgei << " by "
<< 100*mag(magLe - nbrMagLe)/avLe
@ -142,10 +138,8 @@ void Foam::cyclicFaPatch::calcTransforms()
{
if (forwardT().size() > 1 || reverseT().size() > 1)
{
SeriousErrorIn
(
"void cyclicFaPatch::calcTransforms()"
) << "Transformation tensor is not constant for the cyclic "
SeriousErrorInFunction
<< "Transformation tensor is not constant for the cyclic "
<< "patch. Please reconsider your setup and definition of "
<< "cyclic boundaries." << endl;
}
@ -154,8 +148,7 @@ void Foam::cyclicFaPatch::calcTransforms()
}
// Make patch weighting factors
void cyclicFaPatch::makeWeights(scalarField& w) const
void Foam::cyclicFaPatch::makeWeights(scalarField& w) const
{
const scalarField& magL = magEdgeLengths();
@ -165,7 +158,7 @@ void cyclicFaPatch::makeWeights(scalarField& w) const
scalar maxMatchError = 0;
label errorEdge = -1;
for (label edgei = 0; edgei < sizeby2; edgei++)
for (label edgei = 0; edgei < sizeby2; ++edgei)
{
scalar avL = (magL[edgei] + magL[edgei + sizeby2])/2.0;
@ -198,7 +191,7 @@ void cyclicFaPatch::makeWeights(scalarField& w) const
{
scalar avL = (magL[errorEdge] + magL[errorEdge + sizeby2])/2.0;
FatalErrorIn("cyclicFaPatch::makeWeights(scalarField& w) const")
FatalErrorInFunction
<< "edge " << errorEdge << " and " << errorEdge + sizeby2
<< " areas do not match by "
<< 100*mag(magL[errorEdge] - magL[errorEdge + sizeby2])/avL
@ -210,13 +203,12 @@ void cyclicFaPatch::makeWeights(scalarField& w) const
}
// Make patch edge - neighbour cell distances
void cyclicFaPatch::makeDeltaCoeffs(scalarField& dc) const
void Foam::cyclicFaPatch::makeDeltaCoeffs(scalarField& dc) const
{
const scalarField deltas(edgeNormals() & faPatch::delta());
label sizeby2 = deltas.size()/2;
for (label edgei = 0; edgei < sizeby2; edgei++)
for (label edgei = 0; edgei < sizeby2; ++edgei)
{
scalar di = deltas[edgei];
scalar dni = deltas[edgei + sizeby2];
@ -252,8 +244,8 @@ void Foam::cyclicFaPatch::movePoints(const pointField& p)
calcTransforms();
}
// Return delta (P to N) vectors across coupled patch
tmp<vectorField> cyclicFaPatch::delta() const
Foam::tmp<Foam::vectorField> Foam::cyclicFaPatch::delta() const
{
const vectorField patchD(faPatch::delta());
label sizeby2 = patchD.size()/2;
@ -264,9 +256,9 @@ tmp<vectorField> cyclicFaPatch::delta() const
// Do the transformation if necessary
if (parallel())
{
for (label edgei = 0; edgei < sizeby2; edgei++)
for (label edgei = 0; edgei < sizeby2; ++edgei)
{
vector ddi = patchD[edgei];
const vector& ddi = patchD[edgei];
vector dni = patchD[edgei + sizeby2];
pdv[edgei] = ddi - dni;
@ -275,9 +267,9 @@ tmp<vectorField> cyclicFaPatch::delta() const
}
else
{
for (label edgei = 0; edgei < sizeby2; edgei++)
for (label edgei = 0; edgei < sizeby2; ++edgei)
{
vector ddi = patchD[edgei];
const vector& ddi = patchD[edgei];
vector dni = patchD[edgei + sizeby2];
pdv[edgei] = ddi - transform(forwardT()[0], dni);
@ -289,14 +281,14 @@ tmp<vectorField> cyclicFaPatch::delta() const
}
label Foam::cyclicPolyPatch::neighbPatchID() const
Foam::label Foam::cyclicPolyPatch::neighbPatchID() const
{
NotImplemented;
return -1;
}
tmp<labelField> cyclicFaPatch::interfaceInternalField
Foam::tmp<Foam::labelField> Foam::cyclicFaPatch::interfaceInternalField
(
const labelUList& internalData
) const
@ -305,7 +297,7 @@ tmp<labelField> cyclicFaPatch::interfaceInternalField
}
tmp<labelField> cyclicFaPatch::transfer
Foam::tmp<Foam::labelField> Foam::cyclicFaPatch::transfer
(
const Pstream::commsTypes,
const labelUList& interfaceData
@ -316,7 +308,7 @@ tmp<labelField> cyclicFaPatch::transfer
label sizeby2 = this->size()/2;
for (label edgei=0; edgei<sizeby2; edgei++)
for (label edgei=0; edgei<sizeby2; ++edgei)
{
pnf[edgei] = interfaceData[edgei + sizeby2];
pnf[edgei + sizeby2] = interfaceData[edgei];
@ -326,7 +318,7 @@ tmp<labelField> cyclicFaPatch::transfer
}
tmp<labelField> cyclicFaPatch::internalFieldTransfer
Foam::tmp<Foam::labelField> Foam::cyclicFaPatch::internalFieldTransfer
(
const Pstream::commsTypes commsType,
const labelUList& iF
@ -339,7 +331,7 @@ tmp<labelField> cyclicFaPatch::internalFieldTransfer
label sizeby2 = this->size()/2;
for (label edgei=0; edgei<sizeby2; edgei++)
for (label edgei=0; edgei<sizeby2; ++edgei)
{
pnf[edgei] = iF[edgeCells[edgei + sizeby2]];
pnf[edgei + sizeby2] = iF[edgeCells[edgei]];
@ -349,8 +341,4 @@ tmp<labelField> cyclicFaPatch::internalFieldTransfer
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -59,11 +59,9 @@ class cyclicFaPatch
public coupledFaPatch,
public cyclicLduInterface
{
// Private data
// Private member functions
void calcTransforms();
void calcTransforms();
protected:
@ -73,6 +71,7 @@ protected:
// maximum edge length per face.
static const scalar matchTol_;
// Protected Member functions
//- Make patch weighting factors

View File

@ -23,8 +23,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "emptyFaPatch.H"
@ -47,7 +45,7 @@ addToRunTimeSelectionTable(faPatch, emptyFaPatch, dictionary);
// This is the only piece of info used out of the underlying primitivePatch
// I choose to store it there because it is used in primitive patch operations
// and it should not be duplicated as before. However, to ensure everything
// in the empty patch is sized to zero, we shall here return a regerence to
// in the empty patch is sized to zero, we shall here return a reference to
// a zero-sized field (it does not matter what the field is
//
// const vectorField& emptyFaPatch::edgeNormals() const

View File

@ -24,7 +24,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
emptyFaPatch
Foam::emptyFaPatch
Description
A patch which will not exist in the faMesh. Typical example is a front and
@ -79,7 +79,7 @@ public:
faPatch(name, edgeLabels, index, bm, ngbPolyPatchIndex)
{}
//- Construct from dictionary
//- Construct from dictionary
emptyFaPatch
(
const word& name,

View File

@ -23,8 +23,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "processorFaPatch.H"
@ -40,21 +38,19 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(processorFaPatch, 0);
addToRunTimeSelectionTable(faPatch, processorFaPatch, dictionary);
defineTypeNameAndDebug(processorFaPatch, 0);
addToRunTimeSelectionTable(faPatch, processorFaPatch, dictionary);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
processorFaPatch::~processorFaPatch()
Foam::processorFaPatch::~processorFaPatch()
{
deleteDemandDrivenData(neighbPointsPtr_);
deleteDemandDrivenData(nonGlobalPatchPointsPtr_);
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::label Foam::processorFaPatch::comm() const
@ -69,7 +65,7 @@ int Foam::processorFaPatch::tag() const
}
void processorFaPatch::makeNonGlobalPatchPoints() const
void Foam::processorFaPatch::makeNonGlobalPatchPoints() const
{
// If it is not runing parallel or there are no global points
// create a 1->1 map
@ -79,8 +75,8 @@ void processorFaPatch::makeNonGlobalPatchPoints() const
if
(
!Pstream::parRun()
|| !boundaryMesh().mesh()().globalData().nGlobalPoints()
// || !boundaryMesh().mesh().globalData().nGlobalPoints()
|| !boundaryMesh().mesh()().globalData().nGlobalPoints()
// || !boundaryMesh().mesh().globalData().nGlobalPoints()
)
{
nonGlobalPatchPointsPtr_ = new labelList(nPoints());
@ -92,7 +88,6 @@ void processorFaPatch::makeNonGlobalPatchPoints() const
}
else
{
// Get reference to shared points
const labelList& sharedPoints =
boundaryMesh().mesh()().globalData().sharedPointLabels();
@ -107,13 +102,13 @@ void processorFaPatch::makeNonGlobalPatchPoints() const
label noFiltPoints = 0;
forAll (faMeshPatchPoints, pointI)
forAll(faMeshPatchPoints, pointI)
{
label curP = meshPoints[faMeshPatchPoints[pointI]];
bool found = false;
forAll (sharedPoints, sharedI)
forAll(sharedPoints, sharedI)
{
if (sharedPoints[sharedI] == curP)
{
@ -125,7 +120,7 @@ void processorFaPatch::makeNonGlobalPatchPoints() const
if (!found)
{
ngpp[noFiltPoints] = pointI;
noFiltPoints++;
++noFiltPoints;
}
}
@ -143,13 +138,13 @@ void processorFaPatch::makeNonGlobalPatchPoints() const
// label noFiltPoints = 0;
// forAll (patchPoints, pointI)
// forAll(patchPoints, pointI)
// {
// label curP = patchPoints[pointI];
// bool found = false;
// forAll (sharedPoints, pI)
// forAll(sharedPoints, pI)
// {
// if (sharedPoints[pI] == curP)
// {
@ -170,7 +165,7 @@ void processorFaPatch::makeNonGlobalPatchPoints() const
}
void processorFaPatch::initGeometry()
void Foam::processorFaPatch::initGeometry()
{
if (Pstream::parRun())
{
@ -189,7 +184,7 @@ void processorFaPatch::initGeometry()
}
void processorFaPatch::calcGeometry()
void Foam::processorFaPatch::calcGeometry()
{
if (Pstream::parRun())
{
@ -215,10 +210,8 @@ void processorFaPatch::calcGeometry()
if (mag(magEl[edgei] - nmagEl)/avEl > 1e-6)
{
FatalErrorIn
(
"processorFvPatch::makeWeights(scalarField& w) const"
) << "edge " << edgei
FatalErrorInFunction
<< "edge " << edgei
<< " length does not match neighbour by "
<< 100*mag(magEl[edgei] - nmagEl)/avEl
<< "% -- possible edge ordering problem"
@ -237,20 +230,20 @@ void processorFaPatch::calcGeometry()
}
void processorFaPatch::initMovePoints(const pointField& p)
void Foam::processorFaPatch::initMovePoints(const pointField& p)
{
faPatch::movePoints(p);
initGeometry();
}
void processorFaPatch::movePoints(const pointField&)
void Foam::processorFaPatch::movePoints(const pointField&)
{
calcGeometry();
}
void processorFaPatch::initUpdateMesh()
void Foam::processorFaPatch::initUpdateMesh()
{
// For completeness
faPatch::initUpdateMesh();
@ -268,7 +261,7 @@ void processorFaPatch::initUpdateMesh()
const labelListList& ptEdges = pointEdges();
for (label patchPointI = 0; patchPointI < nPoints(); patchPointI++)
for (label patchPointI = 0; patchPointI < nPoints(); ++patchPointI)
{
label edgeI = ptEdges[patchPointI][0];
@ -277,11 +270,7 @@ void processorFaPatch::initUpdateMesh()
const edge& e = patchEdges[edgeI];
indexInEdge[patchPointI] =
findIndex
(
e,
pointLabels()[patchPointI]
);
findIndex(e, pointLabels()[patchPointI]);
}
OPstream toNeighbProc
@ -298,7 +287,7 @@ void processorFaPatch::initUpdateMesh()
}
void processorFaPatch::updateMesh()
void Foam::processorFaPatch::updateMesh()
{
// For completeness
faPatch::updateMesh();
@ -348,13 +337,13 @@ void processorFaPatch::updateMesh()
{
// Differing number of points. Probably patch includes
// part of a cyclic.
neighbPointsPtr_ = NULL;
neighbPointsPtr_ = nullptr;
}
}
}
const labelList& processorFaPatch::neighbPoints() const
const Foam::labelList& Foam::processorFaPatch::neighbPoints() const
{
if (!neighbPointsPtr_)
{
@ -363,7 +352,7 @@ const labelList& processorFaPatch::neighbPoints() const
// sides of the processor patch since one side might have
// it merged with another bit of geometry
FatalErrorIn("processorFaPatch::neighbPoints() const")
FatalErrorInFunction
<< "No extended addressing calculated for patch " << name()
<< nl
<< "This can happen if the number of points on both"
@ -377,8 +366,7 @@ const labelList& processorFaPatch::neighbPoints() const
}
// Make patch weighting factors
void processorFaPatch::makeWeights(scalarField& w) const
void Foam::processorFaPatch::makeWeights(scalarField& w) const
{
if (Pstream::parRun())
{
@ -391,7 +379,8 @@ void processorFaPatch::makeWeights(scalarField& w) const
)
& (
neighbEdgeCentres()
- neighbEdgeFaceCentres())
- neighbEdgeFaceCentres()
)
);
w = neighbEdgeCentresCn/
@ -407,8 +396,7 @@ void processorFaPatch::makeWeights(scalarField& w) const
}
// Make patch edge - neighbour face distances
void processorFaPatch::makeDeltaCoeffs(scalarField& dc) const
void Foam::processorFaPatch::makeDeltaCoeffs(scalarField& dc) const
{
if (Pstream::parRun())
{
@ -421,8 +409,7 @@ void processorFaPatch::makeDeltaCoeffs(scalarField& dc) const
}
// Return delta (P to N) vectors across coupled patch
tmp<vectorField> processorFaPatch::delta() const
Foam::tmp<Foam::vectorField> Foam::processorFaPatch::delta() const
{
if (Pstream::parRun())
{
@ -457,7 +444,7 @@ tmp<vectorField> processorFaPatch::delta() const
}
const labelList& processorFaPatch::nonGlobalPatchPoints() const
const Foam::labelList& Foam::processorFaPatch::nonGlobalPatchPoints() const
{
if (!nonGlobalPatchPointsPtr_)
{
@ -467,7 +454,8 @@ const labelList& processorFaPatch::nonGlobalPatchPoints() const
return *nonGlobalPatchPointsPtr_;
}
tmp<labelField> processorFaPatch::interfaceInternalField
Foam::tmp<Foam::labelField> Foam::processorFaPatch::interfaceInternalField
(
const labelUList& internalData
) const
@ -476,7 +464,7 @@ tmp<labelField> processorFaPatch::interfaceInternalField
}
void processorFaPatch::initTransfer
void Foam::processorFaPatch::initTransfer
(
const Pstream::commsTypes commsType,
const labelUList& interfaceData
@ -486,7 +474,7 @@ void processorFaPatch::initTransfer
}
tmp<labelField> processorFaPatch::transfer
Foam::tmp<Foam::labelField> Foam::processorFaPatch::transfer
(
const Pstream::commsTypes commsType,
const labelUList&
@ -496,7 +484,7 @@ tmp<labelField> processorFaPatch::transfer
}
void processorFaPatch::initInternalFieldTransfer
void Foam::processorFaPatch::initInternalFieldTransfer
(
const Pstream::commsTypes commsType,
const labelUList& iF
@ -506,7 +494,7 @@ void processorFaPatch::initInternalFieldTransfer
}
tmp<labelField> processorFaPatch::internalFieldTransfer
Foam::tmp<Foam::labelField> Foam::processorFaPatch::internalFieldTransfer
(
const Pstream::commsTypes commsType,
const labelUList&
@ -516,8 +504,7 @@ tmp<labelField> processorFaPatch::internalFieldTransfer
}
// Write
void processorFaPatch::write(Ostream& os) const
void Foam::processorFaPatch::write(Ostream& os) const
{
faPatch::write(os);
os.writeKeyword("myProcNo") << myProcNo_
@ -527,8 +514,4 @@ void processorFaPatch::write(Ostream& os) const
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -24,7 +24,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
processorFaPatch
Foam::processorFaPatch
Description
Processor patch.
@ -146,8 +146,8 @@ public:
neighbEdgeCentres_(),
neighbEdgeLengths_(),
neighbEdgeFaceCentres_(),
neighbPointsPtr_(NULL),
nonGlobalPatchPointsPtr_(NULL)
neighbPointsPtr_(nullptr),
nonGlobalPatchPointsPtr_(nullptr)
{}
//- Construct from dictionary
@ -165,8 +165,8 @@ public:
neighbEdgeCentres_(),
neighbEdgeLengths_(),
neighbEdgeFaceCentres_(),
neighbPointsPtr_(NULL),
nonGlobalPatchPointsPtr_(NULL)
neighbPointsPtr_(nullptr),
nonGlobalPatchPointsPtr_(nullptr)
{}

View File

@ -23,8 +23,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "symmetryFaPatch.H"
@ -34,25 +32,22 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(symmetryFaPatch, 0);
addToRunTimeSelectionTable(faPatch, symmetryFaPatch, dictionary);
defineTypeNameAndDebug(symmetryFaPatch, 0);
addToRunTimeSelectionTable(faPatch, symmetryFaPatch, dictionary);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void symmetryFaPatch::makeCorrVecs(vectorField& cv) const
void Foam::symmetryFaPatch::makeCorrVecs(vectorField& cv) const
{
// Non-orthogonal correction not allowed. HJ, 16/Apr/2009
// Non-orthogonal correction not allowed
cv = vector::zero;
}
// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * //
// Construct from components
symmetryFaPatch::symmetryFaPatch
Foam::symmetryFaPatch::symmetryFaPatch
(
const word& name,
const labelList& edgeLabels,
@ -64,8 +59,8 @@ symmetryFaPatch::symmetryFaPatch
faPatch(name, edgeLabels, index, bm, ngbPolyPatchIndex)
{}
//- Construct from dictionary
symmetryFaPatch::symmetryFaPatch
Foam::symmetryFaPatch::symmetryFaPatch
(
const word& name,
const dictionary& dict,
@ -75,18 +70,13 @@ symmetryFaPatch::symmetryFaPatch
:
faPatch(name, dict, index, bm)
{
if(ngbPolyPatchIndex() == -1)
if (ngbPolyPatchIndex() == -1)
{
FatalErrorIn
(
"symmetryFaPatch::symmetryFaPatch(const word&, const dictionary&, const label, const faBoundaryMesh&)"
) << "Neighbour polyPatch index is not specified for faPatch "
FatalErrorInFunction
<< "Neighbour polyPatch index is not specified for faPatch "
<< this->name() << exit(FatalError);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -112,10 +112,9 @@ public:
);
}
// Destructor
virtual ~symmetryFaPatch()
{}
//- Destructor
virtual ~symmetryFaPatch()
{}
};

View File

@ -23,8 +23,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "wedgeFaPatch.H"
@ -38,21 +36,19 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(wedgeFaPatch, 0);
addToRunTimeSelectionTable(faPatch, wedgeFaPatch, dictionary);
defineTypeNameAndDebug(wedgeFaPatch, 0);
addToRunTimeSelectionTable(faPatch, wedgeFaPatch, dictionary);
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
void wedgeFaPatch::findAxisPoint() const
void Foam::wedgeFaPatch::findAxisPoint() const
{
// Find axis point
labelList ptLabels = pointLabels();
const labelList& ptLabels = pointLabels();
labelListList ptEdges = pointEdges();
const labelListList& ptEdges = pointEdges();
const vectorField& points = boundaryMesh().mesh().points();
@ -60,11 +56,11 @@ void wedgeFaPatch::findAxisPoint() const
forAll(ptEdges, pointI)
{
if( ptEdges[pointI].size() == 1 )
if (ptEdges[pointI].size() == 1)
{
scalar r = mag((I-axis()*axis())&points[ptLabels[pointI]]);
if( r < magL[ptEdges[pointI][0]] )
if (r < magL[ptEdges[pointI][0]])
{
axisPoint_ = ptLabels[pointI];
break;
@ -78,8 +74,7 @@ void wedgeFaPatch::findAxisPoint() const
// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * //
//- Construct from polyPatch
wedgeFaPatch::wedgeFaPatch
Foam::wedgeFaPatch::wedgeFaPatch
(
const word& name,
const dictionary& dict,
@ -88,24 +83,18 @@ wedgeFaPatch::wedgeFaPatch
)
:
faPatch(name, dict, index, bm),
wedgePolyPatchPtr_(NULL),
wedgePolyPatchPtr_(nullptr),
axisPoint_(-1),
axisPointChecked_(false)
{
if(ngbPolyPatchIndex() == -1)
if (ngbPolyPatchIndex() == -1)
{
FatalErrorIn
(
"wedgeFaPatch::wedgeFaPatch(const word&, const dictionary&, const label, const faBoundaryMesh&)"
) << "Neighbour polyPatch index is not specified for faPatch "
FatalErrorInFunction
<< "Neighbour polyPatch index is not specified for faPatch "
<< this->name() << exit(FatalError);
}
if
(
bm.mesh()().boundaryMesh()[ngbPolyPatchIndex()].type()
== wedgePolyPatch::typeName
)
if (isA<wedgePolyPatch>(bm.mesh()().boundaryMesh()[ngbPolyPatchIndex()]))
{
const wedgePolyPatch& wedge =
refCast<const wedgePolyPatch>
@ -117,18 +106,12 @@ wedgeFaPatch::wedgeFaPatch
}
else
{
FatalErrorIn
(
"wedgeFaPatch::wedgeFaPatch(const word&, const dictionary&, const label, const faBoundaryMesh&)"
) << "Neighbour polyPatch is not of type "
FatalErrorInFunction
<< "Neighbour polyPatch is not of type "
<< wedgePolyPatch::typeName
<< exit(FatalError);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -24,7 +24,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
wedgeFaPatch
Foam::wedgeFaPatch
Description
Wedge front and back plane patch.
@ -70,28 +70,25 @@ class wedgeFaPatch
//- Finde axis point
void findAxisPoint() const;
public:
//- Runtime type information
TypeName("wedge");
// Constructors
//- Construct from dictionary
wedgeFaPatch
(
const word& name,
const dictionary& dict,
const label index,
const faBoundaryMesh& bm
);
//- Construct from dictionary
wedgeFaPatch
(
const word& name,
const dictionary& dict,
const label index,
const faBoundaryMesh& bm
);
// Destructor
virtual ~wedgeFaPatch()
{}
//- Destructor
virtual ~wedgeFaPatch()
{}
// Member functions
@ -125,7 +122,7 @@ public:
//- Return axis point label
label axisPoint() const
{
if(axisPoint_ == -1 && !axisPointChecked_)
if (axisPoint_ == -1 && !axisPointChecked_)
{
findAxisPoint();
}

View File

@ -55,7 +55,6 @@ void Foam::faPatch::clearOut()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::faPatch::faPatch
(
const word& name,
@ -69,13 +68,12 @@ Foam::faPatch::faPatch
patchIdentifier(name, index),
ngbPolyPatchIndex_(ngbPolyPatchIndex),
boundaryMesh_(bm),
edgeFacesPtr_(NULL),
pointLabelsPtr_(NULL),
pointEdgesPtr_(NULL)
edgeFacesPtr_(nullptr),
pointLabelsPtr_(nullptr),
pointEdgesPtr_(nullptr)
{}
// Construct from dictionary
Foam::faPatch::faPatch
(
const word& name,
@ -88,20 +86,21 @@ Foam::faPatch::faPatch
patchIdentifier(name, dict, index),
ngbPolyPatchIndex_(readInt(dict.lookup("ngbPolyPatchIndex"))),
boundaryMesh_(bm),
edgeFacesPtr_(NULL),
pointLabelsPtr_(NULL),
pointEdgesPtr_(NULL)
edgeFacesPtr_(nullptr),
pointLabelsPtr_(nullptr),
pointEdgesPtr_(nullptr)
{}
Foam::faPatch::faPatch(const faPatch& p, const faBoundaryMesh& bm)
:
labelList(p),
patchIdentifier(p, p.index()),
ngbPolyPatchIndex_(p.ngbPolyPatchIndex_),
boundaryMesh_(bm),
edgeFacesPtr_(NULL),
pointLabelsPtr_(NULL),
pointEdgesPtr_(NULL)
edgeFacesPtr_(nullptr),
pointLabelsPtr_(nullptr),
pointEdgesPtr_(nullptr)
{}
@ -120,6 +119,7 @@ Foam::label Foam::faPatch::ngbPolyPatchIndex() const
return ngbPolyPatchIndex_;
}
const Foam::faBoundaryMesh& Foam::faPatch::boundaryMesh() const
{
return boundaryMesh_;
@ -147,38 +147,32 @@ void Foam::faPatch::calcPointLabels() const
{
SLList<label> labels;
UList<edge> edges =
patchSlice(boundaryMesh().mesh().edges());
UList<edge> edges = patchSlice(boundaryMesh().mesh().edges());
forAll(edges, edgeI)
{
bool existStart = false;
bool existEnd = false;
for
(
SLList<label>::iterator iter = labels.begin();
iter != labels.end();
++iter
)
forAllIters(labels, iter)
{
if(*iter == edges[edgeI].start())
if (*iter == edges[edgeI].start())
{
existStart = true;
}
if(*iter == edges[edgeI].end())
if (*iter == edges[edgeI].end())
{
existEnd = true;
}
}
if(!existStart)
if (!existStart)
{
labels.append(edges[edgeI].start());
}
if(!existEnd)
if (!existEnd)
{
labels.append(edges[edgeI].end());
}
@ -190,22 +184,20 @@ void Foam::faPatch::calcPointLabels() const
void Foam::faPatch::calcPointEdges() const
{
labelList points = pointLabels();
const labelList& points = pointLabels();
const edgeList::subList e =
patchSlice(boundaryMesh().mesh().edges());
const edgeList::subList e = patchSlice(boundaryMesh().mesh().edges());
// set up storage for pointEdges
List<SLList<label> > pointEdgs(points.size());
List<SLList<label>> pointEdgs(points.size());
forAll (e, edgeI)
forAll(e, edgeI)
{
const edge& curPoints = e[edgeI];
forAll (curPoints, pointI)
forAll(curPoints, pointI)
{
label localPointIndex =
findIndex(points, curPoints[pointI]);
label localPointIndex = findIndex(points, curPoints[pointI]);
pointEdgs[localPointIndex].append(edgeI);
}
@ -215,7 +207,7 @@ void Foam::faPatch::calcPointEdges() const
pointEdgesPtr_ = new labelListList(pointEdgs.size());
labelListList& pEdges = *pointEdgesPtr_;
forAll (pointEdgs, pointI)
forAll(pointEdgs, pointI)
{
pEdges[pointI].setSize(pointEdgs[pointI].size());
@ -248,7 +240,7 @@ Foam::labelList Foam::faPatch::ngbPolyPatchFaces() const
{
labelList ngbFaces;
if(ngbPolyPatchIndex() == -1)
if (ngbPolyPatchIndex() == -1)
{
return ngbFaces;
}
@ -261,22 +253,24 @@ Foam::labelList Foam::faPatch::ngbPolyPatchFaces() const
const labelListList& edgeFaces = pMesh.edgeFaces();
labelList faceCells (patch.size(), -1);
labelList faceCells(patch.size(), -1);
forAll (faceCells, faceI)
forAll(faceCells, faceI)
{
label faceID = aMesh.faceLabels()[faceI];
faceCells[faceI] = pMesh.faceOwner()[faceID];
}
labelList meshEdges =
labelList meshEdges
(
patch.meshEdges
(
pMesh.edges(),
pMesh.cellEdges(),
faceCells
);
)
);
forAll(ngbFaces, edgeI)
{
@ -298,10 +292,11 @@ Foam::labelList Foam::faPatch::ngbPolyPatchFaces() const
}
}
if(ngbFaces[edgeI] == -1)
if (ngbFaces[edgeI] == -1)
{
Info<< "faPatch::edgeNgbPolyPatchFaces(): "
<< "Problem with determination of edge ngb faces!" << endl;
WarningInFunction
<< "Problem with determination of edge ngb faces!"
<< endl;
}
}
@ -345,7 +340,7 @@ Foam::tmp<Foam::vectorField> Foam::faPatch::ngbPolyPatchPointNormals() const
return tmp<vectorField>(new vectorField());
}
labelListList pntEdges = pointEdges();
const labelListList& pntEdges = pointEdges();
tmp<vectorField> tpN(new vectorField(pntEdges.size(), vector::zero));
vectorField& pN = tpN.ref();
@ -380,28 +375,24 @@ const Foam::labelUList& Foam::faPatch::edgeFaces() const
}
// Return the patch edge centres
const Foam::vectorField& Foam::faPatch::edgeCentres() const
{
return boundaryMesh().mesh().edgeCentres().boundaryField()[index()];
}
// Return the patch edges length vectors
const Foam::vectorField& Foam::faPatch::edgeLengths() const
{
return boundaryMesh().mesh().Le().boundaryField()[index()];
}
// Return the patch edge length magnitudes
const Foam::scalarField& Foam::faPatch::magEdgeLengths() const
{
return boundaryMesh().mesh().magLe().boundaryField()[index()];
}
// Return the patch edge unit normals
Foam::tmp<Foam::vectorField> Foam::faPatch::edgeNormals() const
{
tmp<vectorField> eN(new vectorField(size()));
@ -412,7 +403,6 @@ Foam::tmp<Foam::vectorField> Foam::faPatch::edgeNormals() const
}
// Return the patch edge neighbour face centres
Foam::tmp<Foam::vectorField> Foam::faPatch::edgeFaceCentres() const
{
tmp<vectorField> tfc(new vectorField(size()));
@ -424,7 +414,7 @@ Foam::tmp<Foam::vectorField> Foam::faPatch::edgeFaceCentres() const
const labelUList& faceLabels = edgeFaces();
forAll (faceLabels, edgeI)
forAll(faceLabels, edgeI)
{
fc[edgeI] = gfc[faceLabels[edgeI]];
}
@ -433,21 +423,18 @@ Foam::tmp<Foam::vectorField> Foam::faPatch::edgeFaceCentres() const
}
// Return cell-centre to face-centre vector
Foam::tmp<Foam::vectorField> Foam::faPatch::delta() const
{
return edgeCentres() - edgeFaceCentres();
}
// Make delta coefficients as patch face - neighbour cell distances
void Foam::faPatch::makeDeltaCoeffs(scalarField& dc) const
{
dc = 1.0/(edgeNormals() & delta());
}
// Return delta coefficients
const Foam::scalarField& Foam::faPatch::deltaCoeffs() const
{
return boundaryMesh().mesh().deltaCoeffs().boundaryField()[index()];
@ -496,7 +483,7 @@ void Foam::faPatch::write(Ostream& os) const
Foam::Ostream& Foam::operator<<(Ostream& os, const faPatch& p)
{
p.write(os);
os.check("Ostream& operator<<(Ostream& f, const faPatch& p)");
os.check(FUNCTION_NAME);
return os;
}

View File

@ -24,7 +24,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
faPatch
Foam::faPatch
Description
Finite area patch class. Used for 2-D non-Euclidian finite area method.
@ -92,19 +92,19 @@ private:
// Private Member Functions
//- Disallow construct as copy
faPatch(const faPatch&);
faPatch(const faPatch&) = delete;
//- Disallow assignment
void operator=(const faPatch&);
void operator=(const faPatch&) = delete;
//- Clear out topological patch data
void clearOut();
//- Clear out topological patch data
void clearOut();
protected:
// The faPatch geometry initialisation is called by faBoundaryMesh
//- The faPatch geometry initialisation is called by faBoundaryMesh
friend class faBoundaryMesh;
//- Calculate patch point labels
@ -216,9 +216,8 @@ public:
);
// Destructor
virtual ~faPatch();
//- Destructor
virtual ~faPatch();
// Member Functions
@ -334,7 +333,7 @@ public:
//- Return given internal field next to patch as patch field
template<class Type>
tmp<Field<Type> > patchInternalField(const UList<Type>&) const;
tmp<Field<Type>> patchInternalField(const UList<Type>&) const;
//- Return the corresponding patchField of the named field
template<class GeometricField, class Type>
@ -352,8 +351,8 @@ public:
const typename GeometricField::Patch& lookupPatchField
(
const word& name,
const GeometricField* = NULL,
const Type* = NULL
const GeometricField* = nullptr,
const Type* = nullptr
) const;
@ -370,7 +369,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "faPatchTemplates.C"
#include "faPatchTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -24,13 +24,11 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
faPatchData
Foam::faPatchData
Description
Class which holds data needed for faPatch construction
SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef faPatchData_H
@ -44,7 +42,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class faPatchData Declaration
Class faPatchData Declaration
\*---------------------------------------------------------------------------*/
struct faPatchData
@ -69,9 +67,6 @@ struct faPatchData
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif

View File

@ -24,7 +24,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
faPatchList
foam::faPatchList
Description
Container classes for faPatch

View File

@ -23,21 +23,14 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "faPatch.H"
#include "dictionary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
autoPtr<faPatch> faPatch::New
Foam::autoPtr<Foam::faPatch> Foam::faPatch::New
(
const word& name,
const dictionary& dict,
@ -45,27 +38,18 @@ autoPtr<faPatch> faPatch::New
const faBoundaryMesh& bm
)
{
if (debug)
{
Info<< "faPatch::New(const word&, const dictionary&, const label, "
"const faBoundaryMesh&) : constructing faPatch"
<< endl;
}
DebugInFunction
<< "constructing faPatch" << endl;
word patchType(dict.lookup("type"));
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(patchType);
auto cstrIter = dictionaryConstructorTablePtr_->cfind(patchType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
if (!cstrIter.found())
{
FatalIOErrorIn
(
"faPatch::New(const word&, const dictionary&, "
"const label, const faBoundaryMesh&)",
dict
) << "Unknown faPatch type " << patchType << endl << endl
<< "Valid faPatch types are :" << endl
FatalIOErrorInFunction(dict)
<< "Unknown faPatch type " << patchType << nl << nl
<< "Valid faPatch types are :" << nl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalIOError);
}
@ -74,8 +58,4 @@ autoPtr<faPatch> faPatch::New
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -30,12 +30,12 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::faPatch::patchInternalField
Foam::tmp<Foam::Field<Type>> Foam::faPatch::patchInternalField
(
const UList<Type>& f
) const
{
tmp<Field<Type> > tpif(new Field<Type>(size()));
tmp<Field<Type>> tpif (new Field<Type>(size()));
Field<Type>& pif = tpif.ref();
const labelUList& edgeFaces = this->edgeFaces();