mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: finite volume did not work before.
This commit is contained in:
45
TODO
Normal file
45
TODO
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
- allocate/free tags.
|
||||||
|
Not tested.
|
||||||
|
|
||||||
|
OK - test blockMesh with cyclics
|
||||||
|
unitTestCases/singleCyclic/
|
||||||
|
|
||||||
|
OK - test cyclics sequential running.
|
||||||
|
unitTestCases/singleCyclic/
|
||||||
|
|
||||||
|
OK - test decomposePar
|
||||||
|
|
||||||
|
OK - FaceCellWave
|
||||||
|
unitTestCases/twoCavityCyclicForWallDistance/
|
||||||
|
|
||||||
|
OK - non-parallel finite volume : channelFoam
|
||||||
|
unitTestCases/channel395-splitCyclic vs. channel395-dev
|
||||||
|
|
||||||
|
OK - parallel finite volume with processorCyclic: channelFoam
|
||||||
|
unitTestCases/channel395-splitCyclic vs. channel395-dev
|
||||||
|
|
||||||
|
- amg
|
||||||
|
- test createPatch pointSync
|
||||||
|
- pointFields on cyclics. volPointInterpolation.
|
||||||
|
- jumpCyclics
|
||||||
|
- fanFvPatchField
|
||||||
|
- activeBaffleVelocity
|
||||||
|
- work out overlapping communication for PstreamBuffers.
|
||||||
|
Different tag?
|
||||||
|
- fvMeshDistribute to split processor patches into ones with different
|
||||||
|
separation.
|
||||||
|
- fvMeshSubset
|
||||||
|
- kivaToFoam/readKivaGrid.H sorts cyclics (but in incorrect order?)
|
||||||
|
- grep for size()/2
|
||||||
|
- pointEdgeWave (maybe through inversePointDistanceDiffusivity?)
|
||||||
|
- regionSplit
|
||||||
|
- scotchDecomp
|
||||||
|
- isoSurface.C
|
||||||
|
- preProcessing/foamUpgradeCyclics
|
||||||
|
- referredCellList.C
|
||||||
|
- renumberMesh
|
||||||
|
- work out scheduled communication?
|
||||||
|
|
||||||
|
compile:
|
||||||
|
|
||||||
|
|
||||||
@ -296,12 +296,7 @@ label mergePatchFaces
|
|||||||
const faceZone& fZone = mesh.faceZones()[zoneID];
|
const faceZone& fZone = mesh.faceZones()[zoneID];
|
||||||
zoneFlip = fZone.flipMap()[fZone.whichFace(newMasterI)];
|
zoneFlip = fZone.flipMap()[fZone.whichFace(newMasterI)];
|
||||||
}
|
}
|
||||||
labelPair patchIDs = polyTopoChange::whichPatch
|
label patchID = mesh.boundaryMesh().whichPatch(newMasterI);
|
||||||
(
|
|
||||||
mesh.boundaryMesh(),
|
|
||||||
newMasterI
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
Pout<< "Restoring new master face " << newMasterI
|
Pout<< "Restoring new master face " << newMasterI
|
||||||
<< " to vertices " << setFaceVerts[0] << endl;
|
<< " to vertices " << setFaceVerts[0] << endl;
|
||||||
@ -316,11 +311,10 @@ label mergePatchFaces
|
|||||||
own, // owner
|
own, // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // face flip
|
false, // face flip
|
||||||
patchIDs[0], // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
false, // remove from zone
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip, // face flip in zone
|
zoneFlip // face flip in zone
|
||||||
patchIDs[1] // subPatch
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -342,10 +336,9 @@ label mergePatchFaces
|
|||||||
-1, // masterEdgeID,
|
-1, // masterEdgeID,
|
||||||
newMasterI, // masterFaceID,
|
newMasterI, // masterFaceID,
|
||||||
false, // flipFaceFlux,
|
false, // flipFaceFlux,
|
||||||
patchIDs[0], // patchID,
|
patchID, // patchID,
|
||||||
zoneID, // zoneID,
|
zoneID, // zoneID,
|
||||||
zoneFlip, // zoneFlip
|
zoneFlip // zoneFlip
|
||||||
patchIDs[1] // subPatch
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,12 +45,17 @@ defineTypeNameAndDebug(Foam::cellSplitter, 0);
|
|||||||
void Foam::cellSplitter::getFaceInfo
|
void Foam::cellSplitter::getFaceInfo
|
||||||
(
|
(
|
||||||
const label faceI,
|
const label faceI,
|
||||||
labelPair& patchIDs,
|
label& patchID,
|
||||||
label& zoneID,
|
label& zoneID,
|
||||||
label& zoneFlip
|
label& zoneFlip
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
patchIDs = polyTopoChange::whichPatch(mesh_.boundaryMesh(), faceI);
|
patchID = -1;
|
||||||
|
|
||||||
|
if (!mesh_.isInternalFace(faceI))
|
||||||
|
{
|
||||||
|
patchID = mesh_.boundaryMesh().whichPatch(faceI);
|
||||||
|
}
|
||||||
|
|
||||||
zoneID = mesh_.faceZones().whichZone(faceI);
|
zoneID = mesh_.faceZones().whichZone(faceI);
|
||||||
|
|
||||||
@ -161,7 +166,8 @@ void Foam::cellSplitter::setRefinement
|
|||||||
|
|
||||||
label anchorPoint = mesh_.cellPoints()[cellI][0];
|
label anchorPoint = mesh_.cellPoints()[cellI][0];
|
||||||
|
|
||||||
label addedPointI = meshMod.setAction
|
label addedPointI =
|
||||||
|
meshMod.setAction
|
||||||
(
|
(
|
||||||
polyAddPoint
|
polyAddPoint
|
||||||
(
|
(
|
||||||
@ -199,7 +205,9 @@ void Foam::cellSplitter::setRefinement
|
|||||||
|
|
||||||
// Add other pyramids
|
// Add other pyramids
|
||||||
for (label i = 1; i < cFaces.size(); i++)
|
for (label i = 1; i < cFaces.size(); i++)
|
||||||
label addedCellI = meshMod.setAction
|
{
|
||||||
|
label addedCellI =
|
||||||
|
meshMod.setAction
|
||||||
(
|
(
|
||||||
polyAddCell
|
polyAddCell
|
||||||
(
|
(
|
||||||
@ -296,8 +304,7 @@ void Foam::cellSplitter::setRefinement
|
|||||||
false, // flux flip
|
false, // flux flip
|
||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
-1, // zone for face
|
-1, // zone for face
|
||||||
false, // face zone flip
|
false // face zone flip
|
||||||
-1 // subPatch
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -343,8 +350,7 @@ void Foam::cellSplitter::setRefinement
|
|||||||
false, // flux flip
|
false, // flux flip
|
||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
-1, // zone for face
|
-1, // zone for face
|
||||||
false, // face zone flip
|
false // face zone flip
|
||||||
-1 // subPatch
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -399,8 +405,7 @@ void Foam::cellSplitter::setRefinement
|
|||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
false, // remove from zone
|
false, // remove from zone
|
||||||
-1, // zone for face
|
-1, // zone for face
|
||||||
false, // face zone flip
|
false // face zone flip
|
||||||
-1 // subPatch
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -418,8 +423,7 @@ void Foam::cellSplitter::setRefinement
|
|||||||
-1, // patch for face
|
-1, // patch for face
|
||||||
false, // remove from zone
|
false, // remove from zone
|
||||||
-1, // zone for face
|
-1, // zone for face
|
||||||
false, // face zone flip
|
false // face zone flip
|
||||||
-1 // subPatch
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -429,9 +433,9 @@ void Foam::cellSplitter::setRefinement
|
|||||||
{
|
{
|
||||||
label newOwn = newOwner(faceI, cellToCells);
|
label newOwn = newOwner(faceI, cellToCells);
|
||||||
|
|
||||||
labelPair patchIDs;
|
label patchID, zoneID, zoneFlip;
|
||||||
label zoneID, zoneFlip;
|
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
|
||||||
getFaceInfo(faceI, patchIDs, zoneID, zoneFlip);
|
|
||||||
meshMod.setAction
|
meshMod.setAction
|
||||||
(
|
(
|
||||||
polyModifyFace
|
polyModifyFace
|
||||||
@ -441,11 +445,10 @@ void Foam::cellSplitter::setRefinement
|
|||||||
newOwn, // owner
|
newOwn, // owner
|
||||||
-1, // neighbour
|
-1, // neighbour
|
||||||
false, // flux flip
|
false, // flux flip
|
||||||
patchIDs[0], // patch for face
|
patchID, // patch for face
|
||||||
false, // remove from zone
|
false, // remove from zone
|
||||||
zoneID, // zone for face
|
zoneID, // zone for face
|
||||||
zoneFlip, // face zone flip
|
zoneFlip // face zone flip
|
||||||
patchIDs[1]
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,6 @@ SourceFiles
|
|||||||
|
|
||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
#include "edge.H"
|
#include "edge.H"
|
||||||
#include "labelPair.H"
|
|
||||||
#include "typeInfo.H"
|
#include "typeInfo.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -74,7 +73,7 @@ class cellSplitter
|
|||||||
void getFaceInfo
|
void getFaceInfo
|
||||||
(
|
(
|
||||||
const label faceI,
|
const label faceI,
|
||||||
labelPair& patchIDs,
|
label& patchID,
|
||||||
label& zoneID,
|
label& zoneID,
|
||||||
label& zoneFlip
|
label& zoneFlip
|
||||||
) const;
|
) const;
|
||||||
|
|||||||
@ -1200,8 +1200,7 @@ int main(int argc, char *argv[])
|
|||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
-1, // patchID
|
-1, // patchID
|
||||||
faceZonei, // zoneID
|
faceZonei, // zoneID
|
||||||
fm[facei], // zoneFlip
|
fm[facei] // zoneFlip
|
||||||
-1 // subPatchID
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1252,8 +1251,7 @@ int main(int argc, char *argv[])
|
|||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
patchi, // patchID
|
patchi, // patchID
|
||||||
-1, // zoneID
|
-1, // zoneID
|
||||||
false, // zoneFlip
|
false // zoneFlip
|
||||||
-1 // subPatchID
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// For baffles create the opposite face
|
// For baffles create the opposite face
|
||||||
@ -1270,8 +1268,7 @@ int main(int argc, char *argv[])
|
|||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
patchi, // patchID
|
patchi, // patchID
|
||||||
-1, // zoneID
|
-1, // zoneID
|
||||||
false, // zoneFlip
|
false // zoneFlip
|
||||||
-1
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1320,8 +1317,7 @@ int main(int argc, char *argv[])
|
|||||||
false, //flipFaceFlux
|
false, //flipFaceFlux
|
||||||
-1, //patchID
|
-1, //patchID
|
||||||
-1, //zoneID
|
-1, //zoneID
|
||||||
false, //zoneFlip
|
false //zoneFlip
|
||||||
-1 //subPatchID
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -136,8 +136,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
-1, // patchID
|
-1, // patchID
|
||||||
zoneID, // zoneID
|
zoneID, // zoneID
|
||||||
zoneFlip, // zoneFlip
|
zoneFlip // zoneFlip
|
||||||
-1 // subPatchID
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,8 +173,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
patchI, // patchID
|
patchI, // patchID
|
||||||
zoneID, // zoneID
|
zoneID, // zoneID
|
||||||
zoneFlip, // zoneFlip
|
zoneFlip // zoneFlip
|
||||||
-1 //?TBD subPatchID
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -238,8 +236,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
frontPatchI, // patchID
|
frontPatchI, // patchID
|
||||||
-1, // zoneID
|
-1, // zoneID
|
||||||
false, // zoneFlip
|
false // zoneFlip
|
||||||
-1 //?TDB subPatchID
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Offset to create front face.
|
// Offset to create front face.
|
||||||
@ -258,8 +255,7 @@ void Foam::extrude2DMesh::setRefinement
|
|||||||
false, // flipFaceFlux
|
false, // flipFaceFlux
|
||||||
frontPatchI, // patchID
|
frontPatchI, // patchID
|
||||||
-1, // zoneID
|
-1, // zoneID
|
||||||
false, // zoneFlip
|
false // zoneFlip
|
||||||
-1 //?TDB subPatchID
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -198,69 +198,55 @@ void dumpCyclicMatch(const fileName& prefix, const polyMesh& mesh)
|
|||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
{
|
{
|
||||||
if (isA<cyclicPolyPatch>(patches[patchI]))
|
if
|
||||||
|
(
|
||||||
|
isA<cyclicPolyPatch>(patches[patchI])
|
||||||
|
&& refCast<const cyclicPolyPatch>(patches[patchI]).owner()
|
||||||
|
)
|
||||||
{
|
{
|
||||||
const cyclicPolyPatch& cycPatch =
|
const cyclicPolyPatch& cycPatch =
|
||||||
refCast<const cyclicPolyPatch>(patches[patchI]);
|
refCast<const cyclicPolyPatch>(patches[patchI]);
|
||||||
|
|
||||||
label halfSize = cycPatch.size()/2;
|
// Dump patches
|
||||||
|
|
||||||
// Dump halves
|
|
||||||
{
|
{
|
||||||
OFstream str(prefix+cycPatch.name()+"_half0.obj");
|
OFstream str(prefix+cycPatch.name()+".obj");
|
||||||
Pout<< "Dumping " << cycPatch.name()
|
Pout<< "Dumping " << cycPatch.name()
|
||||||
<< " half0 faces to " << str.name() << endl;
|
<< " faces to " << str.name() << endl;
|
||||||
meshTools::writeOBJ
|
meshTools::writeOBJ
|
||||||
(
|
(
|
||||||
str,
|
str,
|
||||||
static_cast<faceList>
|
|
||||||
(
|
|
||||||
SubList<face>
|
|
||||||
(
|
|
||||||
cycPatch,
|
cycPatch,
|
||||||
halfSize
|
|
||||||
)
|
|
||||||
),
|
|
||||||
cycPatch.points()
|
cycPatch.points()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
||||||
{
|
{
|
||||||
OFstream str(prefix+cycPatch.name()+"_half1.obj");
|
OFstream str(prefix+nbrPatch.name()+".obj");
|
||||||
Pout<< "Dumping " << cycPatch.name()
|
Pout<< "Dumping " << nbrPatch.name()
|
||||||
<< " half1 faces to " << str.name() << endl;
|
<< " faces to " << str.name() << endl;
|
||||||
meshTools::writeOBJ
|
meshTools::writeOBJ
|
||||||
(
|
(
|
||||||
str,
|
str,
|
||||||
static_cast<faceList>
|
nbrPatch,
|
||||||
(
|
nbrPatch.points()
|
||||||
SubList<face>
|
|
||||||
(
|
|
||||||
cycPatch,
|
|
||||||
halfSize,
|
|
||||||
halfSize
|
|
||||||
)
|
|
||||||
),
|
|
||||||
cycPatch.points()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Lines between corresponding face centres
|
// Lines between corresponding face centres
|
||||||
OFstream str(prefix+cycPatch.name()+"_match.obj");
|
OFstream str(prefix+cycPatch.name()+nbrPatch.name()+"_match.obj");
|
||||||
label vertI = 0;
|
label vertI = 0;
|
||||||
|
|
||||||
Pout<< "Dumping cyclic match as lines between face centres to "
|
Pout<< "Dumping cyclic match as lines between face centres to "
|
||||||
<< str.name() << endl;
|
<< str.name() << endl;
|
||||||
|
|
||||||
for (label faceI = 0; faceI < halfSize; faceI++)
|
forAll(cycPatch, faceI)
|
||||||
{
|
{
|
||||||
const point& fc0 = mesh.faceCentres()[cycPatch.start()+faceI];
|
const point& fc0 = mesh.faceCentres()[cycPatch.start()+faceI];
|
||||||
meshTools::writeOBJ(str, fc0);
|
meshTools::writeOBJ(str, fc0);
|
||||||
vertI++;
|
vertI++;
|
||||||
|
const point& fc1 = mesh.faceCentres()[nbrPatch.start()+faceI];
|
||||||
label nbrFaceI = halfSize + faceI;
|
|
||||||
const point& fc1 =
|
|
||||||
mesh.faceCentres()[cycPatch.start()+nbrFaceI];
|
|
||||||
meshTools::writeOBJ(str, fc1);
|
meshTools::writeOBJ(str, fc1);
|
||||||
vertI++;
|
vertI++;
|
||||||
|
|
||||||
@ -273,34 +259,13 @@ void dumpCyclicMatch(const fileName& prefix, const polyMesh& mesh)
|
|||||||
|
|
||||||
void separateList
|
void separateList
|
||||||
(
|
(
|
||||||
const vectorField& separation,
|
const vector& separation,
|
||||||
UList<vector>& field
|
UList<vector>& field
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (separation.size() == 1)
|
|
||||||
{
|
|
||||||
// Single value for all.
|
|
||||||
|
|
||||||
forAll(field, i)
|
forAll(field, i)
|
||||||
{
|
{
|
||||||
field[i] += separation[0];
|
field[i] += separation;
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (separation.size() == field.size())
|
|
||||||
{
|
|
||||||
forAll(field, i)
|
|
||||||
{
|
|
||||||
field[i] += separation[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"separateList(const vectorField&, UList<vector>&)"
|
|
||||||
) << "Sizes of field and transformation not equal. field:"
|
|
||||||
<< field.size() << " transformation:" << separation.size()
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,13 +392,19 @@ void syncPoints
|
|||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchI];
|
||||||
|
|
||||||
if (isA<cyclicPolyPatch>(pp))
|
if
|
||||||
|
(
|
||||||
|
isA<cyclicPolyPatch>(pp)
|
||||||
|
&& refCast<const cyclicPolyPatch>(pp).owner()
|
||||||
|
)
|
||||||
{
|
{
|
||||||
const cyclicPolyPatch& cycPatch =
|
const cyclicPolyPatch& cycPatch =
|
||||||
refCast<const cyclicPolyPatch>(pp);
|
refCast<const cyclicPolyPatch>(pp);
|
||||||
|
|
||||||
const edgeList& coupledPoints = cycPatch.coupledPoints();
|
const edgeList& coupledPoints = cycPatch.coupledPoints();
|
||||||
const labelList& meshPts = cycPatch.meshPoints();
|
const labelList& meshPts = cycPatch.meshPoints();
|
||||||
|
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
||||||
|
const labelList& nbrMeshPts = nbrPatch.meshPoints();
|
||||||
|
|
||||||
pointField half0Values(coupledPoints.size());
|
pointField half0Values(coupledPoints.size());
|
||||||
|
|
||||||
@ -452,14 +423,14 @@ void syncPoints
|
|||||||
else if (cycPatch.separated())
|
else if (cycPatch.separated())
|
||||||
{
|
{
|
||||||
hasTransformation = true;
|
hasTransformation = true;
|
||||||
const vectorField& v = cycPatch.coupledPolyPatch::separation();
|
const vector& v = cycPatch.separation();
|
||||||
separateList(v, half0Values);
|
separateList(v, half0Values);
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(coupledPoints, i)
|
forAll(coupledPoints, i)
|
||||||
{
|
{
|
||||||
const edge& e = coupledPoints[i];
|
const edge& e = coupledPoints[i];
|
||||||
label point1 = meshPts[e[1]];
|
label point1 = nbrMeshPts[e[1]];
|
||||||
points[point1] = half0Values[i];
|
points[point1] = half0Values[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -783,13 +754,8 @@ int main(int argc, char *argv[])
|
|||||||
// current separation also includes the normal
|
// current separation also includes the normal
|
||||||
// ( separation_ = (nf&(Cr - Cf))*nf ).
|
// ( separation_ = (nf&(Cr - Cf))*nf ).
|
||||||
|
|
||||||
// For processor patches:
|
|
||||||
// - disallow multiple separation/transformation. This basically
|
|
||||||
// excludes decomposed cyclics. Use the (probably 0) separation
|
|
||||||
// to align the points.
|
|
||||||
// For cyclic patches:
|
// For cyclic patches:
|
||||||
// - for separated ones use our own recalculated offset vector
|
// - for separated ones use user specified offset vector
|
||||||
// - for rotational ones use current one.
|
|
||||||
|
|
||||||
forAll(mesh.boundaryMesh(), patchI)
|
forAll(mesh.boundaryMesh(), patchI)
|
||||||
{
|
{
|
||||||
@ -813,51 +779,18 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (cycpp.transform() == cyclicPolyPatch::TRANSLATIONAL)
|
if (cycpp.transform() == cyclicPolyPatch::TRANSLATIONAL)
|
||||||
{
|
{
|
||||||
|
// Force to wanted separation
|
||||||
Info<< "On cyclic translation patch " << pp.name()
|
Info<< "On cyclic translation patch " << pp.name()
|
||||||
<< " forcing uniform separation of "
|
<< " forcing uniform separation of "
|
||||||
<< cycpp.separationVector() << endl;
|
<< cycpp.separationVector() << endl;
|
||||||
const_cast<vectorField&>(cpp.separation()) =
|
const_cast<vector&>(cpp.separation()) =
|
||||||
pointField(1, cycpp.separationVector());
|
cycpp.separationVector();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
const_cast<vectorField&>(cpp.separation()) =
|
|
||||||
pointField
|
|
||||||
(
|
|
||||||
1,
|
|
||||||
pp[pp.size()/2].centre(mesh.points())
|
|
||||||
- pp[0].centre(mesh.points())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const_cast<vectorField&>(cpp.separation())
|
|
||||||
.setSize(1);
|
|
||||||
}
|
}
|
||||||
Info<< "On coupled patch " << pp.name()
|
Info<< "On coupled patch " << pp.name()
|
||||||
<< " forcing uniform separation of "
|
<< " forcing uniform separation of "
|
||||||
<< cpp.separation() << endl;
|
<< cpp.separation() << endl;
|
||||||
}
|
}
|
||||||
else if (!cpp.parallel())
|
|
||||||
{
|
|
||||||
Info<< "On coupled patch " << pp.name()
|
|
||||||
<< " forcing uniform rotation of "
|
|
||||||
<< cpp.forwardT()[0] << endl;
|
|
||||||
|
|
||||||
const_cast<tensorField&>
|
|
||||||
(
|
|
||||||
cpp.forwardT()
|
|
||||||
).setSize(1);
|
|
||||||
const_cast<tensorField&>
|
|
||||||
(
|
|
||||||
cpp.reverseT()
|
|
||||||
).setSize(1);
|
|
||||||
|
|
||||||
Info<< "On coupled patch " << pp.name()
|
|
||||||
<< " forcing uniform rotation of "
|
|
||||||
<< cpp.forwardT() << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -306,8 +306,6 @@ autoPtr<mapPolyMesh> reorderMesh
|
|||||||
labelList patchStarts(patches.size());
|
labelList patchStarts(patches.size());
|
||||||
labelList oldPatchNMeshPoints(patches.size());
|
labelList oldPatchNMeshPoints(patches.size());
|
||||||
labelListList patchPointMap(patches.size());
|
labelListList patchPointMap(patches.size());
|
||||||
labelListList subPatches(patches.size());
|
|
||||||
labelListList subPatchStarts(patches.size());
|
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
{
|
{
|
||||||
@ -315,16 +313,6 @@ autoPtr<mapPolyMesh> reorderMesh
|
|||||||
patchStarts[patchI] = patches[patchI].start();
|
patchStarts[patchI] = patches[patchI].start();
|
||||||
oldPatchNMeshPoints[patchI] = patches[patchI].nPoints();
|
oldPatchNMeshPoints[patchI] = patches[patchI].nPoints();
|
||||||
patchPointMap[patchI] = identity(patches[patchI].nPoints());
|
patchPointMap[patchI] = identity(patches[patchI].nPoints());
|
||||||
|
|
||||||
if (isA<processorPolyPatch>(patches[patchI]))
|
|
||||||
{
|
|
||||||
const processorPolyPatch& ppp = refCast<const processorPolyPatch>
|
|
||||||
(
|
|
||||||
patches[patchI]
|
|
||||||
);
|
|
||||||
subPatches[patchI] = ppp.patchIDs();
|
|
||||||
subPatchStarts[patchI] = ppp.starts();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mesh.resetPrimitives
|
mesh.resetPrimitives
|
||||||
@ -335,8 +323,7 @@ autoPtr<mapPolyMesh> reorderMesh
|
|||||||
xferMove(newNeighbour),
|
xferMove(newNeighbour),
|
||||||
patchSizes,
|
patchSizes,
|
||||||
patchStarts,
|
patchStarts,
|
||||||
subPatches,
|
true
|
||||||
subPatchStarts
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return autoPtr<mapPolyMesh>
|
return autoPtr<mapPolyMesh>
|
||||||
|
|||||||
@ -556,7 +556,7 @@ void getInterfaceSizes
|
|||||||
label cellI = mesh.faceOwner()[i+mesh.nInternalFaces()];
|
label cellI = mesh.faceOwner()[i+mesh.nInternalFaces()];
|
||||||
coupledRegion[i] = cellRegion[cellI];
|
coupledRegion[i] = cellRegion[cellI];
|
||||||
}
|
}
|
||||||
syncTools::swapBoundaryFaceList(mesh, coupledRegion, false);
|
syncTools::swapBoundaryFaceList(mesh, coupledRegion);
|
||||||
|
|
||||||
forAll(coupledRegion, i)
|
forAll(coupledRegion, i)
|
||||||
{
|
{
|
||||||
@ -726,7 +726,7 @@ autoPtr<mapPolyMesh> createRegionMesh
|
|||||||
label cellI = mesh.faceOwner()[i+mesh.nInternalFaces()];
|
label cellI = mesh.faceOwner()[i+mesh.nInternalFaces()];
|
||||||
coupledRegion[i] = cellRegion[cellI];
|
coupledRegion[i] = cellRegion[cellI];
|
||||||
}
|
}
|
||||||
syncTools::swapBoundaryFaceList(mesh, coupledRegion, false);
|
syncTools::swapBoundaryFaceList(mesh, coupledRegion);
|
||||||
|
|
||||||
|
|
||||||
// Topology change container. Start off from existing mesh.
|
// Topology change container. Start off from existing mesh.
|
||||||
@ -1375,7 +1375,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
neiZoneID[i] = zoneID[mesh.faceOwner()[i+mesh.nInternalFaces()]];
|
neiZoneID[i] = zoneID[mesh.faceOwner()[i+mesh.nInternalFaces()]];
|
||||||
}
|
}
|
||||||
syncTools::swapBoundaryFaceList(mesh, neiZoneID, false);
|
syncTools::swapBoundaryFaceList(mesh, neiZoneID);
|
||||||
|
|
||||||
|
|
||||||
// Determine connected regions
|
// Determine connected regions
|
||||||
|
|||||||
@ -337,22 +337,22 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Construct the point fields
|
// Construct the point fields
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
pointMesh pMesh(mesh);
|
// pointMesh pMesh(mesh);
|
||||||
|
|
||||||
PtrList<pointScalarField> pointScalarFields;
|
PtrList<pointScalarField> pointScalarFields;
|
||||||
readFields(pMesh, objects, pointScalarFields);
|
// readFields(pMesh, objects, pointScalarFields);
|
||||||
|
|
||||||
PtrList<pointVectorField> pointVectorFields;
|
PtrList<pointVectorField> pointVectorFields;
|
||||||
readFields(pMesh, objects, pointVectorFields);
|
// readFields(pMesh, objects, pointVectorFields);
|
||||||
|
|
||||||
PtrList<pointSphericalTensorField> pointSphericalTensorFields;
|
PtrList<pointSphericalTensorField> pointSphericalTensorFields;
|
||||||
readFields(pMesh, objects, pointSphericalTensorFields);
|
// readFields(pMesh, objects, pointSphericalTensorFields);
|
||||||
|
|
||||||
PtrList<pointSymmTensorField> pointSymmTensorFields;
|
PtrList<pointSymmTensorField> pointSymmTensorFields;
|
||||||
readFields(pMesh, objects, pointSymmTensorFields);
|
// readFields(pMesh, objects, pointSymmTensorFields);
|
||||||
|
|
||||||
PtrList<pointTensorField> pointTensorFields;
|
PtrList<pointTensorField> pointTensorFields;
|
||||||
readFields(pMesh, objects, pointTensorFields);
|
// readFields(pMesh, objects, pointTensorFields);
|
||||||
|
|
||||||
|
|
||||||
// Construct the Lagrangian fields
|
// Construct the Lagrangian fields
|
||||||
@ -652,45 +652,45 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Point fields
|
// // Point fields
|
||||||
if
|
// if
|
||||||
(
|
// (
|
||||||
pointScalarFields.size()
|
// pointScalarFields.size()
|
||||||
|| pointVectorFields.size()
|
// || pointVectorFields.size()
|
||||||
|| pointSphericalTensorFields.size()
|
// || pointSphericalTensorFields.size()
|
||||||
|| pointSymmTensorFields.size()
|
// || pointSymmTensorFields.size()
|
||||||
|| pointTensorFields.size()
|
// || pointTensorFields.size()
|
||||||
)
|
// )
|
||||||
{
|
// {
|
||||||
labelIOList pointProcAddressing
|
// labelIOList pointProcAddressing
|
||||||
(
|
// (
|
||||||
IOobject
|
// IOobject
|
||||||
(
|
// (
|
||||||
"pointProcAddressing",
|
// "pointProcAddressing",
|
||||||
procMesh.facesInstance(),
|
// procMesh.facesInstance(),
|
||||||
procMesh.meshSubDir,
|
// procMesh.meshSubDir,
|
||||||
procMesh,
|
// procMesh,
|
||||||
IOobject::MUST_READ,
|
// IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE
|
// IOobject::NO_WRITE
|
||||||
)
|
// )
|
||||||
);
|
// );
|
||||||
|
//
|
||||||
pointMesh procPMesh(procMesh, true);
|
// pointMesh procPMesh(procMesh, true);
|
||||||
|
//
|
||||||
pointFieldDecomposer fieldDecomposer
|
// pointFieldDecomposer fieldDecomposer
|
||||||
(
|
// (
|
||||||
pMesh,
|
// pMesh,
|
||||||
procPMesh,
|
// procPMesh,
|
||||||
pointProcAddressing,
|
// pointProcAddressing,
|
||||||
boundaryProcAddressing
|
// boundaryProcAddressing
|
||||||
);
|
// );
|
||||||
|
//
|
||||||
fieldDecomposer.decomposeFields(pointScalarFields);
|
// fieldDecomposer.decomposeFields(pointScalarFields);
|
||||||
fieldDecomposer.decomposeFields(pointVectorFields);
|
// fieldDecomposer.decomposeFields(pointVectorFields);
|
||||||
fieldDecomposer.decomposeFields(pointSphericalTensorFields);
|
// fieldDecomposer.decomposeFields(pointSphericalTensorFields);
|
||||||
fieldDecomposer.decomposeFields(pointSymmTensorFields);
|
// fieldDecomposer.decomposeFields(pointSymmTensorFields);
|
||||||
fieldDecomposer.decomposeFields(pointTensorFields);
|
// fieldDecomposer.decomposeFields(pointTensorFields);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
// If there is lagrangian data write it out
|
// If there is lagrangian data write it out
|
||||||
|
|||||||
@ -29,6 +29,7 @@ License
|
|||||||
#include "dictionary.H"
|
#include "dictionary.H"
|
||||||
#include "labelIOList.H"
|
#include "labelIOList.H"
|
||||||
#include "processorPolyPatch.H"
|
#include "processorPolyPatch.H"
|
||||||
|
#include "processorCyclicPolyPatch.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "OSspecific.H"
|
#include "OSspecific.H"
|
||||||
#include "Map.H"
|
#include "Map.H"
|
||||||
@ -293,10 +294,34 @@ bool Foam::domainDecomposition::writeDecomposition()
|
|||||||
|
|
||||||
const polyPatchList& meshPatches = boundaryMesh();
|
const polyPatchList& meshPatches = boundaryMesh();
|
||||||
|
|
||||||
|
|
||||||
|
// Count the number of inter-proc patches
|
||||||
|
label nInterProcPatches = 0;
|
||||||
|
forAll(curSubPatchIDs, procPatchI)
|
||||||
|
{
|
||||||
|
Info<< "For processor " << procI
|
||||||
|
<< " have to destination processor "
|
||||||
|
<< curNeighbourProcessors[procPatchI] << endl;
|
||||||
|
|
||||||
|
forAll(curSubPatchIDs[procPatchI], i)
|
||||||
|
{
|
||||||
|
Info<< " from patch:" << curSubPatchIDs[procPatchI][i]
|
||||||
|
<< " starting at:" << curSubStarts[procPatchI][i]
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
nInterProcPatches += curSubPatchIDs[procPatchI].size();
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "For processor " << procI
|
||||||
|
<< " have " << nInterProcPatches << " to neighbouring processors"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
|
||||||
List<polyPatch*> procPatches
|
List<polyPatch*> procPatches
|
||||||
(
|
(
|
||||||
curPatchSizes.size()
|
curPatchSizes.size()
|
||||||
+ curProcessorPatchSizes.size(),
|
+ nInterProcPatches, //curProcessorPatchSizes.size(),
|
||||||
reinterpret_cast<polyPatch*>(0)
|
reinterpret_cast<polyPatch*>(0)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -335,24 +360,73 @@ bool Foam::domainDecomposition::writeDecomposition()
|
|||||||
|
|
||||||
forAll(curProcessorPatchSizes, procPatchI)
|
forAll(curProcessorPatchSizes, procPatchI)
|
||||||
{
|
{
|
||||||
|
const labelList& subPatchID = curSubPatchIDs[procPatchI];
|
||||||
|
const labelList& subStarts = curSubStarts[procPatchI];
|
||||||
|
|
||||||
|
label curStart = curProcessorPatchStarts[procPatchI];
|
||||||
|
|
||||||
|
forAll(subPatchID, i)
|
||||||
|
{
|
||||||
|
label size =
|
||||||
|
(
|
||||||
|
i < subPatchID.size()-1
|
||||||
|
? subStarts[i+1] - subStarts[i]
|
||||||
|
: curProcessorPatchSizes[procPatchI] - subStarts[i]
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "From processor:" << procI << endl
|
||||||
|
<< " to processor:" << curNeighbourProcessors[procPatchI]
|
||||||
|
<< endl
|
||||||
|
<< " via patch:" << subPatchID[i] << endl
|
||||||
|
<< " start :" << curStart << endl
|
||||||
|
<< " size :" << size << endl;
|
||||||
|
|
||||||
|
if (subPatchID[i] == -1)
|
||||||
|
{
|
||||||
|
// From internal faces
|
||||||
procPatches[nPatches] =
|
procPatches[nPatches] =
|
||||||
new processorPolyPatch
|
new processorPolyPatch
|
||||||
(
|
(
|
||||||
word("procBoundary") + Foam::name(procI)
|
word("procBoundary") + Foam::name(procI)
|
||||||
+ word("to")
|
+ "to"
|
||||||
+ Foam::name(curNeighbourProcessors[procPatchI]),
|
+ Foam::name(curNeighbourProcessors[procPatchI]),
|
||||||
curProcessorPatchSizes[procPatchI],
|
size,
|
||||||
curProcessorPatchStarts[procPatchI],
|
curStart,
|
||||||
|
nPatches,
|
||||||
|
procMesh.boundaryMesh(),
|
||||||
|
procI,
|
||||||
|
curNeighbourProcessors[procPatchI]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// From cyclic
|
||||||
|
const word& referPatch =
|
||||||
|
boundaryMesh()[subPatchID[i]].name();
|
||||||
|
|
||||||
|
procPatches[nPatches] =
|
||||||
|
new processorCyclicPolyPatch
|
||||||
|
(
|
||||||
|
word("procBoundary") + Foam::name(procI)
|
||||||
|
+ "to"
|
||||||
|
+ Foam::name(curNeighbourProcessors[procPatchI])
|
||||||
|
+ "through"
|
||||||
|
+ referPatch,
|
||||||
|
size,
|
||||||
|
curStart,
|
||||||
nPatches,
|
nPatches,
|
||||||
procMesh.boundaryMesh(),
|
procMesh.boundaryMesh(),
|
||||||
procI,
|
procI,
|
||||||
curNeighbourProcessors[procPatchI],
|
curNeighbourProcessors[procPatchI],
|
||||||
curSubPatchIDs[procPatchI],
|
referPatch
|
||||||
curSubStarts[procPatchI]
|
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
curStart += size;
|
||||||
|
|
||||||
nPatches++;
|
nPatches++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
forAll(procPatches, patchI)
|
forAll(procPatches, patchI)
|
||||||
|
|||||||
@ -40,7 +40,7 @@ Description
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void domainDecomposition::append(labelList& lst, const label elem)
|
void Foam::domainDecomposition::append(labelList& lst, const label elem)
|
||||||
{
|
{
|
||||||
label sz = lst.size();
|
label sz = lst.size();
|
||||||
lst.setSize(sz+1);
|
lst.setSize(sz+1);
|
||||||
@ -48,7 +48,7 @@ void domainDecomposition::append(labelList& lst, const label elem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void domainDecomposition::addInterProcFace
|
void Foam::domainDecomposition::addInterProcFace
|
||||||
(
|
(
|
||||||
const label facei,
|
const label facei,
|
||||||
const label ownerProc,
|
const label ownerProc,
|
||||||
@ -97,7 +97,7 @@ void domainDecomposition::addInterProcFace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
void Foam::domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||||
{
|
{
|
||||||
// Decide which cell goes to which processor
|
// Decide which cell goes to which processor
|
||||||
distributeCells();
|
distributeCells();
|
||||||
@ -230,14 +230,15 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
|||||||
facei,
|
facei,
|
||||||
ownerProc,
|
ownerProc,
|
||||||
nbrProc,
|
nbrProc,
|
||||||
|
|
||||||
procNbrToInterPatch,
|
procNbrToInterPatch,
|
||||||
interPatchFaces
|
interPatchFaces
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the proper processor faces to the sub information. Since faces
|
// Add the proper processor faces to the sub information. For faces
|
||||||
// originate from internal faces this is always -1.
|
// originating from internal faces this is always -1.
|
||||||
List<labelListList> subPatchIDs(nProcs_);
|
List<labelListList> subPatchIDs(nProcs_);
|
||||||
List<labelListList> subPatchStarts(nProcs_);
|
List<labelListList> subPatchStarts(nProcs_);
|
||||||
forAll(interPatchFaces, procI)
|
forAll(interPatchFaces, procI)
|
||||||
@ -415,7 +416,16 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
|||||||
forAll(procBoundaryAddressing_, procI)
|
forAll(procBoundaryAddressing_, procI)
|
||||||
{
|
{
|
||||||
label nNormal = procPatchSize_[procI].size();
|
label nNormal = procPatchSize_[procI].size();
|
||||||
label nInterProc = procProcessorPatchSize_[procI].size();
|
|
||||||
|
const labelListList& curSubPatchIDs =
|
||||||
|
procProcessorPatchSubPatchIDs_[procI];
|
||||||
|
|
||||||
|
// label nInterProc = procProcessorPatchSize_[procI].size();
|
||||||
|
label nInterProc = 0;
|
||||||
|
forAll(curSubPatchIDs, procPatchI)
|
||||||
|
{
|
||||||
|
nInterProc += curSubPatchIDs[procPatchI].size();
|
||||||
|
}
|
||||||
|
|
||||||
procBoundaryAddressing_[procI].setSize(nNormal + nInterProc);
|
procBoundaryAddressing_[procI].setSize(nNormal + nInterProc);
|
||||||
|
|
||||||
@ -423,9 +433,14 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
|||||||
{
|
{
|
||||||
procBoundaryAddressing_[procI][patchI] = patchI;
|
procBoundaryAddressing_[procI][patchI] = patchI;
|
||||||
}
|
}
|
||||||
for (label patchI = nNormal; patchI < nNormal+nInterProc; patchI++)
|
label patchI = nNormal;
|
||||||
|
forAll(curSubPatchIDs, procPatchI)
|
||||||
{
|
{
|
||||||
procBoundaryAddressing_[procI][patchI] = -1;
|
forAll(curSubPatchIDs[procPatchI], i)
|
||||||
|
{
|
||||||
|
procBoundaryAddressing_[procI][patchI++] =
|
||||||
|
curSubPatchIDs[procPatchI][i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -145,7 +145,11 @@ Foam::fvFieldDecomposer::fvFieldDecomposer
|
|||||||
{
|
{
|
||||||
forAll(boundaryAddressing_, patchi)
|
forAll(boundaryAddressing_, patchi)
|
||||||
{
|
{
|
||||||
if (boundaryAddressing_[patchi] >= 0)
|
if
|
||||||
|
(
|
||||||
|
boundaryAddressing_[patchi] >= 0
|
||||||
|
&& !isA<processorLduInterface>(procMesh.boundary()[patchi])
|
||||||
|
)
|
||||||
{
|
{
|
||||||
patchFieldDecomposerPtrs_[patchi] = new patchFieldDecomposer
|
patchFieldDecomposerPtrs_[patchi] = new patchFieldDecomposer
|
||||||
(
|
(
|
||||||
|
|||||||
@ -27,6 +27,8 @@ License
|
|||||||
#include "fvFieldDecomposer.H"
|
#include "fvFieldDecomposer.H"
|
||||||
#include "processorFvPatchField.H"
|
#include "processorFvPatchField.H"
|
||||||
#include "processorFvsPatchField.H"
|
#include "processorFvsPatchField.H"
|
||||||
|
#include "processorCyclicFvPatchField.H"
|
||||||
|
#include "processorCyclicFvsPatchField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -45,7 +47,7 @@ Foam::fvFieldDecomposer::decomposeField
|
|||||||
|
|
||||||
forAll(boundaryAddressing_, patchi)
|
forAll(boundaryAddressing_, patchi)
|
||||||
{
|
{
|
||||||
if (boundaryAddressing_[patchi] >= 0)
|
if (patchFieldDecomposerPtrs_[patchi])
|
||||||
{
|
{
|
||||||
patchFields.set
|
patchFields.set
|
||||||
(
|
(
|
||||||
@ -59,7 +61,24 @@ Foam::fvFieldDecomposer::decomposeField
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else if (isA<processorCyclicFvPatch>(procMesh_.boundary()[patchi]))
|
||||||
|
{
|
||||||
|
patchFields.set
|
||||||
|
(
|
||||||
|
patchi,
|
||||||
|
new processorCyclicFvPatchField<Type>
|
||||||
|
(
|
||||||
|
procMesh_.boundary()[patchi],
|
||||||
|
DimensionedField<Type, volMesh>::null(),
|
||||||
|
Field<Type>
|
||||||
|
(
|
||||||
|
field.internalField(),
|
||||||
|
*processorVolPatchFieldDecomposerPtrs_[patchi]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (isA<processorFvPatch>(procMesh_.boundary()[patchi]))
|
||||||
{
|
{
|
||||||
patchFields.set
|
patchFields.set
|
||||||
(
|
(
|
||||||
@ -76,6 +95,11 @@ Foam::fvFieldDecomposer::decomposeField
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn("fvFieldDecomposer::decomposeField()")
|
||||||
|
<< "Unknown type." << abort(FatalError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the field for the processor
|
// Create the field for the processor
|
||||||
@ -156,7 +180,7 @@ Foam::fvFieldDecomposer::decomposeField
|
|||||||
|
|
||||||
forAll(boundaryAddressing_, patchi)
|
forAll(boundaryAddressing_, patchi)
|
||||||
{
|
{
|
||||||
if (boundaryAddressing_[patchi] >= 0)
|
if (patchFieldDecomposerPtrs_[patchi])
|
||||||
{
|
{
|
||||||
patchFields.set
|
patchFields.set
|
||||||
(
|
(
|
||||||
@ -170,7 +194,24 @@ Foam::fvFieldDecomposer::decomposeField
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else if (isA<processorCyclicFvPatch>(procMesh_.boundary()[patchi]))
|
||||||
|
{
|
||||||
|
patchFields.set
|
||||||
|
(
|
||||||
|
patchi,
|
||||||
|
new processorCyclicFvsPatchField<Type>
|
||||||
|
(
|
||||||
|
procMesh_.boundary()[patchi],
|
||||||
|
DimensionedField<Type, surfaceMesh>::null(),
|
||||||
|
Field<Type>
|
||||||
|
(
|
||||||
|
allFaceField,
|
||||||
|
*processorSurfacePatchFieldDecomposerPtrs_[patchi]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (isA<processorFvPatch>(procMesh_.boundary()[patchi]))
|
||||||
{
|
{
|
||||||
patchFields.set
|
patchFields.set
|
||||||
(
|
(
|
||||||
@ -187,6 +228,11 @@ Foam::fvFieldDecomposer::decomposeField
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn("fvFieldDecomposer::decomposeField()")
|
||||||
|
<< "Unknown type." << abort(FatalError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the field for the processor
|
// Create the field for the processor
|
||||||
|
|||||||
@ -80,7 +80,7 @@ void Foam::channelIndex::walkOppositeFaces
|
|||||||
isFrontBndFace[faceI-mesh.nInternalFaces()] = true;
|
isFrontBndFace[faceI-mesh.nInternalFaces()] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
syncTools::swapBoundaryFaceList(mesh, isFrontBndFace, false);
|
syncTools::swapBoundaryFaceList(mesh, isFrontBndFace);
|
||||||
|
|
||||||
// Add
|
// Add
|
||||||
forAll(isFrontBndFace, i)
|
forAll(isFrontBndFace, i)
|
||||||
|
|||||||
@ -31,7 +31,6 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "cyclicPolyPatch.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
// Main program:
|
// Main program:
|
||||||
@ -77,35 +76,12 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Give patch area
|
// Give patch area
|
||||||
if (isA<cyclicPolyPatch>(mesh.boundaryMesh()[patchi]))
|
|
||||||
{
|
|
||||||
Info<< " Cyclic patch vector area: " << nl;
|
|
||||||
label nFaces = mesh.boundaryMesh()[patchi].size();
|
|
||||||
vector sum1 = vector::zero;
|
|
||||||
vector sum2 = vector::zero;
|
|
||||||
for (label i=0; i<nFaces/2; i++)
|
|
||||||
{
|
|
||||||
sum1 += mesh.Sf().boundaryField()[patchi][i];
|
|
||||||
sum2 += mesh.Sf().boundaryField()[patchi][i+nFaces/2];
|
|
||||||
}
|
|
||||||
reduce(sum1, sumOp<vector>());
|
|
||||||
reduce(sum2, sumOp<vector>());
|
|
||||||
Info<< " - half 1 = " << sum1 << ", " << mag(sum1) << nl
|
|
||||||
<< " - half 2 = " << sum2 << ", " << mag(sum2) << nl
|
|
||||||
<< " - total = " << (sum1 + sum2) << ", "
|
|
||||||
<< mag(sum1 + sum2) << endl;
|
|
||||||
Info<< " Cyclic patch area magnitude = "
|
|
||||||
<< gSum(mesh.magSf().boundaryField()[patchi])/2.0 << endl;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< " Area vector of patch "
|
Info<< " Area vector of patch "
|
||||||
<< patchName << '[' << patchi << ']' << " = "
|
<< patchName << '[' << patchi << ']' << " = "
|
||||||
<< gSum(mesh.Sf().boundaryField()[patchi]) << endl;
|
<< gSum(mesh.Sf().boundaryField()[patchi]) << endl;
|
||||||
Info<< " Area magnitude of patch "
|
Info<< " Area magnitude of patch "
|
||||||
<< patchName << '[' << patchi << ']' << " = "
|
<< patchName << '[' << patchi << ']' << " = "
|
||||||
<< gSum(mesh.magSf().boundaryField()[patchi]) << endl;
|
<< gSum(mesh.magSf().boundaryField()[patchi]) << endl;
|
||||||
}
|
|
||||||
|
|
||||||
// Read field and calc integral
|
// Read field and calc integral
|
||||||
if (fieldHeader.headerClassName() == volScalarField::typeName)
|
if (fieldHeader.headerClassName() == volScalarField::typeName)
|
||||||
|
|||||||
@ -0,0 +1,3 @@
|
|||||||
|
foamUpgradeCyclics.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_APPBIN)/foamUpgradeCyclics
|
||||||
@ -0,0 +1,281 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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
|
||||||
|
|
||||||
|
Application
|
||||||
|
foamUpgradeCyclics
|
||||||
|
|
||||||
|
Description
|
||||||
|
Simple tool to upgrade mesh and fields for split cyclics
|
||||||
|
|
||||||
|
Usage
|
||||||
|
|
||||||
|
- foamUpgradeCyclics [OPTION]
|
||||||
|
|
||||||
|
@param -test \n
|
||||||
|
Suppress writing the updated files with split cyclics
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "argList.H"
|
||||||
|
#include "Time.H"
|
||||||
|
#include "IOdictionary.H"
|
||||||
|
#include "polyMesh.H"
|
||||||
|
#include "entry.H"
|
||||||
|
#include "IOPtrList.H"
|
||||||
|
#include "cyclicPolyPatch.H"
|
||||||
|
|
||||||
|
using namespace Foam;
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTemplateTypeNameAndDebug(IOPtrList<entry>, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Main program:
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
argList::addBoolOption("test");
|
||||||
|
#include "addRegionOption.H"
|
||||||
|
|
||||||
|
# include "setRootCase.H"
|
||||||
|
# include "createTime.H"
|
||||||
|
|
||||||
|
Foam::word regionName = polyMesh::defaultRegion;
|
||||||
|
args.optionReadIfPresent("region", regionName);
|
||||||
|
|
||||||
|
fileName regionPrefix = "";
|
||||||
|
if (regionName != polyMesh::defaultRegion)
|
||||||
|
{
|
||||||
|
regionPrefix = regionName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Per cyclic patch the new name for this side and the other side
|
||||||
|
HashTable<word> thisNames;
|
||||||
|
HashTable<word> nbrNames;
|
||||||
|
|
||||||
|
// Read boundary file without reading mesh
|
||||||
|
{
|
||||||
|
IOobject io
|
||||||
|
(
|
||||||
|
"boundary",
|
||||||
|
runTime.findInstance
|
||||||
|
(
|
||||||
|
regionPrefix/polyMesh::meshSubDir,
|
||||||
|
"boundary"
|
||||||
|
),
|
||||||
|
polyMesh::meshSubDir,
|
||||||
|
runTime,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
Info<< "Reading boundary from " << io.filePath() << endl;
|
||||||
|
|
||||||
|
|
||||||
|
// Read PtrList of dictionary.
|
||||||
|
const word oldTypeName = IOPtrList<entry>::typeName;
|
||||||
|
const_cast<word&>(IOPtrList<entry>::typeName) = word::null;
|
||||||
|
IOPtrList<entry> patches(io);
|
||||||
|
const_cast<word&>(IOPtrList<entry>::typeName) = oldTypeName;
|
||||||
|
// Fake type back to what was in field
|
||||||
|
const_cast<word&>(patches.type()) = patches.headerClassName();
|
||||||
|
|
||||||
|
// Temporary convert to dictionary
|
||||||
|
dictionary patchDict;
|
||||||
|
forAll(patches, i)
|
||||||
|
{
|
||||||
|
patchDict.add(patches[i].keyword(), patches[i].dict());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Replace any 'cyclic'
|
||||||
|
label nOldCyclics = 0;
|
||||||
|
forAll(patches, patchI)
|
||||||
|
{
|
||||||
|
const dictionary& patchDict = patches[patchI].dict();
|
||||||
|
|
||||||
|
if (word(patchDict["type"]) == cyclicPolyPatch::typeName)
|
||||||
|
{
|
||||||
|
if (patchDict.found("neighbourPatch"))
|
||||||
|
{
|
||||||
|
Info<< "Patch " << patches[patchI].keyword()
|
||||||
|
<< " already has 'neighbourPatch' entry; assuming it"
|
||||||
|
<< " is already converted." << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< "Patch " << patches[patchI].keyword()
|
||||||
|
<< " does not have 'neighbourPatch' entry; assuming it"
|
||||||
|
<< " is of the old type." << endl;
|
||||||
|
nOldCyclics++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Detected " << nOldCyclics << " old cyclics." << nl << endl;
|
||||||
|
|
||||||
|
|
||||||
|
// edo the
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
PtrList<entry> oldPatches(patches);
|
||||||
|
|
||||||
|
Pout<< "oldPatches:" << oldPatches << endl;
|
||||||
|
|
||||||
|
// Extend
|
||||||
|
label nOldPatches = patches.size();
|
||||||
|
patches.setSize(nOldPatches+nOldCyclics);
|
||||||
|
|
||||||
|
|
||||||
|
// Add new entries
|
||||||
|
label newPatchI = 0;
|
||||||
|
forAll(oldPatches, patchI)
|
||||||
|
{
|
||||||
|
const dictionary& patchDict = oldPatches[patchI].dict();
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
word(patchDict["type"]) == cyclicPolyPatch::typeName
|
||||||
|
&& !patchDict.found("neighbourPatch")
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const word& name = oldPatches[patchI].keyword();
|
||||||
|
label nFaces = readLabel(patchDict["nFaces"]);
|
||||||
|
label startFace = readLabel(patchDict["startFace"]);
|
||||||
|
|
||||||
|
word thisName = name + "_half0";
|
||||||
|
word nbrName = name + "_half1";
|
||||||
|
|
||||||
|
thisNames.insert(name, thisName);
|
||||||
|
nbrNames.insert(name, nbrName);
|
||||||
|
|
||||||
|
// Change entry on this side
|
||||||
|
patches.set(newPatchI, oldPatches(patchI));
|
||||||
|
dictionary& thisPatchDict = patches[newPatchI].dict();
|
||||||
|
thisPatchDict.add("neighbourPatch", nbrName);
|
||||||
|
thisPatchDict.set("nFaces", nFaces/2);
|
||||||
|
patches[newPatchI].keyword() = thisName;
|
||||||
|
newPatchI++;
|
||||||
|
|
||||||
|
// Add entry on other side
|
||||||
|
patches.set(newPatchI, oldPatches(patchI));
|
||||||
|
dictionary& nbrPatchDict = patches[newPatchI].dict();
|
||||||
|
nbrPatchDict.add("neighbourPatch", nbrName);
|
||||||
|
nbrPatchDict.set("nFaces", nFaces/2);
|
||||||
|
nbrPatchDict.set("startFace", startFace+nFaces/2);
|
||||||
|
patches[newPatchI].keyword() = nbrName;
|
||||||
|
newPatchI++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
patches.set(newPatchI++, oldPatches(patchI));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "boundary:" << patches << endl;
|
||||||
|
|
||||||
|
if (returnReduce(nOldCyclics, sumOp<label>()) >= 0)
|
||||||
|
{
|
||||||
|
if (args.optionFound("test"))
|
||||||
|
{
|
||||||
|
Info<< "-test option: no changes made" << nl << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (mvBak(patches.objectPath(), "old"))
|
||||||
|
{
|
||||||
|
Info<< "Backup to "
|
||||||
|
<< (patches.objectPath() + ".old") << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Write to "
|
||||||
|
<< patches.objectPath() << nl << endl;
|
||||||
|
patches.write();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// {
|
||||||
|
// // Read dictionary. (disable class type checking so we can load
|
||||||
|
// // field)
|
||||||
|
// Info<< "Loading dictionary " << fieldName << endl;
|
||||||
|
// const word oldTypeName = IOdictionary::typeName;
|
||||||
|
// const_cast<word&>(IOdictionary::typeName) = word::null;
|
||||||
|
//
|
||||||
|
// IOdictionary fieldDict
|
||||||
|
// (
|
||||||
|
// IOobject
|
||||||
|
// (
|
||||||
|
// "p",
|
||||||
|
// instance,
|
||||||
|
// mesh,
|
||||||
|
// IOobject::MUST_READ,
|
||||||
|
// IOobject::NO_WRITE,
|
||||||
|
// false
|
||||||
|
// )
|
||||||
|
// );
|
||||||
|
// const_cast<word&>(IOdictionary::typeName) = oldTypeName;
|
||||||
|
// // Fake type back to what was in field
|
||||||
|
// const_cast<word&>(fieldDict.type()) = fieldDict.headerClassName();
|
||||||
|
//
|
||||||
|
// Info<< "Loaded dictionary " << fieldName
|
||||||
|
// << " with entries " << fieldDict.toc() << endl;
|
||||||
|
//
|
||||||
|
// dictionary& boundaryField = fieldDict.subDict("boundaryField");
|
||||||
|
//
|
||||||
|
// forAllConstIter(HashTable<word>, thisNames, iter)
|
||||||
|
// {
|
||||||
|
// const word& patchName = iter.key();
|
||||||
|
// const word& newName = iter();
|
||||||
|
//
|
||||||
|
// Info<< "Looking for entry for patch " << patchName << endl;
|
||||||
|
//
|
||||||
|
// if (boundaryField.found(patchName) && !boundaryField.found(iter()))
|
||||||
|
// {
|
||||||
|
// const dictionary& patchDict = boundaryField[patchName];
|
||||||
|
//
|
||||||
|
// Field<scalar> fld(patchDict.lookup("value"));
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// forAllIter(IDLList<entry>, boundaryField, patchIter)
|
||||||
|
// {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -252,12 +252,13 @@ bool Foam::FaceCellWave<Type>::updateFace
|
|||||||
template <class Type>
|
template <class Type>
|
||||||
void Foam::FaceCellWave<Type>::checkCyclic(const polyPatch& patch) const
|
void Foam::FaceCellWave<Type>::checkCyclic(const polyPatch& patch) const
|
||||||
{
|
{
|
||||||
label cycOffset = patch.size()/2;
|
const cyclicPolyPatch& nbrPatch =
|
||||||
|
refCast<const cyclicPolyPatch>(patch).neighbPatch();
|
||||||
|
|
||||||
for (label patchFaceI = 0; patchFaceI < cycOffset; patchFaceI++)
|
forAll(patch, patchFaceI)
|
||||||
{
|
{
|
||||||
label i1 = patch.start() + patchFaceI;
|
label i1 = patch.start() + patchFaceI;
|
||||||
label i2 = i1 + cycOffset;
|
label i2 = nbrPatch.start() + patchFaceI;
|
||||||
|
|
||||||
if (!allFaceInfo_[i1].sameGeometry(mesh_, allFaceInfo_[i2], geomTol_))
|
if (!allFaceInfo_[i1].sameGeometry(mesh_, allFaceInfo_[i2], geomTol_))
|
||||||
{
|
{
|
||||||
@ -335,8 +336,7 @@ void Foam::FaceCellWave<Type>::mergeFaceInfo
|
|||||||
const polyPatch& patch,
|
const polyPatch& patch,
|
||||||
const label nFaces,
|
const label nFaces,
|
||||||
const labelList& changedFaces,
|
const labelList& changedFaces,
|
||||||
const List<Type>& changedFacesInfo,
|
const List<Type>& changedFacesInfo
|
||||||
const bool
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
for (label changedFaceI = 0; changedFaceI < nFaces; changedFaceI++)
|
for (label changedFaceI = 0; changedFaceI < nFaces; changedFaceI++)
|
||||||
@ -454,40 +454,6 @@ void Foam::FaceCellWave<Type>::transform
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Send face info to neighbour.
|
|
||||||
template <class Type>
|
|
||||||
void Foam::FaceCellWave<Type>::sendPatchInfo
|
|
||||||
(
|
|
||||||
const label neighbour,
|
|
||||||
const label nFaces,
|
|
||||||
const labelList& faceLabels,
|
|
||||||
const List<Type>& faceInfo
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
OPstream toNeighbour(Pstream::blocking, neighbour);
|
|
||||||
|
|
||||||
writeFaces(nFaces, faceLabels, faceInfo, toNeighbour);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Receive face info from neighbour
|
|
||||||
template <class Type>
|
|
||||||
Foam::label Foam::FaceCellWave<Type>::receivePatchInfo
|
|
||||||
(
|
|
||||||
const label neighbour,
|
|
||||||
labelList& faceLabels,
|
|
||||||
List<Type>& faceInfo
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
IPstream fromNeighbour(Pstream::blocking, neighbour);
|
|
||||||
|
|
||||||
label nFaces = 0;
|
|
||||||
readFaces(nFaces, faceLabels, faceInfo, fromNeighbour);
|
|
||||||
|
|
||||||
return nFaces;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Offset mesh face. Used for transferring from one cyclic half to the other.
|
// Offset mesh face. Used for transferring from one cyclic half to the other.
|
||||||
template <class Type>
|
template <class Type>
|
||||||
void Foam::FaceCellWave<Type>::offset
|
void Foam::FaceCellWave<Type>::offset
|
||||||
@ -511,6 +477,8 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
|
|||||||
{
|
{
|
||||||
// Send all
|
// Send all
|
||||||
|
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
forAll(mesh_.boundaryMesh(), patchI)
|
forAll(mesh_.boundaryMesh(), patchI)
|
||||||
{
|
{
|
||||||
const polyPatch& patch = mesh_.boundaryMesh()[patchI];
|
const polyPatch& patch = mesh_.boundaryMesh()[patchI];
|
||||||
@ -552,16 +520,13 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPatchInfo
|
UOPstream toNeighbour(procPatch.neighbProcNo(), pBufs);
|
||||||
(
|
writeFaces(nSendFaces, sendFaces, sendFacesInfo, toNeighbour);
|
||||||
procPatch.neighbProcNo(),
|
|
||||||
nSendFaces,
|
|
||||||
sendFaces,
|
|
||||||
sendFacesInfo
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
// Receive all
|
// Receive all
|
||||||
|
|
||||||
forAll(mesh_.boundaryMesh(), patchI)
|
forAll(mesh_.boundaryMesh(), patchI)
|
||||||
@ -574,16 +539,20 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
|
|||||||
refCast<const processorPolyPatch>(patch);
|
refCast<const processorPolyPatch>(patch);
|
||||||
|
|
||||||
// Allocate buffers
|
// Allocate buffers
|
||||||
label nReceiveFaces;
|
label nReceiveFaces = 0;
|
||||||
labelList receiveFaces(patch.size());
|
labelList receiveFaces(patch.size());
|
||||||
List<Type> receiveFacesInfo(patch.size());
|
List<Type> receiveFacesInfo(patch.size());
|
||||||
|
|
||||||
nReceiveFaces = receivePatchInfo
|
{
|
||||||
|
UIPstream fromNeighbour(procPatch.neighbProcNo(), pBufs);
|
||||||
|
readFaces
|
||||||
(
|
(
|
||||||
procPatch.neighbProcNo(),
|
nReceiveFaces,
|
||||||
receiveFaces,
|
receiveFaces,
|
||||||
receiveFacesInfo
|
receiveFacesInfo,
|
||||||
|
fromNeighbour
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -619,8 +588,7 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
|
|||||||
patch,
|
patch,
|
||||||
nReceiveFaces,
|
nReceiveFaces,
|
||||||
receiveFaces,
|
receiveFaces,
|
||||||
receiveFacesInfo,
|
receiveFacesInfo
|
||||||
procPatch.parallel()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -639,87 +607,42 @@ void Foam::FaceCellWave<Type>::handleCyclicPatches()
|
|||||||
|
|
||||||
if (isA<cyclicPolyPatch>(patch))
|
if (isA<cyclicPolyPatch>(patch))
|
||||||
{
|
{
|
||||||
label halfSize = patch.size()/2;
|
const cyclicPolyPatch& nbrPatch =
|
||||||
|
refCast<const cyclicPolyPatch>(patch).neighbPatch();
|
||||||
|
|
||||||
// Allocate buffers
|
// Allocate buffers
|
||||||
label nSendFaces;
|
|
||||||
labelList sendFaces(halfSize);
|
|
||||||
List<Type> sendFacesInfo(halfSize);
|
|
||||||
|
|
||||||
label nReceiveFaces;
|
label nReceiveFaces;
|
||||||
labelList receiveFaces(halfSize);
|
labelList receiveFaces(patch.size());
|
||||||
List<Type> receiveFacesInfo(halfSize);
|
List<Type> receiveFacesInfo(patch.size());
|
||||||
|
|
||||||
// Half1: Determine which faces changed. Use sendFaces for storage
|
// Determine which faces changed
|
||||||
nSendFaces = getChangedPatchFaces
|
|
||||||
(
|
|
||||||
patch,
|
|
||||||
0,
|
|
||||||
halfSize,
|
|
||||||
sendFaces,
|
|
||||||
sendFacesInfo
|
|
||||||
);
|
|
||||||
|
|
||||||
// Half2: Determine which faces changed. Use receiveFaces_ ,,
|
|
||||||
nReceiveFaces = getChangedPatchFaces
|
nReceiveFaces = getChangedPatchFaces
|
||||||
(
|
(
|
||||||
patch,
|
nbrPatch,
|
||||||
halfSize,
|
0,
|
||||||
halfSize,
|
nbrPatch.size(),
|
||||||
receiveFaces,
|
receiveFaces,
|
||||||
receiveFacesInfo
|
receiveFacesInfo
|
||||||
);
|
);
|
||||||
|
|
||||||
//Info<< "Half1:" << endl;
|
// Adapt wallInfo for leaving domain
|
||||||
//writeFaces(nSendFaces, sendFaces, sendFacesInfo, Info);
|
|
||||||
//Info<< endl;
|
|
||||||
//
|
|
||||||
//Info<< "Half2:" << endl;
|
|
||||||
//writeFaces(nReceiveFaces, receiveFaces, receiveFacesInfo, Info);
|
|
||||||
//Info<< endl;
|
|
||||||
|
|
||||||
|
|
||||||
// Half1: Adapt wallInfo for leaving domain
|
|
||||||
leaveDomain
|
leaveDomain
|
||||||
(
|
(
|
||||||
patch,
|
nbrPatch,
|
||||||
nSendFaces,
|
|
||||||
sendFaces,
|
|
||||||
sendFacesInfo
|
|
||||||
);
|
|
||||||
// Half2: Adapt wallInfo for leaving domain
|
|
||||||
leaveDomain
|
|
||||||
(
|
|
||||||
patch,
|
|
||||||
nReceiveFaces,
|
nReceiveFaces,
|
||||||
receiveFaces,
|
receiveFaces,
|
||||||
receiveFacesInfo
|
receiveFacesInfo
|
||||||
);
|
);
|
||||||
|
|
||||||
// Half1: 'transfer' to other side by offsetting patchFaceI
|
|
||||||
offset(patch, halfSize, nSendFaces, sendFaces);
|
|
||||||
|
|
||||||
// Half2: 'transfer' to other side
|
|
||||||
offset(patch, -halfSize, nReceiveFaces, receiveFaces);
|
|
||||||
|
|
||||||
// Apply rotation for non-parallel planes
|
|
||||||
const cyclicPolyPatch& cycPatch =
|
const cyclicPolyPatch& cycPatch =
|
||||||
refCast<const cyclicPolyPatch>(patch);
|
refCast<const cyclicPolyPatch>(patch);
|
||||||
|
|
||||||
if (!cycPatch.parallel())
|
if (!cycPatch.parallel())
|
||||||
{
|
{
|
||||||
// sendFaces = received data from half1
|
// received data from other half
|
||||||
transform
|
transform
|
||||||
(
|
(
|
||||||
cycPatch.forwardT(),
|
cycPatch.forwardT(),
|
||||||
nSendFaces,
|
|
||||||
sendFacesInfo
|
|
||||||
);
|
|
||||||
|
|
||||||
// receiveFaces = received data from half2
|
|
||||||
transform
|
|
||||||
(
|
|
||||||
cycPatch.reverseT(),
|
|
||||||
nReceiveFaces,
|
nReceiveFaces,
|
||||||
receiveFacesInfo
|
receiveFacesInfo
|
||||||
);
|
);
|
||||||
@ -727,25 +650,15 @@ void Foam::FaceCellWave<Type>::handleCyclicPatches()
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< " Cyclic patch " << patchI << ' ' << patch.name()
|
Pout<< " Cyclic patch " << patchI << ' ' << cycPatch.name()
|
||||||
<< " Changed on first half : " << nSendFaces
|
<< " Changed : " << nReceiveFaces
|
||||||
<< " Changed on second half : " << nReceiveFaces
|
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Half1: Adapt wallInfo for entering domain
|
|
||||||
enterDomain
|
|
||||||
(
|
|
||||||
patch,
|
|
||||||
nSendFaces,
|
|
||||||
sendFaces,
|
|
||||||
sendFacesInfo
|
|
||||||
);
|
|
||||||
|
|
||||||
// Half2: Adapt wallInfo for entering domain
|
// Half2: Adapt wallInfo for entering domain
|
||||||
enterDomain
|
enterDomain
|
||||||
(
|
(
|
||||||
patch,
|
cycPatch,
|
||||||
nReceiveFaces,
|
nReceiveFaces,
|
||||||
receiveFaces,
|
receiveFaces,
|
||||||
receiveFacesInfo
|
receiveFacesInfo
|
||||||
@ -754,25 +667,15 @@ void Foam::FaceCellWave<Type>::handleCyclicPatches()
|
|||||||
// Merge into global storage
|
// Merge into global storage
|
||||||
mergeFaceInfo
|
mergeFaceInfo
|
||||||
(
|
(
|
||||||
patch,
|
cycPatch,
|
||||||
nSendFaces,
|
|
||||||
sendFaces,
|
|
||||||
sendFacesInfo,
|
|
||||||
cycPatch.parallel()
|
|
||||||
);
|
|
||||||
// Merge into global storage
|
|
||||||
mergeFaceInfo
|
|
||||||
(
|
|
||||||
patch,
|
|
||||||
nReceiveFaces,
|
nReceiveFaces,
|
||||||
receiveFaces,
|
receiveFaces,
|
||||||
receiveFacesInfo,
|
receiveFacesInfo
|
||||||
cycPatch.parallel()
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
checkCyclic(patch);
|
checkCyclic(cycPatch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -193,8 +193,7 @@ class FaceCellWave
|
|||||||
const polyPatch& patch,
|
const polyPatch& patch,
|
||||||
const label nFaces,
|
const label nFaces,
|
||||||
const labelList&,
|
const labelList&,
|
||||||
const List<Type>&,
|
const List<Type>&
|
||||||
const bool isParallel
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Extract info for single patch only
|
//- Extract info for single patch only
|
||||||
@ -225,23 +224,6 @@ class FaceCellWave
|
|||||||
List<Type>& faceInfo
|
List<Type>& faceInfo
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Send info to neighbour
|
|
||||||
void sendPatchInfo
|
|
||||||
(
|
|
||||||
const label neighbour,
|
|
||||||
const label nFaces,
|
|
||||||
const labelList&,
|
|
||||||
const List<Type>&
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Receive info from neighbour. Returns number of faces received.
|
|
||||||
label receivePatchInfo
|
|
||||||
(
|
|
||||||
const label neighbour,
|
|
||||||
labelList&,
|
|
||||||
List<Type>&
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Offset face labels by constant value
|
//- Offset face labels by constant value
|
||||||
static void offset
|
static void offset
|
||||||
(
|
(
|
||||||
|
|||||||
@ -109,7 +109,6 @@ struct HashTableCore
|
|||||||
{
|
{
|
||||||
return iteratorEnd();
|
return iteratorEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -139,6 +138,7 @@ class HashTable
|
|||||||
//- Construct from key, next pointer and object
|
//- Construct from key, next pointer and object
|
||||||
inline hashedEntry(const Key&, hashedEntry* next, const T&);
|
inline hashedEntry(const Key&, hashedEntry* next, const T&);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
hashedEntry(const hashedEntry&);
|
hashedEntry(const hashedEntry&);
|
||||||
@ -209,8 +209,7 @@ public:
|
|||||||
HashTable(const Xfer<HashTable<T, Key, Hash> >&);
|
HashTable(const Xfer<HashTable<T, Key, Hash> >&);
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
//- Destructor
|
||||||
|
|
||||||
~HashTable();
|
~HashTable();
|
||||||
|
|
||||||
|
|
||||||
@ -247,6 +246,7 @@ public:
|
|||||||
//- Print information
|
//- Print information
|
||||||
Ostream& printInfo(Ostream&) const;
|
Ostream& printInfo(Ostream&) const;
|
||||||
|
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
|
|
||||||
//- Insert a new hashedEntry
|
//- Insert a new hashedEntry
|
||||||
@ -356,9 +356,8 @@ public:
|
|||||||
//- Current hash index
|
//- Current hash index
|
||||||
label hashIndex_;
|
label hashIndex_;
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Protected Member Functions
|
protected:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
@ -380,6 +379,8 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Increment to the next position
|
//- Increment to the next position
|
||||||
inline void increment();
|
inline void increment();
|
||||||
|
|
||||||
@ -392,6 +393,7 @@ public:
|
|||||||
//- Return const access to referenced object
|
//- Return const access to referenced object
|
||||||
inline const T& cobject() const;
|
inline const T& cobject() const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Member operators
|
// Member operators
|
||||||
@ -434,6 +436,7 @@ public:
|
|||||||
const label hashIndex
|
const label hashIndex
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
@ -444,13 +447,12 @@ public:
|
|||||||
//- Construct end iterator
|
//- Construct end iterator
|
||||||
inline iterator(const iteratorEnd& unused);
|
inline iterator(const iteratorEnd& unused);
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
// Member operators
|
||||||
|
|
||||||
//- Conversion to a const_iterator
|
//- Conversion to a const_iterator
|
||||||
inline operator const_iterator() const;
|
inline operator const_iterator() const;
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
//- Return referenced hash value
|
//- Return referenced hash value
|
||||||
inline T& operator*();
|
inline T& operator*();
|
||||||
inline T& operator()();
|
inline T& operator()();
|
||||||
@ -492,6 +494,7 @@ public:
|
|||||||
const label hashIndex
|
const label hashIndex
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
@ -502,9 +505,8 @@ public:
|
|||||||
//- Construct end iterator
|
//- Construct end iterator
|
||||||
inline const_iterator(const iteratorEnd& unused);
|
inline const_iterator(const iteratorEnd& unused);
|
||||||
|
|
||||||
// Member operators
|
|
||||||
|
|
||||||
// Access
|
// Member operators
|
||||||
|
|
||||||
//- Return referenced hash value
|
//- Return referenced hash value
|
||||||
inline const T& operator*() const;
|
inline const T& operator*() const;
|
||||||
@ -536,7 +538,6 @@ public:
|
|||||||
Ostream&,
|
Ostream&,
|
||||||
const HashTable<T, Key, Hash>&
|
const HashTable<T, Key, Hash>&
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -97,7 +97,6 @@ Foam::StaticHashTable<T, Key, Hash>::StaticHashTable
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<class T, class Key, class Hash>
|
template<class T, class Key, class Hash>
|
||||||
Foam::StaticHashTable<T, Key, Hash>::StaticHashTable
|
Foam::StaticHashTable<T, Key, Hash>::StaticHashTable
|
||||||
(
|
(
|
||||||
@ -452,7 +451,6 @@ void Foam::StaticHashTable<T, Key, Hash>::clearStorage()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<class T, class Key, class Hash>
|
template<class T, class Key, class Hash>
|
||||||
void Foam::StaticHashTable<T, Key, Hash>::transfer
|
void Foam::StaticHashTable<T, Key, Hash>::transfer
|
||||||
(
|
(
|
||||||
|
|||||||
@ -72,10 +72,6 @@ template<class T, class Key, class Hash> Ostream& operator<<
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class StaticHashTableName Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class StaticHashTableCore Declaration
|
Class StaticHashTableCore Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -100,7 +96,6 @@ struct StaticHashTableCore
|
|||||||
iteratorEnd()
|
iteratorEnd()
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -135,6 +130,7 @@ class StaticHashTable
|
|||||||
//- Assign a new hashed entry to a possibly already existing key
|
//- Assign a new hashed entry to a possibly already existing key
|
||||||
bool set(const Key&, const T& newElmt, bool protect);
|
bool set(const Key&, const T& newElmt, bool protect);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
@ -185,8 +181,8 @@ public:
|
|||||||
//- Construct by transferring the parameter contents
|
//- Construct by transferring the parameter contents
|
||||||
StaticHashTable(const Xfer<StaticHashTable<T, Key, Hash> >&);
|
StaticHashTable(const Xfer<StaticHashTable<T, Key, Hash> >&);
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
~StaticHashTable();
|
~StaticHashTable();
|
||||||
|
|
||||||
|
|
||||||
@ -275,6 +271,7 @@ public:
|
|||||||
//- The opposite of the equality operation.
|
//- The opposite of the equality operation.
|
||||||
bool operator!=(const StaticHashTable<T, Key, Hash>&) const;
|
bool operator!=(const StaticHashTable<T, Key, Hash>&) const;
|
||||||
|
|
||||||
|
|
||||||
// STL type definitions
|
// STL type definitions
|
||||||
|
|
||||||
//- Type of values the StaticHashTable contains.
|
//- Type of values the StaticHashTable contains.
|
||||||
@ -317,6 +314,7 @@ public:
|
|||||||
//- Index of current element at hashIndex
|
//- Index of current element at hashIndex
|
||||||
label elemIndex_;
|
label elemIndex_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|||||||
@ -417,6 +417,4 @@ Foam::StaticHashTable<T, Key, Hash>::end() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -224,7 +224,7 @@ inline Foam::UList<T> Foam::CompactListList<T, Container>::operator[]
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
label start = offsets_[i];
|
label start = offsets_[i];
|
||||||
return UList<T>(&m_[start], offsets_[i+1] - start);
|
return UList<T>((m_.size() ? &m_[start] : NULL), offsets_[i+1] - start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -238,7 +238,7 @@ Foam::CompactListList<T, Container>::operator[]
|
|||||||
label start = offsets_[i];
|
label start = offsets_[i];
|
||||||
return UList<T>
|
return UList<T>
|
||||||
(
|
(
|
||||||
const_cast<T*>(&m_[start]),
|
(m_.size() ? const_cast<T*>(&m_[start]) : NULL),
|
||||||
offsets_[i+1] - start
|
offsets_[i+1] - start
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,7 +84,6 @@ class DynamicList
|
|||||||
//- The capacity (allocated size) of the underlying list.
|
//- The capacity (allocated size) of the underlying list.
|
||||||
label capacity_;
|
label capacity_;
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -93,6 +92,7 @@ public:
|
|||||||
//- Declare friendship with the List class
|
//- Declare friendship with the List class
|
||||||
friend class List<T>;
|
friend class List<T>;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct null
|
||||||
@ -178,6 +178,7 @@ public:
|
|||||||
//- Transfer contents to the Xfer container as a plain List
|
//- Transfer contents to the Xfer container as a plain List
|
||||||
inline Xfer<List<T> > xfer();
|
inline Xfer<List<T> > xfer();
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
// Member Operators
|
||||||
|
|
||||||
//- Append an element at the end of the list
|
//- Append an element at the end of the list
|
||||||
@ -207,6 +208,7 @@ public:
|
|||||||
//- Assignment from UList
|
//- Assignment from UList
|
||||||
inline void operator=(const UList<T>&);
|
inline void operator=(const UList<T>&);
|
||||||
|
|
||||||
|
|
||||||
// IOstream operators
|
// IOstream operators
|
||||||
|
|
||||||
// Write DynamicList to Ostream.
|
// Write DynamicList to Ostream.
|
||||||
|
|||||||
@ -66,6 +66,7 @@ public:
|
|||||||
//- Construct given the complete list and by transferring addressing
|
//- Construct given the complete list and by transferring addressing
|
||||||
inline IndirectList(const UList<T>&, const Xfer<List<label> >&);
|
inline IndirectList(const UList<T>&, const Xfer<List<label> >&);
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
@ -94,6 +95,7 @@ public:
|
|||||||
//- Return the list addressing
|
//- Return the list addressing
|
||||||
inline const List<label>& addressing() const;
|
inline const List<label>& addressing() const;
|
||||||
|
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
|
|
||||||
//- Reset addressing
|
//- Reset addressing
|
||||||
|
|||||||
@ -38,7 +38,8 @@ Foam::IPstream::IPstream
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
Pstream(commsType, bufSize),
|
Pstream(commsType, bufSize),
|
||||||
UIPstream(commsType, fromProcNo, buf_)
|
UIPstream(commsType, fromProcNo, buf_, externalBufPosition_),
|
||||||
|
externalBufPosition_(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -55,6 +55,9 @@ class IPstream
|
|||||||
public UIPstream
|
public UIPstream
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//- Receive index
|
||||||
|
label externalBufPosition_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|||||||
@ -51,10 +51,31 @@ Foam::PstreamBuffers::PstreamBuffers
|
|||||||
version_(version),
|
version_(version),
|
||||||
sendBuf_(UPstream::nProcs()),
|
sendBuf_(UPstream::nProcs()),
|
||||||
recvBuf_(UPstream::nProcs()),
|
recvBuf_(UPstream::nProcs()),
|
||||||
|
recvBufPos_(UPstream::nProcs(), 0),
|
||||||
finishedSendsCalled_(false)
|
finishedSendsCalled_(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::PstreamBuffers::~PstreamBuffers()
|
||||||
|
{
|
||||||
|
// Check that all data has been consumed.
|
||||||
|
forAll(recvBufPos_, procI)
|
||||||
|
{
|
||||||
|
if (recvBufPos_[procI] < recvBuf_[procI].size())
|
||||||
|
{
|
||||||
|
FatalErrorIn("PstreamBuffers::~PstreamBuffers()")
|
||||||
|
<< "Message from processor " << procI
|
||||||
|
<< " not fully consumed. messageSize:" << recvBuf_[procI].size()
|
||||||
|
<< " bytes of which only " << recvBufPos_[procI]
|
||||||
|
<< " consumed."
|
||||||
|
<< Foam::abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::PstreamBuffers::finishedSends(const bool block)
|
void Foam::PstreamBuffers::finishedSends(const bool block)
|
||||||
|
|||||||
@ -106,6 +106,9 @@ class PstreamBuffers
|
|||||||
//- receive buffer
|
//- receive buffer
|
||||||
List<DynamicList<char> > recvBuf_;
|
List<DynamicList<char> > recvBuf_;
|
||||||
|
|
||||||
|
//- read position in recvBuf_
|
||||||
|
labelList recvBufPos_;
|
||||||
|
|
||||||
bool finishedSendsCalled_;
|
bool finishedSendsCalled_;
|
||||||
|
|
||||||
// Private member functions
|
// Private member functions
|
||||||
@ -129,6 +132,10 @@ public:
|
|||||||
IOstream::versionNumber version=IOstream::currentVersion
|
IOstream::versionNumber version=IOstream::currentVersion
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
|
||||||
|
~PstreamBuffers();
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
|
|||||||
@ -77,20 +77,6 @@ inline void Foam::UIPstream::readFromBuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::UIPstream::~UIPstream()
|
|
||||||
{
|
|
||||||
if (externalBufPosition_ < messageSize_)
|
|
||||||
{
|
|
||||||
FatalErrorIn("UIPstream::~UIPstream()")
|
|
||||||
<< "Message not fully consumed. messageSize:" << messageSize_
|
|
||||||
<< " bytes of which only " << externalBufPosition_
|
|
||||||
<< " consumed." << Foam::abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::Istream& Foam::UIPstream::read(token& t)
|
Foam::Istream& Foam::UIPstream::read(token& t)
|
||||||
|
|||||||
@ -63,7 +63,7 @@ class UIPstream
|
|||||||
|
|
||||||
DynamicList<char>& externalBuf_;
|
DynamicList<char>& externalBuf_;
|
||||||
|
|
||||||
label externalBufPosition_;
|
label& externalBufPosition_;
|
||||||
|
|
||||||
const int tag_;
|
const int tag_;
|
||||||
|
|
||||||
@ -94,6 +94,7 @@ public:
|
|||||||
const commsTypes commsType,
|
const commsTypes commsType,
|
||||||
const int fromProcNo,
|
const int fromProcNo,
|
||||||
DynamicList<char>& externalBuf,
|
DynamicList<char>& externalBuf,
|
||||||
|
label& externalBufPosition,
|
||||||
const int tag = UPstream::msgType(),
|
const int tag = UPstream::msgType(),
|
||||||
streamFormat format=BINARY,
|
streamFormat format=BINARY,
|
||||||
versionNumber version=currentVersion
|
versionNumber version=currentVersion
|
||||||
@ -103,11 +104,6 @@ public:
|
|||||||
UIPstream(const int fromProcNo, PstreamBuffers&);
|
UIPstream(const int fromProcNo, PstreamBuffers&);
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
|
||||||
~UIPstream();
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
// Inquiry
|
// Inquiry
|
||||||
|
|||||||
@ -220,6 +220,30 @@ Foam::List<int> Foam::UPstream::procIDs_(1, 0);
|
|||||||
// Standard transfer message type
|
// Standard transfer message type
|
||||||
int Foam::UPstream::msgType_(1);
|
int Foam::UPstream::msgType_(1);
|
||||||
|
|
||||||
|
// New message type
|
||||||
|
int Foam::UPstream::freeTag_(msgType()+1);
|
||||||
|
|
||||||
|
// Free'd message types
|
||||||
|
Foam::LIFOStack<int> Foam::UPstream::freedTags_;
|
||||||
|
|
||||||
|
int Foam::UPstream::allocateTag()
|
||||||
|
{
|
||||||
|
if (freedTags_.empty())
|
||||||
|
{
|
||||||
|
return freeTag_++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return freedTags_.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Foam::UPstream::freeTag(const int tag)
|
||||||
|
{
|
||||||
|
freedTags_.push(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Linear communication schedule
|
// Linear communication schedule
|
||||||
Foam::List<Foam::UPstream::commsStruct> Foam::UPstream::linearCommunication_(0);
|
Foam::List<Foam::UPstream::commsStruct> Foam::UPstream::linearCommunication_(0);
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,7 @@ SourceFiles
|
|||||||
#include "HashTable.H"
|
#include "HashTable.H"
|
||||||
#include "string.H"
|
#include "string.H"
|
||||||
#include "NamedEnum.H"
|
#include "NamedEnum.H"
|
||||||
|
#include "LIFOStack.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -191,6 +192,14 @@ private:
|
|||||||
static List<commsStruct> treeCommunication_;
|
static List<commsStruct> treeCommunication_;
|
||||||
|
|
||||||
|
|
||||||
|
//- Current free tag
|
||||||
|
static int freeTag_;
|
||||||
|
|
||||||
|
//- Freed tags
|
||||||
|
static LIFOStack<int> freedTags_;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Private member functions
|
// Private member functions
|
||||||
|
|
||||||
//- Set data for parallel running
|
//- Set data for parallel running
|
||||||
@ -340,6 +349,11 @@ public:
|
|||||||
{
|
{
|
||||||
return msgType_;
|
return msgType_;
|
||||||
}
|
}
|
||||||
|
//- Allocate new tag
|
||||||
|
static int allocateTag();
|
||||||
|
|
||||||
|
//- Release allocated tag
|
||||||
|
static void freeTag(const int tag);
|
||||||
|
|
||||||
|
|
||||||
//- Get the communications type of the stream
|
//- Get the communications type of the stream
|
||||||
|
|||||||
@ -298,7 +298,11 @@ evaluate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Block for any outstanding requests
|
// Block for any outstanding requests
|
||||||
if (Pstream::defaultCommsType == Pstream::nonBlocking)
|
if
|
||||||
|
(
|
||||||
|
Pstream::parRun()
|
||||||
|
&& Pstream::defaultCommsType == Pstream::nonBlocking
|
||||||
|
)
|
||||||
{
|
{
|
||||||
Pstream::waitRequests();
|
Pstream::waitRequests();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -108,7 +108,8 @@ void processorPointPatchField<Type>::initSwapAdd(Field<Type>& pField) const
|
|||||||
Pstream::blocking,
|
Pstream::blocking,
|
||||||
procPatch_.neighbProcNo(),
|
procPatch_.neighbProcNo(),
|
||||||
reinterpret_cast<const char*>(pf.begin()),
|
reinterpret_cast<const char*>(pf.begin()),
|
||||||
pf.byteSize()
|
pf.byteSize(),
|
||||||
|
procPatch_.tag()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -126,7 +127,8 @@ void processorPointPatchField<Type>::swapAdd(Field<Type>& pField) const
|
|||||||
Pstream::blocking,
|
Pstream::blocking,
|
||||||
procPatch_.neighbProcNo(),
|
procPatch_.neighbProcNo(),
|
||||||
reinterpret_cast<char*>(pnf.begin()),
|
reinterpret_cast<char*>(pnf.begin()),
|
||||||
pnf.byteSize()
|
pnf.byteSize(),
|
||||||
|
procPatch_.tag()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (doTransform())
|
if (doTransform())
|
||||||
|
|||||||
@ -109,7 +109,8 @@ const
|
|||||||
Pstream::blocking,
|
Pstream::blocking,
|
||||||
procPatch_.neighbProcNo(),
|
procPatch_.neighbProcNo(),
|
||||||
reinterpret_cast<const char*>(pf.begin()),
|
reinterpret_cast<const char*>(pf.begin()),
|
||||||
pf.byteSize()
|
pf.byteSize(),
|
||||||
|
procPatch_.tag()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,7 +128,8 @@ void processorCyclicPointPatchField<Type>::swapAdd(Field<Type>& pField) const
|
|||||||
Pstream::blocking,
|
Pstream::blocking,
|
||||||
procPatch_.neighbProcNo(),
|
procPatch_.neighbProcNo(),
|
||||||
reinterpret_cast<char*>(pnf.begin()),
|
reinterpret_cast<char*>(pnf.begin()),
|
||||||
pnf.byteSize()
|
pnf.byteSize(),
|
||||||
|
procPatch_.tag()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (doTransform())
|
if (doTransform())
|
||||||
|
|||||||
@ -33,8 +33,7 @@ Description
|
|||||||
#ifndef parRun_H
|
#ifndef parRun_H
|
||||||
#define parRun_H
|
#define parRun_H
|
||||||
|
|
||||||
#include "OPstream.H"
|
#include "Pstream.H"
|
||||||
#include "IPstream.H"
|
|
||||||
#include "IOstreams.H"
|
#include "IOstreams.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -95,6 +95,9 @@ public:
|
|||||||
//- Return face transformation tensor
|
//- Return face transformation tensor
|
||||||
virtual const tensor& forwardT() const = 0;
|
virtual const tensor& forwardT() const = 0;
|
||||||
|
|
||||||
|
//- Return message tag used for sending
|
||||||
|
virtual int tag() const = 0;
|
||||||
|
|
||||||
// //- Set send buffer to sufficient size to hold List<Type>(nElems).
|
// //- Set send buffer to sufficient size to hold List<Type>(nElems).
|
||||||
// // Returns reference to buffer (note:buffer.size() is number
|
// // Returns reference to buffer (note:buffer.size() is number
|
||||||
// // of characters, not nElems)
|
// // of characters, not nElems)
|
||||||
|
|||||||
@ -87,7 +87,8 @@ void Foam::processorLduInterface::send
|
|||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
reinterpret_cast<const char*>(f.begin()),
|
reinterpret_cast<const char*>(f.begin()),
|
||||||
f.byteSize()
|
f.byteSize(),
|
||||||
|
tag()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (commsType == Pstream::nonBlocking)
|
else if (commsType == Pstream::nonBlocking)
|
||||||
@ -100,7 +101,8 @@ void Foam::processorLduInterface::send
|
|||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
receiveBuf_.begin(),
|
receiveBuf_.begin(),
|
||||||
receiveBuf_.size()
|
receiveBuf_.size(),
|
||||||
|
tag()
|
||||||
);
|
);
|
||||||
|
|
||||||
//setSendBuf<Type>(f.size());
|
//setSendBuf<Type>(f.size());
|
||||||
@ -112,7 +114,8 @@ void Foam::processorLduInterface::send
|
|||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
sendBuf_.begin(),
|
sendBuf_.begin(),
|
||||||
f.byteSize()
|
f.byteSize(),
|
||||||
|
tag()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -138,7 +141,8 @@ void Foam::processorLduInterface::receive
|
|||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
reinterpret_cast<char*>(f.begin()),
|
reinterpret_cast<char*>(f.begin()),
|
||||||
f.byteSize()
|
f.byteSize(),
|
||||||
|
tag()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (commsType == Pstream::nonBlocking)
|
else if (commsType == Pstream::nonBlocking)
|
||||||
@ -202,7 +206,8 @@ void Foam::processorLduInterface::compressedSend
|
|||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
sendBuf_.begin(),
|
sendBuf_.begin(),
|
||||||
nBytes
|
nBytes,
|
||||||
|
tag()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (commsType == Pstream::nonBlocking)
|
else if (commsType == Pstream::nonBlocking)
|
||||||
@ -215,7 +220,8 @@ void Foam::processorLduInterface::compressedSend
|
|||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
receiveBuf_.begin(),
|
receiveBuf_.begin(),
|
||||||
receiveBuf_.size()
|
receiveBuf_.size(),
|
||||||
|
tag()
|
||||||
);
|
);
|
||||||
|
|
||||||
OPstream::write
|
OPstream::write
|
||||||
@ -223,7 +229,8 @@ void Foam::processorLduInterface::compressedSend
|
|||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
sendBuf_.begin(),
|
sendBuf_.begin(),
|
||||||
nBytes
|
nBytes,
|
||||||
|
tag()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -264,7 +271,8 @@ void Foam::processorLduInterface::compressedReceive
|
|||||||
commsType,
|
commsType,
|
||||||
neighbProcNo(),
|
neighbProcNo(),
|
||||||
receiveBuf_.begin(),
|
receiveBuf_.begin(),
|
||||||
nBytes
|
nBytes,
|
||||||
|
tag()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (commsType != Pstream::nonBlocking)
|
else if (commsType != Pstream::nonBlocking)
|
||||||
@ -350,7 +358,8 @@ Foam::tmp<Foam::Field<Type> > Foam::processorLduInterface::compressedReceive
|
|||||||
// commsType,
|
// commsType,
|
||||||
// neighbProcNo(),
|
// neighbProcNo(),
|
||||||
// sendBuf_.begin(),
|
// sendBuf_.begin(),
|
||||||
// sendBuf_.size()
|
// sendBuf_.size(),
|
||||||
|
// tag()
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
// else if (commsType == Pstream::nonBlocking)
|
// else if (commsType == Pstream::nonBlocking)
|
||||||
@ -362,7 +371,8 @@ Foam::tmp<Foam::Field<Type> > Foam::processorLduInterface::compressedReceive
|
|||||||
// commsType,
|
// commsType,
|
||||||
// neighbProcNo(),
|
// neighbProcNo(),
|
||||||
// receiveBuf_.begin(),
|
// receiveBuf_.begin(),
|
||||||
// receiveBuf_.size()
|
// receiveBuf_.size(),
|
||||||
|
// tag()
|
||||||
// );
|
// );
|
||||||
//
|
//
|
||||||
// OPstream::write
|
// OPstream::write
|
||||||
@ -370,7 +380,8 @@ Foam::tmp<Foam::Field<Type> > Foam::processorLduInterface::compressedReceive
|
|||||||
// commsType,
|
// commsType,
|
||||||
// neighbProcNo(),
|
// neighbProcNo(),
|
||||||
// sendBuf_.begin(),
|
// sendBuf_.begin(),
|
||||||
// sendBuf_.size()
|
// sendBuf_.size(),
|
||||||
|
// tag()
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
@ -405,7 +416,8 @@ Foam::tmp<Foam::Field<Type> > Foam::processorLduInterface::compressedReceive
|
|||||||
// commsType,
|
// commsType,
|
||||||
// neighbProcNo(),
|
// neighbProcNo(),
|
||||||
// receiveBuf_.begin(),
|
// receiveBuf_.begin(),
|
||||||
// receiveBuf_.size()
|
// receiveBuf_.size(),
|
||||||
|
// tag()
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
// else if (commsType != Pstream::nonBlocking)
|
// else if (commsType != Pstream::nonBlocking)
|
||||||
@ -441,7 +453,8 @@ Foam::tmp<Foam::Field<Type> > Foam::processorLduInterface::compressedReceive
|
|||||||
// commsType,
|
// commsType,
|
||||||
// neighbProcNo(),
|
// neighbProcNo(),
|
||||||
// receiveBuf_.begin(),
|
// receiveBuf_.begin(),
|
||||||
// receiveBuf_.size()
|
// receiveBuf_.size(),
|
||||||
|
// tag()
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
// else if (commsType != Pstream::nonBlocking)
|
// else if (commsType != Pstream::nonBlocking)
|
||||||
|
|||||||
@ -112,10 +112,13 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Block until all sends/receives have been finished
|
// Block until all sends/receives have been finished
|
||||||
if (Pstream::defaultCommsType == Pstream::nonBlocking)
|
if
|
||||||
|
(
|
||||||
|
Pstream::parRun()
|
||||||
|
&& Pstream::defaultCommsType == Pstream::nonBlocking
|
||||||
|
)
|
||||||
{
|
{
|
||||||
IPstream::waitRequests();
|
UPstream::waitRequests();
|
||||||
OPstream::waitRequests();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll (interfaces, interfaceI)
|
forAll (interfaces, interfaceI)
|
||||||
|
|||||||
@ -81,20 +81,13 @@ void Foam::cyclicGAMGInterfaceField::updateInterfaceMatrix
|
|||||||
const Pstream::commsTypes
|
const Pstream::commsTypes
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
scalarField pnf(size());
|
// 'send' neighbouring field
|
||||||
|
scalarField pnf(cyclicInterface_.interfaceInternalField(psiInternal)());
|
||||||
label sizeby2 = size()/2;
|
|
||||||
|
|
||||||
const unallocLabelList& faceCells = cyclicInterface_.faceCells();
|
|
||||||
|
|
||||||
for (label facei=0; facei<sizeby2; facei++)
|
|
||||||
{
|
|
||||||
pnf[facei] = psiInternal[faceCells[facei + sizeby2]];
|
|
||||||
pnf[facei + sizeby2] = psiInternal[faceCells[facei]];
|
|
||||||
}
|
|
||||||
|
|
||||||
transformCoupleField(pnf, cmpt);
|
transformCoupleField(pnf, cmpt);
|
||||||
|
|
||||||
|
const unallocLabelList& faceCells = cyclicInterface_.faceCells();
|
||||||
|
|
||||||
forAll(faceCells, elemI)
|
forAll(faceCells, elemI)
|
||||||
{
|
{
|
||||||
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
|
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
|
||||||
|
|||||||
@ -136,6 +136,12 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return message tag to use for communication
|
||||||
|
virtual int tag() const
|
||||||
|
{
|
||||||
|
return procPolyPatch_.tag();
|
||||||
|
}
|
||||||
|
|
||||||
//- Return processor number
|
//- Return processor number
|
||||||
int myProcNo() const
|
int myProcNo() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -382,7 +382,8 @@ processorCyclicPointPatch::processorCyclicPointPatch
|
|||||||
const pointBoundaryMesh& bm
|
const pointBoundaryMesh& bm
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
processorPointPatch(patch, bm)
|
processorPointPatch(patch, bm),
|
||||||
|
procCycPolyPatch_(refCast<const processorCyclicPolyPatch>(patch))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -60,6 +60,9 @@ class processorCyclicPointPatch
|
|||||||
:
|
:
|
||||||
public processorPointPatch
|
public processorPointPatch
|
||||||
{
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
const processorCyclicPolyPatch& procCycPolyPatch_;
|
||||||
|
|
||||||
//- Disallow default construct as copy
|
//- Disallow default construct as copy
|
||||||
processorCyclicPointPatch(const processorCyclicPointPatch&);
|
processorCyclicPointPatch(const processorCyclicPointPatch&);
|
||||||
@ -90,6 +93,13 @@ public:
|
|||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
|
|
||||||
|
//- Return message tag to use for communication
|
||||||
|
virtual int tag() const
|
||||||
|
{
|
||||||
|
return procCycPolyPatch_.tag();
|
||||||
|
}
|
||||||
|
|
||||||
// //- Return true if running parallel
|
// //- Return true if running parallel
|
||||||
// virtual bool coupled() const
|
// virtual bool coupled() const
|
||||||
// {
|
// {
|
||||||
|
|||||||
@ -78,34 +78,38 @@ void Foam::globalMeshData::initProcAddr()
|
|||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
// Send indices of my processor patches to my neighbours
|
// Send indices of my processor patches to my neighbours
|
||||||
forAll (processorPatches_, i)
|
forAll (processorPatches_, i)
|
||||||
{
|
{
|
||||||
label patchi = processorPatches_[i];
|
label patchi = processorPatches_[i];
|
||||||
|
|
||||||
OPstream toNeighbour
|
UOPstream toNeighbour
|
||||||
(
|
(
|
||||||
Pstream::blocking,
|
|
||||||
refCast<const processorPolyPatch>
|
refCast<const processorPolyPatch>
|
||||||
(
|
(
|
||||||
mesh_.boundaryMesh()[patchi]
|
mesh_.boundaryMesh()[patchi]
|
||||||
).neighbProcNo()
|
).neighbProcNo(),
|
||||||
|
pBufs
|
||||||
);
|
);
|
||||||
|
|
||||||
toNeighbour << processorPatchIndices_[patchi];
|
toNeighbour << processorPatchIndices_[patchi];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
forAll(processorPatches_, i)
|
forAll(processorPatches_, i)
|
||||||
{
|
{
|
||||||
label patchi = processorPatches_[i];
|
label patchi = processorPatches_[i];
|
||||||
|
|
||||||
IPstream fromNeighbour
|
UIPstream fromNeighbour
|
||||||
(
|
(
|
||||||
Pstream::blocking,
|
|
||||||
refCast<const processorPolyPatch>
|
refCast<const processorPolyPatch>
|
||||||
(
|
(
|
||||||
mesh_.boundaryMesh()[patchi]
|
mesh_.boundaryMesh()[patchi]
|
||||||
).neighbProcNo()
|
).neighbProcNo(),
|
||||||
|
pBufs
|
||||||
);
|
);
|
||||||
|
|
||||||
fromNeighbour >> processorPatchNeighbours_[patchi];
|
fromNeighbour >> processorPatchNeighbours_[patchi];
|
||||||
@ -1560,6 +1564,8 @@ void Foam::globalMeshData::updateMesh()
|
|||||||
pointStatus.set(meshPointI, SHARED);
|
pointStatus.set(meshPointI, SHARED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
// Send patch local points
|
// Send patch local points
|
||||||
forAll(processorPatches_, i)
|
forAll(processorPatches_, i)
|
||||||
{
|
{
|
||||||
@ -1568,11 +1574,13 @@ void Foam::globalMeshData::updateMesh()
|
|||||||
const processorPolyPatch& procPatch =
|
const processorPolyPatch& procPatch =
|
||||||
refCast<const processorPolyPatch>(mesh_.boundaryMesh()[patchI]);
|
refCast<const processorPolyPatch>(mesh_.boundaryMesh()[patchI]);
|
||||||
|
|
||||||
OPstream toNeighbour(Pstream::blocking, procPatch.neighbProcNo());
|
UOPstream toNeighbour(procPatch.neighbProcNo(), pBufs);
|
||||||
|
|
||||||
toNeighbour << procPatch.localPoints();
|
toNeighbour << procPatch.localPoints();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
// Receive patch local points and uncount if coincident (and not shared)
|
// Receive patch local points and uncount if coincident (and not shared)
|
||||||
forAll(processorPatches_, i)
|
forAll(processorPatches_, i)
|
||||||
{
|
{
|
||||||
@ -1581,7 +1589,7 @@ void Foam::globalMeshData::updateMesh()
|
|||||||
const processorPolyPatch& procPatch =
|
const processorPolyPatch& procPatch =
|
||||||
refCast<const processorPolyPatch>(mesh_.boundaryMesh()[patchI]);
|
refCast<const processorPolyPatch>(mesh_.boundaryMesh()[patchI]);
|
||||||
|
|
||||||
IPstream fromNeighbour(Pstream::blocking, procPatch.neighbProcNo());
|
UIPstream fromNeighbour(procPatch.neighbProcNo(), pBufs);
|
||||||
|
|
||||||
pointField nbrPoints(fromNeighbour);
|
pointField nbrPoints(fromNeighbour);
|
||||||
|
|
||||||
|
|||||||
@ -431,17 +431,16 @@ void Foam::globalPoints::receivePatchPoints
|
|||||||
const cyclicPolyPatch& cycPatch =
|
const cyclicPolyPatch& cycPatch =
|
||||||
refCast<const cyclicPolyPatch>(pp);
|
refCast<const cyclicPolyPatch>(pp);
|
||||||
|
|
||||||
const labelList& meshPoints = pp.meshPoints();
|
const labelList& meshPoints = cycPatch.meshPoints();
|
||||||
|
const labelList coupledMeshPoints(reverseMeshPoints(cycPatch));
|
||||||
|
|
||||||
//const edgeList& connections = cycPatch.coupledPoints();
|
//const edgeList& connections = cycPatch.coupledPoints();
|
||||||
const edgeList connections(coupledPoints(cycPatch));
|
//const edgeList connections(coupledPoints(cycPatch));
|
||||||
|
|
||||||
forAll(connections, i)
|
forAll(meshPoints, i)
|
||||||
{
|
{
|
||||||
const edge& e = connections[i];
|
label meshPointA = meshPoints[i];
|
||||||
|
label meshPointB = coupledMeshPoints[i];
|
||||||
label meshPointA = meshPoints[e[0]];
|
|
||||||
label meshPointB = meshPoints[e[1]];
|
|
||||||
|
|
||||||
label localA = meshToLocalPoint
|
label localA = meshToLocalPoint
|
||||||
(
|
(
|
||||||
@ -823,13 +822,15 @@ void Foam::globalPoints::receiveSharedPoints
|
|||||||
|
|
||||||
// Sync all info.
|
// Sync all info.
|
||||||
//const edgeList& connections = cycPatch.coupledPoints();
|
//const edgeList& connections = cycPatch.coupledPoints();
|
||||||
const edgeList connections(coupledPoints(cycPatch));
|
//const edgeList connections(coupledPoints(cycPatch));
|
||||||
|
|
||||||
forAll(connections, i)
|
const labelList& meshPoints = cycPatch.meshPoints();
|
||||||
|
const labelList coupledMeshPoints(reverseMeshPoints(cycPatch));
|
||||||
|
|
||||||
|
forAll(meshPoints, i)
|
||||||
{
|
{
|
||||||
const edge& e = connections[i];
|
label meshPointA = meshPoints[i];
|
||||||
label meshPointA = pp.meshPoints()[e[0]];
|
label meshPointB = coupledMeshPoints[i];
|
||||||
label meshPointB = pp.meshPoints()[e[1]];
|
|
||||||
|
|
||||||
label localA = meshToLocalPoint
|
label localA = meshToLocalPoint
|
||||||
(
|
(
|
||||||
@ -902,51 +903,25 @@ void Foam::globalPoints::receiveSharedPoints
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::edgeList Foam::globalPoints::coupledPoints(const cyclicPolyPatch& pp)
|
Foam::labelList Foam::globalPoints::reverseMeshPoints
|
||||||
|
(
|
||||||
|
const cyclicPolyPatch& pp
|
||||||
|
)
|
||||||
{
|
{
|
||||||
// Look at cyclic patch as two halves, A and B.
|
const cyclicPolyPatch& nbrPatch = pp.neighbPatch();
|
||||||
// Now all we know is that relative face index in halfA is same
|
|
||||||
// as coupled face in halfB and also that the 0th vertex
|
|
||||||
// corresponds.
|
|
||||||
|
|
||||||
// From halfA point to halfB or -1.
|
faceList masterFaces(nbrPatch.size());
|
||||||
labelList coupledPoint(pp.nPoints(), -1);
|
|
||||||
|
|
||||||
for (label patchFaceA = 0; patchFaceA < pp.size()/2; patchFaceA++)
|
forAll (nbrPatch, faceI)
|
||||||
{
|
{
|
||||||
const face& fA = pp.localFaces()[patchFaceA];
|
masterFaces[faceI] = nbrPatch[faceI].reverseFace();
|
||||||
|
|
||||||
forAll(fA, indexA)
|
|
||||||
{
|
|
||||||
label patchPointA = fA[indexA];
|
|
||||||
|
|
||||||
if (coupledPoint[patchPointA] == -1)
|
|
||||||
{
|
|
||||||
const face& fB = pp.localFaces()[patchFaceA + pp.size()/2];
|
|
||||||
|
|
||||||
label indexB = (fB.size() - indexA) % fB.size();
|
|
||||||
|
|
||||||
coupledPoint[patchPointA] = fB[indexB];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
edgeList connected(pp.nPoints());
|
return primitiveFacePatch
|
||||||
|
(
|
||||||
// Extract coupled points.
|
masterFaces,
|
||||||
label connectedI = 0;
|
nbrPatch.points()
|
||||||
|
).meshPoints();
|
||||||
forAll(coupledPoint, i)
|
|
||||||
{
|
|
||||||
if (coupledPoint[i] != -1)
|
|
||||||
{
|
|
||||||
connected[connectedI++] = edge(i, coupledPoint[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
connected.setSize(connectedI);
|
|
||||||
|
|
||||||
return connected;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -156,9 +156,6 @@ class globalPoints
|
|||||||
// information is collected.
|
// information is collected.
|
||||||
static label countPatchPoints(const polyBoundaryMesh&);
|
static label countPatchPoints(const polyBoundaryMesh&);
|
||||||
|
|
||||||
////- Get all faces on coupled patches
|
|
||||||
//static labelListl coupledFaces(const polyBoundaryMesh&);
|
|
||||||
|
|
||||||
//- Add information about patchPointI in relative indices to send
|
//- Add information about patchPointI in relative indices to send
|
||||||
// buffers (patchFaces, indexInFace etc.)
|
// buffers (patchFaces, indexInFace etc.)
|
||||||
static void addToSend
|
static void addToSend
|
||||||
@ -246,9 +243,8 @@ class globalPoints
|
|||||||
labelList&
|
labelList&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Should move into cyclicPolyPatch ordering problem
|
//- Return mesh points of other side in same order as my meshPoints.
|
||||||
// keeps on giving problems.
|
static labelList reverseMeshPoints(const cyclicPolyPatch&);
|
||||||
static edgeList coupledPoints(const cyclicPolyPatch&);
|
|
||||||
|
|
||||||
//- Do all calculations.
|
//- Do all calculations.
|
||||||
void calculateSharedPoints
|
void calculateSharedPoints
|
||||||
|
|||||||
@ -75,7 +75,7 @@ Foam::List<Foam::labelPair> Foam::mapDistribute::schedule
|
|||||||
slave++
|
slave++
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::blocking, slave);
|
IPstream fromSlave(Pstream::scheduled, slave);
|
||||||
List<labelPair> nbrData(fromSlave);
|
List<labelPair> nbrData(fromSlave);
|
||||||
|
|
||||||
forAll(nbrData, i)
|
forAll(nbrData, i)
|
||||||
@ -96,18 +96,18 @@ Foam::List<Foam::labelPair> Foam::mapDistribute::schedule
|
|||||||
slave++
|
slave++
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
OPstream toSlave(Pstream::blocking, slave);
|
OPstream toSlave(Pstream::scheduled, slave);
|
||||||
toSlave << allComms;
|
toSlave << allComms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
OPstream toMaster(Pstream::blocking, Pstream::masterNo());
|
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
toMaster << allComms;
|
toMaster << allComms;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
|
IPstream fromMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
fromMaster >> allComms;
|
fromMaster >> allComms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -596,6 +596,7 @@ void Foam::mapDistribute::compact(const boolList& elemIsUsed)
|
|||||||
|
|
||||||
// Send elemIsUsed field to neighbour. Use nonblocking code from
|
// Send elemIsUsed field to neighbour. Use nonblocking code from
|
||||||
// mapDistribute but in reverse order.
|
// mapDistribute but in reverse order.
|
||||||
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
List<boolList> sendFields(Pstream::nProcs());
|
List<boolList> sendFields(Pstream::nProcs());
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,30 @@ void Foam::mapDistribute::distribute
|
|||||||
List<T>& field
|
List<T>& field
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (!Pstream::parRun())
|
||||||
|
{
|
||||||
|
// Do only me to me.
|
||||||
|
|
||||||
|
const labelList& mySubMap = subMap[Pstream::myProcNo()];
|
||||||
|
|
||||||
|
List<T> subField(mySubMap.size());
|
||||||
|
forAll(mySubMap, i)
|
||||||
|
{
|
||||||
|
subField[i] = field[mySubMap[i]];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Receive sub field from myself (subField)
|
||||||
|
const labelList& map = constructMap[Pstream::myProcNo()];
|
||||||
|
|
||||||
|
field.setSize(constructSize);
|
||||||
|
|
||||||
|
forAll(map, i)
|
||||||
|
{
|
||||||
|
field[map[i]] = subField[i];
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (commsType == Pstream::blocking)
|
if (commsType == Pstream::blocking)
|
||||||
{
|
{
|
||||||
// Since buffered sending can reuse the field to collect the
|
// Since buffered sending can reuse the field to collect the
|
||||||
@ -407,6 +431,30 @@ void Foam::mapDistribute::distribute
|
|||||||
const T& nullValue
|
const T& nullValue
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (!Pstream::parRun())
|
||||||
|
{
|
||||||
|
// Do only me to me.
|
||||||
|
|
||||||
|
const labelList& mySubMap = subMap[Pstream::myProcNo()];
|
||||||
|
|
||||||
|
List<T> subField(mySubMap.size());
|
||||||
|
forAll(mySubMap, i)
|
||||||
|
{
|
||||||
|
subField[i] = field[mySubMap[i]];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Receive sub field from myself (subField)
|
||||||
|
const labelList& map = constructMap[Pstream::myProcNo()];
|
||||||
|
|
||||||
|
field.setSize(constructSize);
|
||||||
|
|
||||||
|
forAll(map, i)
|
||||||
|
{
|
||||||
|
field[map[i]] = subField[i];
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (commsType == Pstream::blocking)
|
if (commsType == Pstream::blocking)
|
||||||
{
|
{
|
||||||
// Since buffered sending can reuse the field to collect the
|
// Since buffered sending can reuse the field to collect the
|
||||||
|
|||||||
@ -294,13 +294,13 @@ Foam::polyMesh::polyMesh(const IOobject& io)
|
|||||||
// Calculate the geometry for the patches (transformation tensors etc.)
|
// Calculate the geometry for the patches (transformation tensors etc.)
|
||||||
boundary_.calcGeometry();
|
boundary_.calcGeometry();
|
||||||
|
|
||||||
// Warn if global empty mesh (constructs globalData!)
|
// Warn if global empty mesh
|
||||||
if (globalData().nTotalPoints() == 0)
|
if (returnReduce(nPoints(), sumOp<label>()) == 0)
|
||||||
{
|
{
|
||||||
WarningIn("polyMesh(const IOobject&)")
|
WarningIn("polyMesh(const IOobject&)")
|
||||||
<< "no points in mesh" << endl;
|
<< "no points in mesh" << endl;
|
||||||
}
|
}
|
||||||
if (globalData().nTotalCells() == 0)
|
if (returnReduce(nCells(), sumOp<label>()) == 0)
|
||||||
{
|
{
|
||||||
WarningIn("polyMesh(const IOobject&)")
|
WarningIn("polyMesh(const IOobject&)")
|
||||||
<< "no cells in mesh" << endl;
|
<< "no cells in mesh" << endl;
|
||||||
@ -744,8 +744,12 @@ void Foam::polyMesh::resetPrimitives
|
|||||||
// Calculate the geometry for the patches (transformation tensors etc.)
|
// Calculate the geometry for the patches (transformation tensors etc.)
|
||||||
boundary_.calcGeometry();
|
boundary_.calcGeometry();
|
||||||
|
|
||||||
// Warn if global empty mesh (constructs globalData!)
|
// Warn if global empty mesh
|
||||||
if (globalData().nTotalPoints() == 0 || globalData().nTotalCells() == 0)
|
if
|
||||||
|
(
|
||||||
|
(returnReduce(nPoints(), sumOp<label>()) == 0)
|
||||||
|
|| (returnReduce(nCells(), sumOp<label>()) == 0)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
|
|||||||
@ -265,7 +265,8 @@ void Foam::coupledPolyPatch::calcTransformTensors
|
|||||||
Pout<< "coupledPolyPatch::calcTransformTensors : " << name() << endl
|
Pout<< "coupledPolyPatch::calcTransformTensors : " << name() << endl
|
||||||
<< " (half)size:" << Cf.size() << nl
|
<< " (half)size:" << Cf.size() << nl
|
||||||
<< " absTol:" << absTol << nl
|
<< " absTol:" << absTol << nl
|
||||||
//<< " smallDist:" << smallDist << nl
|
<< " smallDist min:" << min(smallDist) << nl
|
||||||
|
<< " smallDist max:" << max(smallDist) << nl
|
||||||
<< " sum(mag(nf & nr)):" << sum(mag(nf & nr)) << endl;
|
<< " sum(mag(nf & nr)):" << sum(mag(nf & nr)) << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,7 +278,7 @@ void Foam::coupledPolyPatch::calcTransformTensors
|
|||||||
// Then the overall error of summing the normals is sqrt(size())*absTol
|
// Then the overall error of summing the normals is sqrt(size())*absTol
|
||||||
// - separation calculation: pass in from the outside an allowable error.
|
// - separation calculation: pass in from the outside an allowable error.
|
||||||
|
|
||||||
if (size() == 0)
|
if (Cf.size() == 0)
|
||||||
{
|
{
|
||||||
// Dummy geometry.
|
// Dummy geometry.
|
||||||
separated = false;
|
separated = false;
|
||||||
|
|||||||
@ -235,6 +235,15 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Does this side own the patch ?
|
||||||
|
virtual bool owner() const = 0;
|
||||||
|
|
||||||
|
//- Does the coupled side own the patch ?
|
||||||
|
virtual bool neighbour() const
|
||||||
|
{
|
||||||
|
return !owner();
|
||||||
|
}
|
||||||
|
|
||||||
//- Transform a patch-based field from other side to this side.
|
//- Transform a patch-based field from other side to this side.
|
||||||
//!! TDB with macros?
|
//!! TDB with macros?
|
||||||
virtual bool doTransform() const = 0;
|
virtual bool doTransform() const = 0;
|
||||||
|
|||||||
@ -175,13 +175,6 @@ void Foam::cyclicPolyPatch::calcTransforms
|
|||||||
const UList<point>& half1Areas
|
const UList<point>& half1Areas
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Pout<< "cyclicPolyPatch::calcTransforms : name:" << name() << endl
|
|
||||||
<< " half0Ctrs:"
|
|
||||||
<< " min:" << min(half0Ctrs) << " max:" << max(half0Ctrs)<< endl
|
|
||||||
<< " half1Ctrs:"
|
|
||||||
<< " min:" << min(half1Ctrs) << " max:" << max(half1Ctrs)<< endl
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
if (half0Ctrs.size() != half1Ctrs.size())
|
if (half0Ctrs.size() != half1Ctrs.size())
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
@ -265,16 +258,6 @@ Pout<< "cyclicPolyPatch::calcTransforms : name:" << name() << endl
|
|||||||
half1Normals,
|
half1Normals,
|
||||||
half0Tols
|
half0Tols
|
||||||
);
|
);
|
||||||
|
|
||||||
Pout<< "cyclicPolyPatch::calcTransforms : calculated transforms for:"
|
|
||||||
<< name() << endl
|
|
||||||
<< " separated_:" << separated_ << endl
|
|
||||||
<< " separation_:" << separation_ << endl
|
|
||||||
<< " parallel_:" << parallel_ << endl
|
|
||||||
<< " forwardT_:" << forwardT_ << endl
|
|
||||||
<< " reverseT_:" << reverseT_ << endl
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,7 +428,7 @@ Foam::label Foam::cyclicPolyPatch::getConsistentRotationFace
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "getConsistentRotationFace(const pointField&)" << nl
|
Pout<< "getConsistentRotationFace(const pointField&)" << nl
|
||||||
<< " rotFace = " << rotFace << nl
|
<< " rotFace = " << rotFace << nl
|
||||||
<< " point = " << faceCentres[rotFace] << endl;
|
<< " point = " << faceCentres[rotFace] << endl;
|
||||||
}
|
}
|
||||||
@ -679,7 +662,7 @@ void Foam::cyclicPolyPatch::calcGeometry
|
|||||||
//polyPatch::calcGeometry();
|
//polyPatch::calcGeometry();
|
||||||
|
|
||||||
Pout<< "cyclicPolyPatch::calcGeometry : name:" << name()
|
Pout<< "cyclicPolyPatch::calcGeometry : name:" << name()
|
||||||
<< " referred from:" << referPatch.size() << endl;
|
<< " referred from a patch with nFaces:" << referPatch.size() << endl;
|
||||||
|
|
||||||
calcTransforms
|
calcTransforms
|
||||||
(
|
(
|
||||||
@ -694,7 +677,6 @@ Pout<< "cyclicPolyPatch::calcGeometry : name:" << name()
|
|||||||
|
|
||||||
void Foam::cyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs)
|
void Foam::cyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs)
|
||||||
{
|
{
|
||||||
Pout<< "cyclicPolyPatch::calcGeometry() for " << name() << endl;
|
|
||||||
calcGeometry
|
calcGeometry
|
||||||
(
|
(
|
||||||
*this,
|
*this,
|
||||||
|
|||||||
@ -466,6 +466,31 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Type of transform
|
||||||
|
transformType transform() const
|
||||||
|
{
|
||||||
|
return transform_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Axis of rotation for rotational cyclics
|
||||||
|
const vector& rotationAxis() const
|
||||||
|
{
|
||||||
|
return rotationAxis_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- point on axis of rotation for rotational cyclics
|
||||||
|
const point& rotationCentre() const
|
||||||
|
{
|
||||||
|
return rotationCentre_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Translation vector for translational cyclics
|
||||||
|
const vector& separationVector() const
|
||||||
|
{
|
||||||
|
return separationVector_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Initialize ordering for primitivePatch. Does not
|
//- Initialize ordering for primitivePatch. Does not
|
||||||
// refer to *this (except for name() and type() etc.)
|
// refer to *this (except for name() and type() etc.)
|
||||||
virtual void initOrder(PstreamBuffers&, const primitivePatch&) const;
|
virtual void initOrder(PstreamBuffers&, const primitivePatch&) const;
|
||||||
|
|||||||
@ -158,7 +158,7 @@ Foam::processorPolyPatch::~processorPolyPatch()
|
|||||||
|
|
||||||
void Foam::processorPolyPatch::initGeometry(PstreamBuffers& pBufs)
|
void Foam::processorPolyPatch::initGeometry(PstreamBuffers& pBufs)
|
||||||
{
|
{
|
||||||
Pout<< "**processorPolyPatch::initGeometry()" << endl;
|
//Pout<< "**processorPolyPatch::initGeometry()" << endl;
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
UOPstream toNeighbProc(neighbProcNo(), pBufs);
|
UOPstream toNeighbProc(neighbProcNo(), pBufs);
|
||||||
@ -187,22 +187,94 @@ Pout<< "processorPolyPatch::calcGeometry() for " << name() << endl;
|
|||||||
|
|
||||||
Pout<< "processorPolyPatch::calcGeometry() : received data for "
|
Pout<< "processorPolyPatch::calcGeometry() : received data for "
|
||||||
<< neighbFaceCentres_.size() << " faces." << endl;
|
<< neighbFaceCentres_.size() << " faces." << endl;
|
||||||
|
//Pout<< "**neighbFaceCentres_:" << neighbFaceCentres_ << endl;
|
||||||
|
//Pout<< "**neighbFaceAreas_:" << neighbFaceAreas_ << endl;
|
||||||
|
//Pout<< "**neighbFaceCellCentres_:" << neighbFaceCellCentres_ << endl;
|
||||||
|
|
||||||
calcGeometry
|
|
||||||
(
|
|
||||||
*this,
|
// // My normals
|
||||||
faceCentres(),
|
// vectorField faceNormals(size());
|
||||||
faceAreas(),
|
//
|
||||||
faceCellCentres()(),
|
// // Neighbour normals
|
||||||
neighbFaceCentres_,
|
// vectorField nbrFaceNormals(neighbFaceAreas_.size());
|
||||||
neighbFaceAreas_,
|
//
|
||||||
neighbFaceCellCentres_
|
// // Calculate normals from areas and check
|
||||||
);
|
// forAll(faceNormals, facei)
|
||||||
|
// {
|
||||||
|
// scalar magSf = mag(faceAreas()[facei]);
|
||||||
|
// scalar nbrMagSf = mag(neighbFaceAreas_[facei]);
|
||||||
|
// scalar avSf = (magSf + nbrMagSf)/2.0;
|
||||||
|
//
|
||||||
|
// if (magSf < ROOTVSMALL && nbrMagSf < ROOTVSMALL)
|
||||||
|
// {
|
||||||
|
// // Undetermined normal. Use dummy normal to force separation
|
||||||
|
// // check. (note use of sqrt(VSMALL) since that is how mag
|
||||||
|
// // scales)
|
||||||
|
// faceNormals[facei] = point(1, 0, 0);
|
||||||
|
// nbrFaceNormals[facei] = faceNormals[facei];
|
||||||
|
// }
|
||||||
|
// else if (mag(magSf - nbrMagSf)/avSf > coupledPolyPatch::matchTol)
|
||||||
|
// {
|
||||||
|
// fileName nm
|
||||||
|
// (
|
||||||
|
// boundaryMesh().mesh().time().path()
|
||||||
|
// /name()+"_faces.obj"
|
||||||
|
// );
|
||||||
|
// Pout<< "processorPolyPatch::order : Writing my " << size()
|
||||||
|
// << " faces to OBJ file " << nm << endl;
|
||||||
|
// writeOBJ(nm, *this, points());
|
||||||
|
//
|
||||||
|
// FatalErrorIn
|
||||||
|
// (
|
||||||
|
// "processorPolyPatch::calcGeometry()"
|
||||||
|
// ) << "face " << facei << " area does not match neighbour by "
|
||||||
|
// << 100*mag(magSf - nbrMagSf)/avSf
|
||||||
|
// << "% -- possible face ordering problem." << endl
|
||||||
|
// << "patch:" << name()
|
||||||
|
// << " my area:" << magSf
|
||||||
|
// << " neighbour area:" << nbrMagSf
|
||||||
|
// << " matching tolerance:" << coupledPolyPatch::matchTol
|
||||||
|
// << endl
|
||||||
|
// << "Mesh face:" << start()+facei
|
||||||
|
// << " vertices:"
|
||||||
|
// << UIndirectList<point>(points(), operator[](facei))()
|
||||||
|
// << endl
|
||||||
|
// << "Rerun with processor debug flag set for"
|
||||||
|
// << " more information." << exit(FatalError);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// faceNormals[facei] = faceAreas()[facei]/magSf;
|
||||||
|
// nbrFaceNormals[facei] = neighbFaceAreas_[facei]/nbrMagSf;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// // Calculate transformation tensors
|
||||||
|
// calcTransformTensors
|
||||||
|
// (
|
||||||
|
// separated_,
|
||||||
|
// separation_,
|
||||||
|
// parallel_,
|
||||||
|
// forwardT_,
|
||||||
|
// reverseT_,
|
||||||
|
// faceCentres(),
|
||||||
|
// neighbFaceCentres_,
|
||||||
|
// faceNormals,
|
||||||
|
// nbrFaceNormals,
|
||||||
|
// calcFaceTol(*this, points(), faceCentres())
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
//Pout<< "cyclicPolyPatch::calcTransforms : calculated transforms for:"
|
||||||
|
// << name() << endl
|
||||||
|
// << " separated_:" << separated_ << endl
|
||||||
|
// << " separation_:" << separation_ << endl
|
||||||
|
// << " parallel_:" << parallel_ << endl
|
||||||
|
// << " forwardT_:" << forwardT_ << endl
|
||||||
|
// << " reverseT_:" << reverseT_ << endl
|
||||||
|
// << endl;
|
||||||
}
|
}
|
||||||
Pout<< "**neighbFaceCentres_:" << neighbFaceCentres_ << endl;
|
|
||||||
Pout<< "**neighbFaceAreas_:" << neighbFaceAreas_ << endl;
|
|
||||||
Pout<< "**neighbFaceCellCentres_:" << neighbFaceCellCentres_ << endl;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -292,7 +364,7 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
|||||||
{
|
{
|
||||||
// Note cannot predict exact size since opposite nPoints might
|
// Note cannot predict exact size since opposite nPoints might
|
||||||
// be different from one over here.
|
// be different from one over here.
|
||||||
IPstream fromNeighbProc(Pstream::blocking, neighbProcNo());
|
UIPstream fromNeighbProc(neighbProcNo(), pBufs);
|
||||||
|
|
||||||
fromNeighbProc
|
fromNeighbProc
|
||||||
>> nbrPointFace
|
>> nbrPointFace
|
||||||
|
|||||||
@ -292,6 +292,12 @@ public:
|
|||||||
//- Return neighbour edge labels. WIP.
|
//- Return neighbour edge labels. WIP.
|
||||||
const labelList& neighbEdges() const;
|
const labelList& neighbEdges() const;
|
||||||
|
|
||||||
|
//- Return message tag to use for communication
|
||||||
|
virtual int tag() const
|
||||||
|
{
|
||||||
|
return Pstream::msgType();
|
||||||
|
}
|
||||||
|
|
||||||
//- Transform a patch-based field from other side to this side.
|
//- Transform a patch-based field from other side to this side.
|
||||||
virtual bool doTransform() const
|
virtual bool doTransform() const
|
||||||
{
|
{
|
||||||
@ -317,21 +323,21 @@ public:
|
|||||||
//- Are the planes separated.
|
//- Are the planes separated.
|
||||||
virtual bool separated() const
|
virtual bool separated() const
|
||||||
{
|
{
|
||||||
notImplemented("processorPolyPatch::separated(..)");
|
//notImplemented("processorPolyPatch::separated(..)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- If the planes are separated the separation vector.
|
//- If the planes are separated the separation vector.
|
||||||
virtual const vector& separation() const
|
virtual const vector& separation() const
|
||||||
{
|
{
|
||||||
notImplemented("processorPolyPatch::separation(..)");
|
//notImplemented("processorPolyPatch::separation(..)");
|
||||||
return vector::zero;
|
return vector::zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Are the cyclic planes parallel.
|
//- Are the cyclic planes parallel.
|
||||||
virtual bool parallel() const
|
virtual bool parallel() const
|
||||||
{
|
{
|
||||||
notImplemented("processorPolyPatch::parallel()");
|
//notImplemented("processorPolyPatch::parallel()");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -55,6 +55,7 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
processorPolyPatch(name, size, start, index, bm, myProcNo, neighbProcNo),
|
processorPolyPatch(name, size, start, index, bm, myProcNo, neighbProcNo),
|
||||||
|
tag_(UPstream::allocateTag()),
|
||||||
referPatchName_(referPatchName),
|
referPatchName_(referPatchName),
|
||||||
referPatchID_(-1)
|
referPatchID_(-1)
|
||||||
{}
|
{}
|
||||||
@ -69,6 +70,7 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
processorPolyPatch(name, dict, index, bm),
|
processorPolyPatch(name, dict, index, bm),
|
||||||
|
tag_(UPstream::allocateTag()),
|
||||||
referPatchName_(dict.lookup("referPatch")),
|
referPatchName_(dict.lookup("referPatch")),
|
||||||
referPatchID_(-1)
|
referPatchID_(-1)
|
||||||
{}
|
{}
|
||||||
@ -81,6 +83,7 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
processorPolyPatch(pp, bm),
|
processorPolyPatch(pp, bm),
|
||||||
|
tag_(pp.tag_),
|
||||||
referPatchName_(pp.referPatchName()),
|
referPatchName_(pp.referPatchName()),
|
||||||
referPatchID_(-1)
|
referPatchID_(-1)
|
||||||
{}
|
{}
|
||||||
@ -97,6 +100,7 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
processorPolyPatch(pp, bm, index, newSize, newStart),
|
processorPolyPatch(pp, bm, index, newSize, newStart),
|
||||||
|
tag_(pp.tag_),
|
||||||
referPatchName_(referPatchName),
|
referPatchName_(referPatchName),
|
||||||
referPatchID_(-1)
|
referPatchID_(-1)
|
||||||
{}
|
{}
|
||||||
@ -112,6 +116,7 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
processorPolyPatch(pp, bm, index, mapAddressing, newStart),
|
processorPolyPatch(pp, bm, index, mapAddressing, newStart),
|
||||||
|
tag_(pp.tag_),
|
||||||
referPatchName_(pp.referPatchName()),
|
referPatchName_(pp.referPatchName()),
|
||||||
referPatchID_(-1)
|
referPatchID_(-1)
|
||||||
{}
|
{}
|
||||||
@ -120,7 +125,9 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch
|
|||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::processorCyclicPolyPatch::~processorCyclicPolyPatch()
|
Foam::processorCyclicPolyPatch::~processorCyclicPolyPatch()
|
||||||
{}
|
{
|
||||||
|
UPstream::freeTag(tag_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
@ -128,8 +135,6 @@ Foam::processorCyclicPolyPatch::~processorCyclicPolyPatch()
|
|||||||
|
|
||||||
void Foam::processorCyclicPolyPatch::initGeometry(PstreamBuffers& pBufs)
|
void Foam::processorCyclicPolyPatch::initGeometry(PstreamBuffers& pBufs)
|
||||||
{
|
{
|
||||||
Pout<< "**processorCyclicPolyPatch::initGeometry()" << endl;
|
|
||||||
|
|
||||||
// Send over processorPolyPatch data
|
// Send over processorPolyPatch data
|
||||||
processorPolyPatch::initGeometry(pBufs);
|
processorPolyPatch::initGeometry(pBufs);
|
||||||
}
|
}
|
||||||
@ -137,8 +142,6 @@ Pout<< "**processorCyclicPolyPatch::initGeometry()" << endl;
|
|||||||
|
|
||||||
void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs)
|
void Foam::processorCyclicPolyPatch::calcGeometry(PstreamBuffers& pBufs)
|
||||||
{
|
{
|
||||||
Pout<< "processorCyclicPolyPatch::calcGeometry() for " << name() << endl;
|
|
||||||
|
|
||||||
// Receive and initialise processorPolyPatch data
|
// Receive and initialise processorPolyPatch data
|
||||||
processorPolyPatch::calcGeometry(pBufs);
|
processorPolyPatch::calcGeometry(pBufs);
|
||||||
|
|
||||||
@ -158,7 +161,7 @@ Pout<< "processorCyclicPolyPatch::calcGeometry() for " << name() << endl;
|
|||||||
|
|
||||||
pp.calcGeometry
|
pp.calcGeometry
|
||||||
(
|
(
|
||||||
pp,
|
*this,
|
||||||
faceCentres(),
|
faceCentres(),
|
||||||
faceAreas(),
|
faceAreas(),
|
||||||
faceCellCentres(),
|
faceCellCentres(),
|
||||||
|
|||||||
@ -55,13 +55,15 @@ class processorCyclicPolyPatch
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
//- Message tag to use for communication
|
||||||
|
const int tag_;
|
||||||
|
|
||||||
//- Name of originating patch
|
//- Name of originating patch
|
||||||
const word referPatchName_;
|
const word referPatchName_;
|
||||||
|
|
||||||
//- Index of originating patch
|
//- Index of originating patch
|
||||||
mutable label referPatchID_;
|
mutable label referPatchID_;
|
||||||
|
|
||||||
|
|
||||||
// Private member functions
|
// Private member functions
|
||||||
|
|
||||||
|
|
||||||
@ -270,7 +272,19 @@ public:
|
|||||||
const coupledPolyPatch& referPatch() const
|
const coupledPolyPatch& referPatch() const
|
||||||
{
|
{
|
||||||
const polyPatch& pp = this->boundaryMesh()[referPatchID()];
|
const polyPatch& pp = this->boundaryMesh()[referPatchID()];
|
||||||
return refCast<const processorCyclicPolyPatch>(pp);
|
return refCast<const coupledPolyPatch>(pp);
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return message tag to use for communication
|
||||||
|
virtual int tag() const
|
||||||
|
{
|
||||||
|
return tag_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Does this side own the patch ?
|
||||||
|
virtual bool owner() const
|
||||||
|
{
|
||||||
|
return referPatch().owner();
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Transform a patch-based field from other side to this side.
|
//- Transform a patch-based field from other side to this side.
|
||||||
|
|||||||
@ -137,14 +137,8 @@ Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh)
|
|||||||
{
|
{
|
||||||
if (patches[patchI].coupled())
|
if (patches[patchI].coupled())
|
||||||
{
|
{
|
||||||
if
|
const coupledPolyPatch& pp =
|
||||||
(
|
refCast<const coupledPolyPatch>(patches[patchI]);
|
||||||
Pstream::parRun()
|
|
||||||
&& isA<processorPolyPatch>(patches[patchI])
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const processorPolyPatch& pp =
|
|
||||||
refCast<const processorPolyPatch>(patches[patchI]);
|
|
||||||
|
|
||||||
const labelList& meshPoints = pp.meshPoints();
|
const labelList& meshPoints = pp.meshPoints();
|
||||||
|
|
||||||
@ -163,38 +157,6 @@ Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isA<cyclicPolyPatch>(patches[patchI]))
|
|
||||||
{
|
|
||||||
const cyclicPolyPatch& pp =
|
|
||||||
refCast<const cyclicPolyPatch>(patches[patchI]);
|
|
||||||
|
|
||||||
const edgeList& coupledPoints = pp.coupledPoints();
|
|
||||||
const labelList& meshPoints = pp.meshPoints();
|
|
||||||
|
|
||||||
forAll(coupledPoints, i)
|
|
||||||
{
|
|
||||||
// First one of couple points is master
|
|
||||||
|
|
||||||
const edge& pointPair = coupledPoints[i];
|
|
||||||
label p0 = meshPoints[pointPair[0]];
|
|
||||||
label p1 = meshPoints[pointPair[1]];
|
|
||||||
|
|
||||||
if (donePoint.get(p0) == 0u)
|
|
||||||
{
|
|
||||||
donePoint.set(p0, 1u);
|
|
||||||
isMasterPoint.set(p0, 1u);
|
|
||||||
donePoint.set(p1, 1u);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorIn("syncTools::getMasterPoints(const polyMesh&)")
|
|
||||||
<< "Cannot handle coupled patch " << patches[patchI].name()
|
|
||||||
<< " of type " << patches[patchI].type()
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -256,14 +218,8 @@ Foam::PackedBoolList Foam::syncTools::getMasterEdges(const polyMesh& mesh)
|
|||||||
{
|
{
|
||||||
if (patches[patchI].coupled())
|
if (patches[patchI].coupled())
|
||||||
{
|
{
|
||||||
if
|
const coupledPolyPatch& pp =
|
||||||
(
|
refCast<const coupledPolyPatch>(patches[patchI]);
|
||||||
Pstream::parRun()
|
|
||||||
&& isA<processorPolyPatch>(patches[patchI])
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const processorPolyPatch& pp =
|
|
||||||
refCast<const processorPolyPatch>(patches[patchI]);
|
|
||||||
|
|
||||||
const labelList& meshEdges = pp.meshEdges();
|
const labelList& meshEdges = pp.meshEdges();
|
||||||
|
|
||||||
@ -282,38 +238,6 @@ Foam::PackedBoolList Foam::syncTools::getMasterEdges(const polyMesh& mesh)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isA<cyclicPolyPatch>(patches[patchI]))
|
|
||||||
{
|
|
||||||
const cyclicPolyPatch& pp =
|
|
||||||
refCast<const cyclicPolyPatch>(patches[patchI]);
|
|
||||||
|
|
||||||
const edgeList& coupledEdges = pp.coupledEdges();
|
|
||||||
const labelList& meshEdges = pp.meshEdges();
|
|
||||||
|
|
||||||
forAll(coupledEdges, i)
|
|
||||||
{
|
|
||||||
// First one of couple edges is master
|
|
||||||
|
|
||||||
const edge& edgePair = coupledEdges[i];
|
|
||||||
label e0 = meshEdges[edgePair[0]];
|
|
||||||
label e1 = meshEdges[edgePair[1]];
|
|
||||||
|
|
||||||
if (doneEdge.get(e0) == 0u)
|
|
||||||
{
|
|
||||||
doneEdge.set(e0, 1u);
|
|
||||||
isMasterEdge.set(e0, 1u);
|
|
||||||
doneEdge.set(e1, 1u);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorIn("syncTools::getMasterEdges(const polyMesh&)")
|
|
||||||
<< "Cannot handle coupled patch " << patches[patchI].name()
|
|
||||||
<< " of type " << patches[patchI].type()
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -344,10 +268,8 @@ Foam::PackedBoolList Foam::syncTools::getMasterFaces(const polyMesh& mesh)
|
|||||||
{
|
{
|
||||||
if (patches[patchI].coupled())
|
if (patches[patchI].coupled())
|
||||||
{
|
{
|
||||||
if (Pstream::parRun() && isA<processorPolyPatch>(patches[patchI]))
|
const coupledPolyPatch& pp =
|
||||||
{
|
refCast<const coupledPolyPatch>(patches[patchI]);
|
||||||
const processorPolyPatch& pp =
|
|
||||||
refCast<const processorPolyPatch>(patches[patchI]);
|
|
||||||
|
|
||||||
if (!pp.owner())
|
if (!pp.owner())
|
||||||
{
|
{
|
||||||
@ -357,24 +279,6 @@ Foam::PackedBoolList Foam::syncTools::getMasterFaces(const polyMesh& mesh)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isA<cyclicPolyPatch>(patches[patchI]))
|
|
||||||
{
|
|
||||||
const cyclicPolyPatch& pp =
|
|
||||||
refCast<const cyclicPolyPatch>(patches[patchI]);
|
|
||||||
|
|
||||||
for (label i = pp.size()/2; i < pp.size(); i++)
|
|
||||||
{
|
|
||||||
isMasterFace.unset(pp.start()+i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorIn("syncTools::getMasterFaces(const polyMesh&)")
|
|
||||||
<< "Cannot handle coupled patch " << patches[patchI].name()
|
|
||||||
<< " of type " << patches[patchI].type()
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return isMasterFace;
|
return isMasterFace;
|
||||||
|
|||||||
@ -101,6 +101,8 @@ void Foam::syncTools::syncPointMap
|
|||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
@ -134,11 +136,12 @@ void Foam::syncTools::syncPointMap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OPstream toNeighb(Pstream::blocking, procPatch.neighbProcNo());
|
UOPstream toNeighb(procPatch.neighbProcNo(), pBufs);
|
||||||
toNeighb << patchInfo;
|
toNeighb << patchInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
// Receive and combine.
|
// Receive and combine.
|
||||||
|
|
||||||
@ -153,7 +156,7 @@ void Foam::syncTools::syncPointMap
|
|||||||
const processorPolyPatch& procPatch =
|
const processorPolyPatch& procPatch =
|
||||||
refCast<const processorPolyPatch>(patches[patchI]);
|
refCast<const processorPolyPatch>(patches[patchI]);
|
||||||
|
|
||||||
IPstream fromNb(Pstream::blocking, procPatch.neighbProcNo());
|
UIPstream fromNb(procPatch.neighbProcNo(), pBufs);
|
||||||
Map<T> nbrPatchInfo(fromNb);
|
Map<T> nbrPatchInfo(fromNb);
|
||||||
|
|
||||||
// Transform
|
// Transform
|
||||||
@ -198,7 +201,7 @@ void Foam::syncTools::syncPointMap
|
|||||||
const labelList& meshPtsA = cycPatch.meshPoints();
|
const labelList& meshPtsA = cycPatch.meshPoints();
|
||||||
const labelList& meshPtsB = nbrPatch.meshPoints();
|
const labelList& meshPtsB = nbrPatch.meshPoints();
|
||||||
|
|
||||||
// Extract local values. Create map from nbrPoint to value.
|
// Extract local values. Create map from coupled-edge to value.
|
||||||
Map<T> half0Values(meshPtsA.size() / 20);
|
Map<T> half0Values(meshPtsA.size() / 20);
|
||||||
Map<T> half1Values(half0Values.size());
|
Map<T> half1Values(half0Values.size());
|
||||||
|
|
||||||
@ -311,7 +314,7 @@ void Foam::syncTools::syncPointMap
|
|||||||
slave++
|
slave++
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::blocking, slave);
|
IPstream fromSlave(Pstream::scheduled, slave);
|
||||||
Map<T> nbrValues(fromSlave);
|
Map<T> nbrValues(fromSlave);
|
||||||
|
|
||||||
// Merge neighbouring values with my values
|
// Merge neighbouring values with my values
|
||||||
@ -335,7 +338,7 @@ void Foam::syncTools::syncPointMap
|
|||||||
slave++
|
slave++
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
OPstream toSlave(Pstream::blocking, slave);
|
OPstream toSlave(Pstream::scheduled, slave);
|
||||||
toSlave << sharedPointValues;
|
toSlave << sharedPointValues;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -343,14 +346,14 @@ void Foam::syncTools::syncPointMap
|
|||||||
{
|
{
|
||||||
// Slave: send to master
|
// Slave: send to master
|
||||||
{
|
{
|
||||||
OPstream toMaster(Pstream::blocking, Pstream::masterNo());
|
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
toMaster << sharedPointValues;
|
toMaster << sharedPointValues;
|
||||||
}
|
}
|
||||||
// Receive merged values
|
// Receive merged values
|
||||||
{
|
{
|
||||||
IPstream fromMaster
|
IPstream fromMaster
|
||||||
(
|
(
|
||||||
Pstream::blocking,
|
Pstream::scheduled,
|
||||||
Pstream::masterNo()
|
Pstream::masterNo()
|
||||||
);
|
);
|
||||||
fromMaster >> sharedPointValues;
|
fromMaster >> sharedPointValues;
|
||||||
@ -416,6 +419,8 @@ void Foam::syncTools::syncEdgeMap
|
|||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
@ -453,11 +458,12 @@ void Foam::syncTools::syncEdgeMap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OPstream toNeighb(Pstream::blocking, procPatch.neighbProcNo());
|
UOPstream toNeighb(procPatch.neighbProcNo(), pBufs);
|
||||||
toNeighb << patchInfo;
|
toNeighb << patchInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
// Receive and combine.
|
// Receive and combine.
|
||||||
|
|
||||||
@ -474,11 +480,7 @@ void Foam::syncTools::syncEdgeMap
|
|||||||
|
|
||||||
EdgeMap<T> nbrPatchInfo;
|
EdgeMap<T> nbrPatchInfo;
|
||||||
{
|
{
|
||||||
IPstream fromNbr
|
UIPstream fromNbr(procPatch.neighbProcNo(), pBufs);
|
||||||
(
|
|
||||||
Pstream::blocking,
|
|
||||||
procPatch.neighbProcNo()
|
|
||||||
);
|
|
||||||
fromNbr >> nbrPatchInfo;
|
fromNbr >> nbrPatchInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -704,7 +706,7 @@ void Foam::syncTools::syncEdgeMap
|
|||||||
slave++
|
slave++
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
IPstream fromSlave(Pstream::blocking, slave);
|
IPstream fromSlave(Pstream::scheduled, slave);
|
||||||
EdgeMap<T> nbrValues(fromSlave);
|
EdgeMap<T> nbrValues(fromSlave);
|
||||||
|
|
||||||
// Merge neighbouring values with my values
|
// Merge neighbouring values with my values
|
||||||
@ -729,7 +731,7 @@ void Foam::syncTools::syncEdgeMap
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
OPstream toSlave(Pstream::blocking, slave);
|
OPstream toSlave(Pstream::scheduled, slave);
|
||||||
toSlave << sharedEdgeValues;
|
toSlave << sharedEdgeValues;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -737,12 +739,12 @@ void Foam::syncTools::syncEdgeMap
|
|||||||
{
|
{
|
||||||
// Send to master
|
// Send to master
|
||||||
{
|
{
|
||||||
OPstream toMaster(Pstream::blocking, Pstream::masterNo());
|
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
toMaster << sharedEdgeValues;
|
toMaster << sharedEdgeValues;
|
||||||
}
|
}
|
||||||
// Receive merged values
|
// Receive merged values
|
||||||
{
|
{
|
||||||
IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
|
IPstream fromMaster(Pstream::scheduled, Pstream::masterNo());
|
||||||
fromMaster >> sharedEdgeValues;
|
fromMaster >> sharedEdgeValues;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -807,6 +809,8 @@ void Foam::syncTools::syncPointList
|
|||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
@ -832,11 +836,12 @@ void Foam::syncTools::syncPointList
|
|||||||
patchInfo[nbrPointI] = pointValues[meshPts[pointI]];
|
patchInfo[nbrPointI] = pointValues[meshPts[pointI]];
|
||||||
}
|
}
|
||||||
|
|
||||||
OPstream toNbr(Pstream::blocking, procPatch.neighbProcNo());
|
UOPstream toNbr(procPatch.neighbProcNo(), pBufs);
|
||||||
toNbr << patchInfo;
|
toNbr << patchInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
// Receive and combine.
|
// Receive and combine.
|
||||||
|
|
||||||
@ -853,11 +858,7 @@ void Foam::syncTools::syncPointList
|
|||||||
|
|
||||||
Field<T> nbrPatchInfo(procPatch.nPoints());
|
Field<T> nbrPatchInfo(procPatch.nPoints());
|
||||||
{
|
{
|
||||||
IPstream fromNbr
|
UIPstream fromNbr(procPatch.neighbProcNo(), pBufs);
|
||||||
(
|
|
||||||
Pstream::blocking,
|
|
||||||
procPatch.neighbProcNo()
|
|
||||||
);
|
|
||||||
fromNbr >> nbrPatchInfo;
|
fromNbr >> nbrPatchInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1032,6 +1033,8 @@ void Foam::syncTools::syncEdgeList
|
|||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
@ -1058,11 +1061,13 @@ void Foam::syncTools::syncEdgeList
|
|||||||
patchInfo[nbrEdgeI] = edgeValues[meshEdges[edgeI]];
|
patchInfo[nbrEdgeI] = edgeValues[meshEdges[edgeI]];
|
||||||
}
|
}
|
||||||
|
|
||||||
OPstream toNbr(Pstream::blocking, procPatch.neighbProcNo());
|
UOPstream toNbr(procPatch.neighbProcNo(), pBufs);
|
||||||
toNbr << patchInfo;
|
toNbr << patchInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
// Receive and combine.
|
// Receive and combine.
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
@ -1083,11 +1088,7 @@ void Foam::syncTools::syncEdgeList
|
|||||||
Field<T> nbrPatchInfo(procPatch.nEdges());
|
Field<T> nbrPatchInfo(procPatch.nEdges());
|
||||||
|
|
||||||
{
|
{
|
||||||
IPstream fromNeighb
|
UIPstream fromNeighb(procPatch.neighbProcNo(), pBufs);
|
||||||
(
|
|
||||||
Pstream::blocking,
|
|
||||||
procPatch.neighbProcNo()
|
|
||||||
);
|
|
||||||
fromNeighb >> nbrPatchInfo;
|
fromNeighb >> nbrPatchInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1215,6 +1216,8 @@ void Foam::syncTools::syncBoundaryFaceList
|
|||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
@ -1230,19 +1233,7 @@ void Foam::syncTools::syncBoundaryFaceList
|
|||||||
|
|
||||||
label patchStart = procPatch.start()-mesh.nInternalFaces();
|
label patchStart = procPatch.start()-mesh.nInternalFaces();
|
||||||
|
|
||||||
if (contiguous<T>())
|
UOPstream toNbr(procPatch.neighbProcNo(), pBufs);
|
||||||
{
|
|
||||||
OPstream::write
|
|
||||||
(
|
|
||||||
Pstream::blocking,
|
|
||||||
procPatch.neighbProcNo(),
|
|
||||||
reinterpret_cast<const char*>(&faceValues[patchStart]),
|
|
||||||
procPatch.size()*sizeof(T)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OPstream toNbr(Pstream::blocking, procPatch.neighbProcNo());
|
|
||||||
toNbr <<
|
toNbr <<
|
||||||
SubField<T>
|
SubField<T>
|
||||||
(
|
(
|
||||||
@ -1252,7 +1243,9 @@ void Foam::syncTools::syncBoundaryFaceList
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
|
|
||||||
// Receive and combine.
|
// Receive and combine.
|
||||||
@ -1270,25 +1263,8 @@ void Foam::syncTools::syncBoundaryFaceList
|
|||||||
|
|
||||||
Field<T> nbrPatchInfo(procPatch.size());
|
Field<T> nbrPatchInfo(procPatch.size());
|
||||||
|
|
||||||
if (contiguous<T>())
|
UIPstream fromNeighb(procPatch.neighbProcNo(), pBufs);
|
||||||
{
|
|
||||||
IPstream::read
|
|
||||||
(
|
|
||||||
Pstream::blocking,
|
|
||||||
procPatch.neighbProcNo(),
|
|
||||||
reinterpret_cast<char*>(nbrPatchInfo.begin()),
|
|
||||||
nbrPatchInfo.byteSize()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
IPstream fromNeighb
|
|
||||||
(
|
|
||||||
Pstream::blocking,
|
|
||||||
procPatch.neighbProcNo()
|
|
||||||
);
|
|
||||||
fromNeighb >> nbrPatchInfo;
|
fromNeighb >> nbrPatchInfo;
|
||||||
}
|
|
||||||
|
|
||||||
top(procPatch, nbrPatchInfo);
|
top(procPatch, nbrPatchInfo);
|
||||||
|
|
||||||
@ -1373,6 +1349,8 @@ void Foam::syncTools::syncFaceList
|
|||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
@ -1392,12 +1370,14 @@ void Foam::syncTools::syncFaceList
|
|||||||
patchInfo[i] = faceValues[procPatch.start()+i];
|
patchInfo[i] = faceValues[procPatch.start()+i];
|
||||||
}
|
}
|
||||||
|
|
||||||
OPstream toNbr(Pstream::blocking, procPatch.neighbProcNo());
|
UOPstream toNbr(procPatch.neighbProcNo(), pBufs);
|
||||||
toNbr << patchInfo;
|
toNbr << patchInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
// Receive and combine.
|
// Receive and combine.
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
@ -1413,11 +1393,7 @@ void Foam::syncTools::syncFaceList
|
|||||||
|
|
||||||
List<unsigned int> patchInfo(procPatch.size());
|
List<unsigned int> patchInfo(procPatch.size());
|
||||||
{
|
{
|
||||||
IPstream fromNbr
|
UIPstream fromNbr(procPatch.neighbProcNo(), pBufs);
|
||||||
(
|
|
||||||
Pstream::blocking,
|
|
||||||
procPatch.neighbProcNo()
|
|
||||||
);
|
|
||||||
fromNbr >> patchInfo;
|
fromNbr >> patchInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1508,6 +1484,8 @@ void Foam::syncTools::syncPointList
|
|||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
@ -1532,12 +1510,14 @@ void Foam::syncTools::syncPointList
|
|||||||
patchInfo[nbrPointI] = pointValues[meshPts[pointI]];
|
patchInfo[nbrPointI] = pointValues[meshPts[pointI]];
|
||||||
}
|
}
|
||||||
|
|
||||||
OPstream toNbr(Pstream::blocking, procPatch.neighbProcNo());
|
UOPstream toNbr(procPatch.neighbProcNo(), pBufs);
|
||||||
toNbr << patchInfo;
|
toNbr << patchInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
// Receive and combine.
|
// Receive and combine.
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
@ -1555,11 +1535,7 @@ void Foam::syncTools::syncPointList
|
|||||||
{
|
{
|
||||||
// We do not know the number of points on the other side
|
// We do not know the number of points on the other side
|
||||||
// so cannot use Pstream::read.
|
// so cannot use Pstream::read.
|
||||||
IPstream fromNbr
|
UIPstream fromNbr(procPatch.neighbProcNo(), pBufs);
|
||||||
(
|
|
||||||
Pstream::blocking,
|
|
||||||
procPatch.neighbProcNo()
|
|
||||||
);
|
|
||||||
fromNbr >> nbrPatchInfo;
|
fromNbr >> nbrPatchInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1672,6 +1648,8 @@ void Foam::syncTools::syncEdgeList
|
|||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
@ -1696,11 +1674,12 @@ void Foam::syncTools::syncEdgeList
|
|||||||
patchInfo[nbrEdgeI] = edgeValues[meshEdges[edgeI]];
|
patchInfo[nbrEdgeI] = edgeValues[meshEdges[edgeI]];
|
||||||
}
|
}
|
||||||
|
|
||||||
OPstream toNbr(Pstream::blocking, procPatch.neighbProcNo());
|
UOPstream toNbr(procPatch.neighbProcNo(), pBufs);
|
||||||
toNbr << patchInfo;
|
toNbr << patchInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
// Receive and combine.
|
// Receive and combine.
|
||||||
|
|
||||||
@ -1719,11 +1698,7 @@ void Foam::syncTools::syncEdgeList
|
|||||||
List<unsigned int> nbrPatchInfo(procPatch.nEdges());
|
List<unsigned int> nbrPatchInfo(procPatch.nEdges());
|
||||||
|
|
||||||
{
|
{
|
||||||
IPstream fromNeighb
|
UIPstream fromNeighb(procPatch.neighbProcNo(), pBufs);
|
||||||
(
|
|
||||||
Pstream::blocking,
|
|
||||||
procPatch.neighbProcNo()
|
|
||||||
);
|
|
||||||
fromNeighb >> nbrPatchInfo;
|
fromNeighb >> nbrPatchInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,7 @@ Foam::UIPstream::UIPstream
|
|||||||
const commsTypes commsType,
|
const commsTypes commsType,
|
||||||
const int fromProcNo,
|
const int fromProcNo,
|
||||||
DynamicList<char>& externalBuf,
|
DynamicList<char>& externalBuf,
|
||||||
|
label& externalBufPosition,
|
||||||
const int tag,
|
const int tag,
|
||||||
streamFormat format,
|
streamFormat format,
|
||||||
versionNumber version
|
versionNumber version
|
||||||
@ -45,7 +46,7 @@ Foam::UIPstream::UIPstream
|
|||||||
Istream(format, version),
|
Istream(format, version),
|
||||||
fromProcNo_(fromProcNo),
|
fromProcNo_(fromProcNo),
|
||||||
externalBuf_(externalBuf),
|
externalBuf_(externalBuf),
|
||||||
externalBufPosition_(0),
|
externalBufPosition_(externalBufPosition),
|
||||||
tag_(tag),
|
tag_(tag),
|
||||||
messageSize_(0)
|
messageSize_(0)
|
||||||
{
|
{
|
||||||
@ -56,6 +57,7 @@ Foam::UIPstream::UIPstream
|
|||||||
"const commsTypes,"
|
"const commsTypes,"
|
||||||
"const int fromProcNo,"
|
"const int fromProcNo,"
|
||||||
"DynamicList<char>&,"
|
"DynamicList<char>&,"
|
||||||
|
"label&,"
|
||||||
"const int tag,"
|
"const int tag,"
|
||||||
"streamFormat, versionNumber"
|
"streamFormat, versionNumber"
|
||||||
")"
|
")"
|
||||||
|
|||||||
@ -40,6 +40,7 @@ Foam::UIPstream::UIPstream
|
|||||||
const commsTypes commsType,
|
const commsTypes commsType,
|
||||||
const int fromProcNo,
|
const int fromProcNo,
|
||||||
DynamicList<char>& externalBuf,
|
DynamicList<char>& externalBuf,
|
||||||
|
label& externalBufPosition,
|
||||||
const int tag,
|
const int tag,
|
||||||
streamFormat format,
|
streamFormat format,
|
||||||
versionNumber version
|
versionNumber version
|
||||||
@ -49,7 +50,7 @@ Foam::UIPstream::UIPstream
|
|||||||
Istream(format, version),
|
Istream(format, version),
|
||||||
fromProcNo_(fromProcNo),
|
fromProcNo_(fromProcNo),
|
||||||
externalBuf_(externalBuf),
|
externalBuf_(externalBuf),
|
||||||
externalBufPosition_(0),
|
externalBufPosition_(externalBufPosition),
|
||||||
tag_(tag),
|
tag_(tag),
|
||||||
messageSize_(0)
|
messageSize_(0)
|
||||||
{
|
{
|
||||||
@ -122,7 +123,7 @@ Foam::UIPstream::UIPstream(const int fromProcNo, PstreamBuffers& buffers)
|
|||||||
Istream(buffers.format_, buffers.version_),
|
Istream(buffers.format_, buffers.version_),
|
||||||
fromProcNo_(fromProcNo),
|
fromProcNo_(fromProcNo),
|
||||||
externalBuf_(buffers.recvBuf_[fromProcNo]),
|
externalBuf_(buffers.recvBuf_[fromProcNo]),
|
||||||
externalBufPosition_(0),
|
externalBufPosition_(buffers.recvBufPos_[fromProcNo]),
|
||||||
tag_(buffers.tag_),
|
tag_(buffers.tag_),
|
||||||
messageSize_(0)
|
messageSize_(0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -45,7 +45,7 @@ bool Foam::UOPstream::write
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "UIPstream::write : starting write to:" << toProcNo
|
Pout<< "UOPstream::write : starting write to:" << toProcNo
|
||||||
<< " tag:" << tag << " size:" << label(bufSize)
|
<< " tag:" << tag << " size:" << label(bufSize)
|
||||||
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
||||||
<< Foam::endl;
|
<< Foam::endl;
|
||||||
@ -67,7 +67,7 @@ bool Foam::UOPstream::write
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "UIPstream::write : finished write to:" << toProcNo
|
Pout<< "UOPstream::write : finished write to:" << toProcNo
|
||||||
<< " tag:" << tag << " size:" << label(bufSize)
|
<< " tag:" << tag << " size:" << label(bufSize)
|
||||||
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
||||||
<< Foam::endl;
|
<< Foam::endl;
|
||||||
@ -87,7 +87,7 @@ bool Foam::UOPstream::write
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "UIPstream::write : finished write to:" << toProcNo
|
Pout<< "UOPstream::write : finished write to:" << toProcNo
|
||||||
<< " tag:" << tag << " size:" << label(bufSize)
|
<< " tag:" << tag << " size:" << label(bufSize)
|
||||||
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
||||||
<< Foam::endl;
|
<< Foam::endl;
|
||||||
@ -110,7 +110,7 @@ bool Foam::UOPstream::write
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "UIPstream::write : started write to:" << toProcNo
|
Pout<< "UOPstream::write : started write to:" << toProcNo
|
||||||
<< " tag:" << tag << " size:" << label(bufSize)
|
<< " tag:" << tag << " size:" << label(bufSize)
|
||||||
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
||||||
<< " request:" << PstreamGlobals::outstandingRequests_.size()
|
<< " request:" << PstreamGlobals::outstandingRequests_.size()
|
||||||
|
|||||||
@ -21,13 +21,12 @@ $(constraintFvPatches)/symmetry/symmetryFvPatch.C
|
|||||||
$(constraintFvPatches)/wedge/wedgeFvPatch.C
|
$(constraintFvPatches)/wedge/wedgeFvPatch.C
|
||||||
$(constraintFvPatches)/cyclic/cyclicFvPatch.C
|
$(constraintFvPatches)/cyclic/cyclicFvPatch.C
|
||||||
$(constraintFvPatches)/processor/processorFvPatch.C
|
$(constraintFvPatches)/processor/processorFvPatch.C
|
||||||
|
$(constraintFvPatches)/processorCyclic/processorCyclicFvPatch.C
|
||||||
|
|
||||||
derivedFvPatches = $(fvPatches)/derived
|
derivedFvPatches = $(fvPatches)/derived
|
||||||
$(derivedFvPatches)/wall/wallFvPatch.C
|
$(derivedFvPatches)/wall/wallFvPatch.C
|
||||||
/*
|
|
||||||
$(derivedFvPatches)/directMapped/directMappedFvPatch.C
|
$(derivedFvPatches)/directMapped/directMappedFvPatch.C
|
||||||
$(derivedFvPatches)/directMapped/directMappedWallFvPatch.C
|
$(derivedFvPatches)/directMapped/directMappedWallFvPatch.C
|
||||||
*/
|
|
||||||
|
|
||||||
wallDist = fvMesh/wallDist
|
wallDist = fvMesh/wallDist
|
||||||
$(wallDist)/wallPointYPlus/wallPointYPlus.C
|
$(wallDist)/wallPointYPlus/wallPointYPlus.C
|
||||||
@ -101,6 +100,8 @@ $(constraintFvPatchFields)/empty/emptyFvPatchFields.C
|
|||||||
$(constraintFvPatchFields)/jumpCyclic/jumpCyclicFvPatchFields.C
|
$(constraintFvPatchFields)/jumpCyclic/jumpCyclicFvPatchFields.C
|
||||||
$(constraintFvPatchFields)/processor/processorFvPatchFields.C
|
$(constraintFvPatchFields)/processor/processorFvPatchFields.C
|
||||||
$(constraintFvPatchFields)/processor/processorFvPatchScalarField.C
|
$(constraintFvPatchFields)/processor/processorFvPatchScalarField.C
|
||||||
|
$(constraintFvPatchFields)/processorCyclic/processorCyclicFvPatchFields.C
|
||||||
|
$(constraintFvPatchFields)/processorCyclic/processorCyclicFvPatchScalarField.C
|
||||||
$(constraintFvPatchFields)/symmetry/symmetryFvPatchFields.C
|
$(constraintFvPatchFields)/symmetry/symmetryFvPatchFields.C
|
||||||
$(constraintFvPatchFields)/wedge/wedgeFvPatchFields.C
|
$(constraintFvPatchFields)/wedge/wedgeFvPatchFields.C
|
||||||
$(constraintFvPatchFields)/wedge/wedgeFvPatchScalarField.C
|
$(constraintFvPatchFields)/wedge/wedgeFvPatchScalarField.C
|
||||||
@ -109,15 +110,12 @@ derivedFvPatchFields = $(fvPatchFields)/derived
|
|||||||
$(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
|
$(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
|
||||||
$(derivedFvPatchFields)/advective/advectiveFvPatchFields.C
|
$(derivedFvPatchFields)/advective/advectiveFvPatchFields.C
|
||||||
|
|
||||||
/*
|
|
||||||
$(derivedFvPatchFields)/directMappedFixedValue/directMappedFixedValueFvPatchFields.C
|
$(derivedFvPatchFields)/directMappedFixedValue/directMappedFixedValueFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
|
$(derivedFvPatchFields)/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
|
||||||
$(derivedFvPatchFields)/fan/fanFvPatchFields.C
|
$(derivedFvPatchFields)/fan/fanFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C
|
$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C
|
||||||
$(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C
|
$(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C
|
||||||
*/
|
|
||||||
$(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C
|
$(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C
|
||||||
/*
|
|
||||||
$(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C
|
$(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C
|
$(derivedFvPatchFields)/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C
|
||||||
$(derivedFvPatchFields)/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C
|
$(derivedFvPatchFields)/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C
|
||||||
@ -156,7 +154,6 @@ $(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityK
|
|||||||
$(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C
|
$(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C
|
$(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
|
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
|
||||||
*/
|
|
||||||
|
|
||||||
fvsPatchFields = fields/fvsPatchFields
|
fvsPatchFields = fields/fvsPatchFields
|
||||||
$(fvsPatchFields)/fvsPatchField/fvsPatchFields.C
|
$(fvsPatchFields)/fvsPatchField/fvsPatchFields.C
|
||||||
@ -171,6 +168,7 @@ constraintFvsPatchFields = $(fvsPatchFields)/constraint
|
|||||||
$(constraintFvsPatchFields)/cyclic/cyclicFvsPatchFields.C
|
$(constraintFvsPatchFields)/cyclic/cyclicFvsPatchFields.C
|
||||||
$(constraintFvsPatchFields)/empty/emptyFvsPatchFields.C
|
$(constraintFvsPatchFields)/empty/emptyFvsPatchFields.C
|
||||||
$(constraintFvsPatchFields)/processor/processorFvsPatchFields.C
|
$(constraintFvsPatchFields)/processor/processorFvsPatchFields.C
|
||||||
|
$(constraintFvsPatchFields)/processorCyclic/processorCyclicFvsPatchFields.C
|
||||||
$(constraintFvsPatchFields)/symmetry/symmetryFvsPatchFields.C
|
$(constraintFvsPatchFields)/symmetry/symmetryFvsPatchFields.C
|
||||||
$(constraintFvsPatchFields)/wedge/wedgeFvsPatchFields.C
|
$(constraintFvsPatchFields)/wedge/wedgeFvsPatchFields.C
|
||||||
|
|
||||||
@ -206,7 +204,6 @@ $(surfaceInterpolation)/surfaceInterpolationScheme/surfaceInterpolationSchemes.C
|
|||||||
schemes = $(surfaceInterpolation)/schemes
|
schemes = $(surfaceInterpolation)/schemes
|
||||||
$(schemes)/linear/linear.C
|
$(schemes)/linear/linear.C
|
||||||
$(schemes)/midPoint/midPoint.C
|
$(schemes)/midPoint/midPoint.C
|
||||||
/*
|
|
||||||
$(schemes)/downwind/downwind.C
|
$(schemes)/downwind/downwind.C
|
||||||
$(schemes)/weighted/weighted.C
|
$(schemes)/weighted/weighted.C
|
||||||
$(schemes)/cubic/cubic.C
|
$(schemes)/cubic/cubic.C
|
||||||
@ -221,6 +218,7 @@ $(schemes)/localBlended/localBlended.C
|
|||||||
$(schemes)/localMax/localMax.C
|
$(schemes)/localMax/localMax.C
|
||||||
$(schemes)/localMin/localMin.C
|
$(schemes)/localMin/localMin.C
|
||||||
|
|
||||||
|
/*
|
||||||
$(schemes)/linearFit/linearFit.C
|
$(schemes)/linearFit/linearFit.C
|
||||||
$(schemes)/biLinearFit/biLinearFit.C
|
$(schemes)/biLinearFit/biLinearFit.C
|
||||||
$(schemes)/quadraticLinearFit/quadraticLinearFit.C
|
$(schemes)/quadraticLinearFit/quadraticLinearFit.C
|
||||||
@ -236,7 +234,6 @@ $(schemes)/linearPureUpwindFit/linearPureUpwindFit.C
|
|||||||
limitedSchemes = $(surfaceInterpolation)/limitedSchemes
|
limitedSchemes = $(surfaceInterpolation)/limitedSchemes
|
||||||
$(limitedSchemes)/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationSchemes.C
|
$(limitedSchemes)/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationSchemes.C
|
||||||
$(limitedSchemes)/upwind/upwind.C
|
$(limitedSchemes)/upwind/upwind.C
|
||||||
/*
|
|
||||||
$(limitedSchemes)/blended/blended.C
|
$(limitedSchemes)/blended/blended.C
|
||||||
$(limitedSchemes)/linearUpwind/linearUpwind.C
|
$(limitedSchemes)/linearUpwind/linearUpwind.C
|
||||||
$(limitedSchemes)/linearUpwind/linearUpwindV.C
|
$(limitedSchemes)/linearUpwind/linearUpwindV.C
|
||||||
@ -258,7 +255,6 @@ $(limitedSchemes)/filteredLinear/filteredLinear.C
|
|||||||
$(limitedSchemes)/filteredLinear2/filteredLinear2.C
|
$(limitedSchemes)/filteredLinear2/filteredLinear2.C
|
||||||
$(limitedSchemes)/filteredLinear3/filteredLinear3.C
|
$(limitedSchemes)/filteredLinear3/filteredLinear3.C
|
||||||
$(limitedSchemes)/limitWith/limitWith.C
|
$(limitedSchemes)/limitWith/limitWith.C
|
||||||
*/
|
|
||||||
|
|
||||||
multivariateSchemes = $(surfaceInterpolation)/multivariateSchemes
|
multivariateSchemes = $(surfaceInterpolation)/multivariateSchemes
|
||||||
$(multivariateSchemes)/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationSchemes.C
|
$(multivariateSchemes)/multivariateSurfaceInterpolationScheme/multivariateSurfaceInterpolationSchemes.C
|
||||||
@ -340,7 +336,6 @@ general = cfdTools/general
|
|||||||
$(general)/findRefCell/findRefCell.C
|
$(general)/findRefCell/findRefCell.C
|
||||||
$(general)/adjustPhi/adjustPhi.C
|
$(general)/adjustPhi/adjustPhi.C
|
||||||
$(general)/bound/bound.C
|
$(general)/bound/bound.C
|
||||||
/*
|
|
||||||
porousMedia = $(general)/porousMedia
|
porousMedia = $(general)/porousMedia
|
||||||
$(porousMedia)/porousZone.C
|
$(porousMedia)/porousZone.C
|
||||||
$(porousMedia)/porousZones.C
|
$(porousMedia)/porousZones.C
|
||||||
@ -363,6 +358,5 @@ $(fieldSources)/timeActivatedExplicitCellSource/timeActivatedExplicitCellSource.
|
|||||||
$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.C
|
$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.C
|
||||||
$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourceProperties.C
|
$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourceProperties.C
|
||||||
$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourcePropertiesIO.C
|
$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourcePropertiesIO.C
|
||||||
*/
|
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libfiniteVolume
|
LIB = $(FOAM_LIBBIN)/libfiniteVolume
|
||||||
|
|||||||
@ -109,9 +109,9 @@ cyclicFvPatchField<Type>::cyclicFvPatchField
|
|||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
Pout<< "Construct from dictionary for " << p.name() << endl
|
// Pout<< "Construct from dictionary for " << p.name() << endl
|
||||||
<< "Underlying cyclic:" << cyclicPatch_.name()
|
// << "Underlying cyclic:" << cyclicPatch_.name()
|
||||||
<< " with parallel:" << cyclicPatch_.parallel() << endl;
|
// << " with parallel:" << cyclicPatch_.parallel() << endl;
|
||||||
|
|
||||||
this->coupledFvPatchField<Type>::evaluate(Pstream::blocking);
|
this->coupledFvPatchField<Type>::evaluate(Pstream::blocking);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -100,7 +100,8 @@ template<class Type>
|
|||||||
tmp<Field<Type> > jumpCyclicFvPatchField<Type>::patchNeighbourField() const
|
tmp<Field<Type> > jumpCyclicFvPatchField<Type>::patchNeighbourField() const
|
||||||
{
|
{
|
||||||
const Field<Type>& iField = this->internalField();
|
const Field<Type>& iField = this->internalField();
|
||||||
const unallocLabelList& faceCells = this->cyclicPatch().faceCells();
|
const unallocLabelList& nbrFaceCells =
|
||||||
|
this->cyclicPatch().neighbFvPatch().faceCells();
|
||||||
|
|
||||||
tmp<Field<Type> > tpnf(new Field<Type>(this->size()));
|
tmp<Field<Type> > tpnf(new Field<Type>(this->size()));
|
||||||
Field<Type>& pnf = tpnf();
|
Field<Type>& pnf = tpnf();
|
||||||
@ -108,29 +109,21 @@ tmp<Field<Type> > jumpCyclicFvPatchField<Type>::patchNeighbourField() const
|
|||||||
tmp<Field<scalar> > tjf = jump();
|
tmp<Field<scalar> > tjf = jump();
|
||||||
const Field<scalar>& jf = tjf();
|
const Field<scalar>& jf = tjf();
|
||||||
|
|
||||||
label sizeby2 = this->size()/2;
|
|
||||||
|
|
||||||
if (this->doTransform())
|
if (this->doTransform())
|
||||||
{
|
{
|
||||||
for (label facei=0; facei<sizeby2; facei++)
|
forAll(*this, facei)
|
||||||
{
|
{
|
||||||
pnf[facei] = transform
|
pnf[facei] = transform
|
||||||
(
|
(
|
||||||
this->forwardT()[0], iField[faceCells[facei + sizeby2]]
|
this->forwardT(), iField[nbrFaceCells[facei]]
|
||||||
) - jf[facei];
|
) - jf[facei];
|
||||||
|
|
||||||
pnf[facei + sizeby2] = transform
|
|
||||||
(
|
|
||||||
this->reverseT()[0], iField[faceCells[facei]] + jf[facei]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (label facei=0; facei<sizeby2; facei++)
|
forAll(*this, facei)
|
||||||
{
|
{
|
||||||
pnf[facei] = iField[faceCells[facei + sizeby2]] - jf[facei];
|
pnf[facei] = iField[nbrFaceCells[facei]] - jf[facei];
|
||||||
pnf[facei + sizeby2] = iField[faceCells[facei]] + jf[facei];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,26 +144,24 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
|
|||||||
{
|
{
|
||||||
scalarField pnf(this->size());
|
scalarField pnf(this->size());
|
||||||
|
|
||||||
label sizeby2 = this->size()/2;
|
const unallocLabelList& nbrFaceCells =
|
||||||
const unallocLabelList& faceCells = this->cyclicPatch().faceCells();
|
this->cyclicPatch().neighbFvPatch().faceCells();
|
||||||
|
|
||||||
if (&psiInternal == &this->internalField())
|
if (&psiInternal == &this->internalField())
|
||||||
{
|
{
|
||||||
tmp<Field<scalar> > tjf = jump();
|
tmp<Field<scalar> > tjf = jump();
|
||||||
const Field<scalar>& jf = tjf();
|
const Field<scalar>& jf = tjf();
|
||||||
|
|
||||||
for (label facei=0; facei<sizeby2; facei++)
|
forAll(*this, facei)
|
||||||
{
|
{
|
||||||
pnf[facei] = psiInternal[faceCells[facei + sizeby2]] - jf[facei];
|
pnf[facei] = psiInternal[nbrFaceCells[facei]] - jf[facei];
|
||||||
pnf[facei + sizeby2] = psiInternal[faceCells[facei]] + jf[facei];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (label facei=0; facei<sizeby2; facei++)
|
forAll(*this, facei)
|
||||||
{
|
{
|
||||||
pnf[facei] = psiInternal[faceCells[facei + sizeby2]];
|
pnf[facei] = psiInternal[nbrFaceCells[facei]];
|
||||||
pnf[facei + sizeby2] = psiInternal[faceCells[facei]];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,6 +169,7 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
|
|||||||
this->transformCoupleField(pnf, cmpt);
|
this->transformCoupleField(pnf, cmpt);
|
||||||
|
|
||||||
// Multiply the field by coefficients and add into the result
|
// Multiply the field by coefficients and add into the result
|
||||||
|
const unallocLabelList& faceCells = this->cyclicPatch().faceCells();
|
||||||
forAll(faceCells, elemI)
|
forAll(faceCells, elemI)
|
||||||
{
|
{
|
||||||
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
|
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
|
||||||
|
|||||||
@ -74,7 +74,7 @@ processorFvPatchField<Type>::processorFvPatchField
|
|||||||
coupledFvPatchField<Type>(ptf, p, iF, mapper),
|
coupledFvPatchField<Type>(ptf, p, iF, mapper),
|
||||||
procPatch_(refCast<const processorFvPatch>(p))
|
procPatch_(refCast<const processorFvPatch>(p))
|
||||||
{
|
{
|
||||||
if (!isType<processorFvPatch>(this->patch()))
|
if (!isA<processorFvPatch>(this->patch()))
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
@ -106,7 +106,7 @@ processorFvPatchField<Type>::processorFvPatchField
|
|||||||
coupledFvPatchField<Type>(p, iF, dict),
|
coupledFvPatchField<Type>(p, iF, dict),
|
||||||
procPatch_(refCast<const processorFvPatch>(p))
|
procPatch_(refCast<const processorFvPatch>(p))
|
||||||
{
|
{
|
||||||
if (!isType<processorFvPatch>(p))
|
if (!isA<processorFvPatch>(p))
|
||||||
{
|
{
|
||||||
FatalIOErrorIn
|
FatalIOErrorIn
|
||||||
(
|
(
|
||||||
|
|||||||
@ -0,0 +1,267 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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 "processorCyclicFvPatchField.H"
|
||||||
|
#include "processorCyclicFvPatch.H"
|
||||||
|
#include "demandDrivenData.H"
|
||||||
|
#include "transformField.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<Type, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
//coupledFvPatchField<Type>(p, iF),
|
||||||
|
processorFvPatchField<Type>(p, iF),
|
||||||
|
procPatch_(refCast<const processorCyclicFvPatch>(p))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<Type, volMesh>& iF,
|
||||||
|
const Field<Type>& f
|
||||||
|
)
|
||||||
|
:
|
||||||
|
//coupledFvPatchField<Type>(p, iF, f),
|
||||||
|
processorFvPatchField<Type>(p, iF, f),
|
||||||
|
procPatch_(refCast<const processorCyclicFvPatch>(p))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Construct by mapping given processorCyclicFvPatchField<Type>
|
||||||
|
template<class Type>
|
||||||
|
processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
||||||
|
(
|
||||||
|
const processorCyclicFvPatchField<Type>& ptf,
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<Type, volMesh>& iF,
|
||||||
|
const fvPatchFieldMapper& mapper
|
||||||
|
)
|
||||||
|
:
|
||||||
|
//coupledFvPatchField<Type>(ptf, p, iF, mapper),
|
||||||
|
processorFvPatchField<Type>(ptf, p, iF, mapper),
|
||||||
|
procPatch_(refCast<const processorCyclicFvPatch>(p))
|
||||||
|
{
|
||||||
|
if (!isType<processorCyclicFvPatch>(this->patch()))
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"processorCyclicFvPatchField<Type>::processorCyclicFvPatchField\n"
|
||||||
|
"(\n"
|
||||||
|
" const processorCyclicFvPatchField<Type>& ptf,\n"
|
||||||
|
" const fvPatch& p,\n"
|
||||||
|
" const DimensionedField<Type, volMesh>& iF,\n"
|
||||||
|
" const fvPatchFieldMapper& mapper\n"
|
||||||
|
")\n"
|
||||||
|
) << "\n patch type '" << p.type()
|
||||||
|
<< "' not constraint type '" << typeName << "'"
|
||||||
|
<< "\n for patch " << p.name()
|
||||||
|
<< " of field " << this->dimensionedInternalField().name()
|
||||||
|
<< " in file " << this->dimensionedInternalField().objectPath()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<Type, volMesh>& iF,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
//coupledFvPatchField<Type>(p, iF, dict),
|
||||||
|
processorFvPatchField<Type>(p, iF, dict),
|
||||||
|
procPatch_(refCast<const processorCyclicFvPatch>(p))
|
||||||
|
{
|
||||||
|
if (!isType<processorCyclicFvPatch>(p))
|
||||||
|
{
|
||||||
|
FatalIOErrorIn
|
||||||
|
(
|
||||||
|
"processorCyclicFvPatchField<Type>::processorCyclicFvPatchField\n"
|
||||||
|
"(\n"
|
||||||
|
" const fvPatch& p,\n"
|
||||||
|
" const Field<Type>& field,\n"
|
||||||
|
" const dictionary& dict\n"
|
||||||
|
")\n",
|
||||||
|
dict
|
||||||
|
) << "\n patch type '" << p.type()
|
||||||
|
<< "' not constraint type '" << typeName << "'"
|
||||||
|
<< "\n for patch " << p.name()
|
||||||
|
<< " of field " << this->dimensionedInternalField().name()
|
||||||
|
<< " in file " << this->dimensionedInternalField().objectPath()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
||||||
|
(
|
||||||
|
const processorCyclicFvPatchField<Type>& ptf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
//processorLduInterfaceField(),
|
||||||
|
//coupledFvPatchField<Type>(ptf),
|
||||||
|
processorFvPatchField<Type>(ptf),
|
||||||
|
procPatch_(refCast<const processorCyclicFvPatch>(ptf.patch()))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
|
||||||
|
(
|
||||||
|
const processorCyclicFvPatchField<Type>& ptf,
|
||||||
|
const DimensionedField<Type, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
//coupledFvPatchField<Type>(ptf, iF),
|
||||||
|
processorFvPatchField<Type>(ptf, iF),
|
||||||
|
procPatch_(refCast<const processorCyclicFvPatch>(ptf.patch()))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
processorCyclicFvPatchField<Type>::~processorCyclicFvPatchField()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//template<class Type>
|
||||||
|
//tmp<Field<Type> > processorCyclicFvPatchField<Type>::patchNeighbourField() const
|
||||||
|
//{
|
||||||
|
// return *this;
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//template<class Type>
|
||||||
|
//void processorCyclicFvPatchField<Type>::initEvaluate
|
||||||
|
//(
|
||||||
|
// const Pstream::commsTypes commsType
|
||||||
|
//)
|
||||||
|
//{
|
||||||
|
// if (Pstream::parRun())
|
||||||
|
// {
|
||||||
|
// procPatch_.compressedSend(commsType, this->patchInternalField()());
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//template<class Type>
|
||||||
|
//void processorCyclicFvPatchField<Type>::evaluate
|
||||||
|
//(
|
||||||
|
// const Pstream::commsTypes commsType
|
||||||
|
//)
|
||||||
|
//{
|
||||||
|
// if (Pstream::parRun())
|
||||||
|
// {
|
||||||
|
// procPatch_.compressedReceive<Type>(commsType, *this);
|
||||||
|
//
|
||||||
|
// if (doTransform())
|
||||||
|
// {
|
||||||
|
// transform(*this, procPatch_.forwardT(), *this);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//template<class Type>
|
||||||
|
//tmp<Field<Type> > processorCyclicFvPatchField<Type>::snGrad() const
|
||||||
|
//{
|
||||||
|
// return this->patch().deltaCoeffs()*(*this - this->patchInternalField());
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//template<class Type>
|
||||||
|
//void processorCyclicFvPatchField<Type>::initInterfaceMatrixUpdate
|
||||||
|
//(
|
||||||
|
// const scalarField& psiInternal,
|
||||||
|
// scalarField&,
|
||||||
|
// const lduMatrix&,
|
||||||
|
// const scalarField&,
|
||||||
|
// const direction,
|
||||||
|
// const Pstream::commsTypes commsType
|
||||||
|
//) const
|
||||||
|
//{
|
||||||
|
// procPatch_.compressedSend
|
||||||
|
// (
|
||||||
|
// commsType,
|
||||||
|
// this->patch().patchInternalField(psiInternal)()
|
||||||
|
// );
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//template<class Type>
|
||||||
|
//void processorCyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||||
|
//(
|
||||||
|
// const scalarField&,
|
||||||
|
// scalarField& result,
|
||||||
|
// const lduMatrix&,
|
||||||
|
// const scalarField& coeffs,
|
||||||
|
// const direction cmpt,
|
||||||
|
// const Pstream::commsTypes commsType
|
||||||
|
//) const
|
||||||
|
//{
|
||||||
|
// scalarField pnf
|
||||||
|
// (
|
||||||
|
// procPatch_.compressedReceive<scalar>(commsType, this->size())()
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// // Transform according to the transformation tensor
|
||||||
|
// transformCoupleField(pnf, cmpt);
|
||||||
|
//
|
||||||
|
// // Multiply the field by coefficients and add into the result
|
||||||
|
//
|
||||||
|
// const unallocLabelList& faceCells = this->patch().faceCells();
|
||||||
|
//
|
||||||
|
// forAll(faceCells, elemI)
|
||||||
|
// {
|
||||||
|
// result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,338 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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::processorCyclicFvPatchField
|
||||||
|
|
||||||
|
Description
|
||||||
|
Foam::processorCyclicFvPatchField
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
processorCyclicFvPatchField.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef processorCyclicFvPatchField_H
|
||||||
|
#define processorCyclicFvPatchField_H
|
||||||
|
|
||||||
|
//#include "coupledFvPatchField.H"
|
||||||
|
//#include "processorLduInterfaceField.H"
|
||||||
|
#include "processorCyclicFvPatch.H"
|
||||||
|
#include "processorFvPatchField.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class processorCyclicFvPatch Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
class processorCyclicFvPatchField
|
||||||
|
:
|
||||||
|
// public processorLduInterfaceField,
|
||||||
|
// public coupledFvPatchField<Type>
|
||||||
|
public processorFvPatchField<Type>
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Local reference cast into the processor patch
|
||||||
|
const processorCyclicFvPatch& procPatch_;
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
// //- Get other patchfield
|
||||||
|
// const coupledFvPatchField<Type>& patchField(const label patchID) const;
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName(processorCyclicFvPatch::typeName_());
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from patch and internal field
|
||||||
|
processorCyclicFvPatchField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<Type, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from patch and internal field and patch field
|
||||||
|
processorCyclicFvPatchField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<Type, volMesh>&,
|
||||||
|
const Field<Type>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from patch, internal field and dictionary
|
||||||
|
processorCyclicFvPatchField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<Type, volMesh>&,
|
||||||
|
const dictionary&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct by mapping given processorCyclicFvPatchField onto a
|
||||||
|
// new patch
|
||||||
|
processorCyclicFvPatchField
|
||||||
|
(
|
||||||
|
const processorCyclicFvPatchField<Type>&,
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<Type, volMesh>&,
|
||||||
|
const fvPatchFieldMapper&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct as copy
|
||||||
|
processorCyclicFvPatchField(const processorCyclicFvPatchField<Type>&);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual tmp<fvPatchField<Type> > clone() const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchField<Type> >
|
||||||
|
(
|
||||||
|
new processorCyclicFvPatchField<Type>(*this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Construct as copy setting internal field reference
|
||||||
|
processorCyclicFvPatchField
|
||||||
|
(
|
||||||
|
const processorCyclicFvPatchField<Type>&,
|
||||||
|
const DimensionedField<Type, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone setting internal field reference
|
||||||
|
virtual tmp<fvPatchField<Type> > clone
|
||||||
|
(
|
||||||
|
const DimensionedField<Type, volMesh>& iF
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchField<Type> >
|
||||||
|
(
|
||||||
|
new processorCyclicFvPatchField<Type>(*this, iF)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
|
||||||
|
~processorCyclicFvPatchField();
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
// //- Return true if running parallel
|
||||||
|
// virtual bool coupled() const
|
||||||
|
// {
|
||||||
|
// if (Pstream::parRun())
|
||||||
|
// {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //- Return neighbour field given internal field
|
||||||
|
// tmp<Field<Type> > patchNeighbourField() const;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// // Evaluation functions
|
||||||
|
//
|
||||||
|
// //- Initialise the evaluation of the patch field
|
||||||
|
// virtual void initEvaluate(const Pstream::commsTypes commsType);
|
||||||
|
//
|
||||||
|
// //- Evaluate the patch field
|
||||||
|
// virtual void evaluate(const Pstream::commsTypes commsType);
|
||||||
|
//
|
||||||
|
// //- Return patch-normal gradient
|
||||||
|
// virtual tmp<Field<Type> > snGrad() const;
|
||||||
|
//
|
||||||
|
// //- Initialise neighbour matrix update
|
||||||
|
// virtual void initInterfaceMatrixUpdate
|
||||||
|
// (
|
||||||
|
// const scalarField& psiInternal,
|
||||||
|
// scalarField& result,
|
||||||
|
// const lduMatrix& m,
|
||||||
|
// const scalarField& coeffs,
|
||||||
|
// const direction cmpt,
|
||||||
|
// const Pstream::commsTypes commsType
|
||||||
|
// ) const;
|
||||||
|
//
|
||||||
|
// //- Update result field based on interface functionality
|
||||||
|
// virtual void updateInterfaceMatrix
|
||||||
|
// (
|
||||||
|
// const scalarField& psiInternal,
|
||||||
|
// scalarField& result,
|
||||||
|
// const lduMatrix& m,
|
||||||
|
// const scalarField& coeffs,
|
||||||
|
// const direction cmpt,
|
||||||
|
// const Pstream::commsTypes commsType
|
||||||
|
// ) const;
|
||||||
|
//
|
||||||
|
// //- Processor coupled interface functions
|
||||||
|
//
|
||||||
|
// //- Return processor number
|
||||||
|
// virtual int myProcNo() const
|
||||||
|
// {
|
||||||
|
// return procPatch_.myProcNo();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //- Return neigbour processor number
|
||||||
|
// virtual int neighbProcNo() const
|
||||||
|
// {
|
||||||
|
// return procPatch_.neighbProcNo();
|
||||||
|
// }
|
||||||
|
|
||||||
|
//- Does the patch field perform the transfromation
|
||||||
|
virtual bool doTransform() const
|
||||||
|
{
|
||||||
|
return !(procPatch_.parallel() || pTraits<Type>::rank == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return face transformation tensor
|
||||||
|
virtual const tensor& forwardT() const
|
||||||
|
{
|
||||||
|
return procPatch_.forwardT();
|
||||||
|
}
|
||||||
|
|
||||||
|
// //- Return rank of component for transform
|
||||||
|
// virtual int rank() const
|
||||||
|
// {
|
||||||
|
// return pTraits<Type>::rank;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// //- Transform given patch component field
|
||||||
|
// void transformCoupleField
|
||||||
|
// (
|
||||||
|
// scalarField& f,
|
||||||
|
// const direction cmpt
|
||||||
|
// ) const;
|
||||||
|
|
||||||
|
// // Referred-patch functionality. Get called with a slice (size, start)
|
||||||
|
// // of a patch that supplies fields and geometry/topology.
|
||||||
|
//
|
||||||
|
// //- Get patch-normal gradient
|
||||||
|
// virtual void snGrad
|
||||||
|
// (
|
||||||
|
// Field<Type>& exchangeBuf,
|
||||||
|
// const Field<Type>& subFld,
|
||||||
|
// const coupledFvPatch& referringPatch,
|
||||||
|
// const label size,
|
||||||
|
// const label start
|
||||||
|
// ) const
|
||||||
|
// {
|
||||||
|
// notImplemented("processorCyclicFvPatchField::snGrad(..)");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //- Initialise the evaluation of the patch field.
|
||||||
|
// virtual void initEvaluate
|
||||||
|
// (
|
||||||
|
// Field<Type>& exchangeBuf,
|
||||||
|
// const coupledFvPatch& referringPatch,
|
||||||
|
// const label size,
|
||||||
|
// const label start
|
||||||
|
// ) const
|
||||||
|
// {
|
||||||
|
// notImplemented("processorCyclicFvPatchField::initEvaluate(..)");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //- Evaluate the patch field.
|
||||||
|
// virtual void evaluate
|
||||||
|
// (
|
||||||
|
// Field<Type>& exchangeBuf,
|
||||||
|
// const coupledFvPatch& referringPatch,
|
||||||
|
// const label size,
|
||||||
|
// const label start
|
||||||
|
// ) const
|
||||||
|
// {
|
||||||
|
// notImplemented("processorCyclicFvPatchField::evaluate(..)");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //- Initialise neighbour matrix update
|
||||||
|
// virtual void initInterfaceMatrixUpdate
|
||||||
|
// (
|
||||||
|
// const scalarField& psiInternal,
|
||||||
|
// scalarField& result,
|
||||||
|
// const lduMatrix& m,
|
||||||
|
// const scalarField& coeffs,
|
||||||
|
// const direction cmpt,
|
||||||
|
// const coupledFvPatch& referringPatch,
|
||||||
|
// const label size,
|
||||||
|
// const label start,
|
||||||
|
// scalarField& exchangeBuf
|
||||||
|
// ) const
|
||||||
|
// {
|
||||||
|
// notImplemented
|
||||||
|
// (
|
||||||
|
// "processorCyclicFvPatchField::initInterfaceMatrixUpdate(..)"
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //- Update result field based on interface functionality
|
||||||
|
// virtual void updateInterfaceMatrix
|
||||||
|
// (
|
||||||
|
// const scalarField& psiInternal,
|
||||||
|
// scalarField& result,
|
||||||
|
// const lduMatrix&,
|
||||||
|
// const scalarField& coeffs,
|
||||||
|
// const direction,
|
||||||
|
// const coupledFvPatch& referringPatch,
|
||||||
|
// const label size,
|
||||||
|
// const label start,
|
||||||
|
// scalarField& exchangeBuf
|
||||||
|
// ) const
|
||||||
|
// {
|
||||||
|
// notImplemented
|
||||||
|
// (
|
||||||
|
// "processorCyclicFvPatchField::updateInterfaceMatrix(..)"
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "processorCyclicFvPatchField.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -24,7 +24,7 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "processorFvPatchFields.H"
|
#include "processorCyclicFvPatchFields.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
|
||||||
@ -35,8 +35,8 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
makePatchFields(processor);
|
makePatchFields(processorCyclic);
|
||||||
//makePatchTypeField(fvPatchScalarField, processorFvPatchScalarField);
|
//makePatchTypeField(fvPatchScalarField, processorCyclicFvPatchScalarField);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -24,10 +24,10 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef processorFvPatchFields_H
|
#ifndef processorCyclicFvPatchFields_H
|
||||||
#define processorFvPatchFields_H
|
#define processorCyclicFvPatchFields_H
|
||||||
|
|
||||||
#include "processorFvPatchScalarField.H"
|
#include "processorCyclicFvPatchScalarField.H"
|
||||||
#include "fieldTypes.H"
|
#include "fieldTypes.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -37,7 +37,7 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
makePatchTypeFieldTypedefs(processor)
|
makePatchTypeFieldTypedefs(processorCyclic)
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -24,8 +24,8 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef processorFvPatchFieldsFwd_H
|
#ifndef processorCyclicFvPatchFieldsFwd_H
|
||||||
#define processorFvPatchFieldsFwd_H
|
#define processorCyclicFvPatchFieldsFwd_H
|
||||||
|
|
||||||
#include "fieldTypes.H"
|
#include "fieldTypes.H"
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type> class processorFvPatchField;
|
template<class Type> class processorCyclicFvPatchField;
|
||||||
|
|
||||||
makePatchTypeFieldTypedefs(processor)
|
makePatchTypeFieldTypedefs(processor)
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "processorFvPatchScalarField.H"
|
#include "processorCyclicFvPatchScalarField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -33,48 +33,48 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<>
|
//template<>
|
||||||
void processorFvPatchField<scalar>::initInterfaceMatrixUpdate
|
//void processorCyclicFvPatchField<scalar>::initInterfaceMatrixUpdate
|
||||||
(
|
//(
|
||||||
const scalarField& psiInternal,
|
// const scalarField& psiInternal,
|
||||||
scalarField&,
|
// scalarField&,
|
||||||
const lduMatrix&,
|
// const lduMatrix&,
|
||||||
const scalarField&,
|
// const scalarField&,
|
||||||
const direction,
|
// const direction,
|
||||||
const Pstream::commsTypes commsType
|
// const Pstream::commsTypes commsType
|
||||||
) const
|
//) const
|
||||||
{
|
//{
|
||||||
procPatch_.compressedSend
|
// procPatch_.compressedSend
|
||||||
(
|
// (
|
||||||
commsType,
|
// commsType,
|
||||||
patch().patchInternalField(psiInternal)()
|
// patch().patchInternalField(psiInternal)()
|
||||||
);
|
// );
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
|
//
|
||||||
template<>
|
//template<>
|
||||||
void processorFvPatchField<scalar>::updateInterfaceMatrix
|
//void processorCyclicFvPatchField<scalar>::updateInterfaceMatrix
|
||||||
(
|
//(
|
||||||
const scalarField&,
|
// const scalarField&,
|
||||||
scalarField& result,
|
// scalarField& result,
|
||||||
const lduMatrix&,
|
// const lduMatrix&,
|
||||||
const scalarField& coeffs,
|
// const scalarField& coeffs,
|
||||||
const direction,
|
// const direction,
|
||||||
const Pstream::commsTypes commsType
|
// const Pstream::commsTypes commsType
|
||||||
) const
|
//) const
|
||||||
{
|
//{
|
||||||
scalarField pnf
|
// scalarField pnf
|
||||||
(
|
// (
|
||||||
procPatch_.compressedReceive<scalar>(commsType, this->size())()
|
// procPatch_.compressedReceive<scalar>(commsType, this->size())()
|
||||||
);
|
// );
|
||||||
|
//
|
||||||
const unallocLabelList& faceCells = patch().faceCells();
|
// const unallocLabelList& faceCells = patch().faceCells();
|
||||||
|
//
|
||||||
forAll(faceCells, facei)
|
// forAll(faceCells, facei)
|
||||||
{
|
// {
|
||||||
result[faceCells[facei]] -= coeffs[facei]*pnf[facei];
|
// result[faceCells[facei]] -= coeffs[facei]*pnf[facei];
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -24,10 +24,10 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef processorFvPatchScalarField_H
|
#ifndef processorCyclicFvPatchScalarField_H
|
||||||
#define processorFvPatchScalarField_H
|
#define processorCyclicFvPatchScalarField_H
|
||||||
|
|
||||||
#include "processorFvPatchField.H"
|
#include "processorCyclicFvPatchField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -36,28 +36,28 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<>
|
//template<>
|
||||||
void processorFvPatchField<scalar>::initInterfaceMatrixUpdate
|
//void processorCyclicFvPatchField<scalar>::initInterfaceMatrixUpdate
|
||||||
(
|
//(
|
||||||
const scalarField&,
|
// const scalarField&,
|
||||||
scalarField&,
|
// scalarField&,
|
||||||
const lduMatrix&,
|
// const lduMatrix&,
|
||||||
const scalarField&,
|
// const scalarField&,
|
||||||
const direction,
|
// const direction,
|
||||||
const Pstream::commsTypes commsType
|
// const Pstream::commsTypes commsType
|
||||||
) const;
|
//) const;
|
||||||
|
//
|
||||||
|
//
|
||||||
template<>
|
//template<>
|
||||||
void processorFvPatchField<scalar>::updateInterfaceMatrix
|
//void processorCyclicFvPatchField<scalar>::updateInterfaceMatrix
|
||||||
(
|
//(
|
||||||
const scalarField&,
|
// const scalarField&,
|
||||||
scalarField& result,
|
// scalarField& result,
|
||||||
const lduMatrix&,
|
// const lduMatrix&,
|
||||||
const scalarField& coeffs,
|
// const scalarField& coeffs,
|
||||||
const direction,
|
// const direction,
|
||||||
const Pstream::commsTypes commsType
|
// const Pstream::commsTypes commsType
|
||||||
) const;
|
//) const;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -1,261 +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 "processorFvPatchField.H"
|
|
||||||
#include "processorFvPatch.H"
|
|
||||||
#include "demandDrivenData.H"
|
|
||||||
#include "transformField.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
processorFvPatchField<Type>::processorFvPatchField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<Type, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
coupledFvPatchField<Type>(p, iF),
|
|
||||||
procPatch_(refCast<const processorFvPatch>(p))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
processorFvPatchField<Type>::processorFvPatchField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<Type, volMesh>& iF,
|
|
||||||
const Field<Type>& f
|
|
||||||
)
|
|
||||||
:
|
|
||||||
coupledFvPatchField<Type>(p, iF, f),
|
|
||||||
procPatch_(refCast<const processorFvPatch>(p))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Construct by mapping given processorFvPatchField<Type>
|
|
||||||
template<class Type>
|
|
||||||
processorFvPatchField<Type>::processorFvPatchField
|
|
||||||
(
|
|
||||||
const processorFvPatchField<Type>& ptf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<Type, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
coupledFvPatchField<Type>(ptf, p, iF, mapper),
|
|
||||||
procPatch_(refCast<const processorFvPatch>(p))
|
|
||||||
{
|
|
||||||
if (!isType<processorFvPatch>(this->patch()))
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"processorFvPatchField<Type>::processorFvPatchField\n"
|
|
||||||
"(\n"
|
|
||||||
" const processorFvPatchField<Type>& ptf,\n"
|
|
||||||
" const fvPatch& p,\n"
|
|
||||||
" const DimensionedField<Type, volMesh>& iF,\n"
|
|
||||||
" const fvPatchFieldMapper& mapper\n"
|
|
||||||
")\n"
|
|
||||||
) << "\n patch type '" << p.type()
|
|
||||||
<< "' not constraint type '" << typeName << "'"
|
|
||||||
<< "\n for patch " << p.name()
|
|
||||||
<< " of field " << this->dimensionedInternalField().name()
|
|
||||||
<< " in file " << this->dimensionedInternalField().objectPath()
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
processorFvPatchField<Type>::processorFvPatchField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<Type, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
coupledFvPatchField<Type>(p, iF, dict),
|
|
||||||
procPatch_(refCast<const processorFvPatch>(p))
|
|
||||||
{
|
|
||||||
if (!isType<processorFvPatch>(p))
|
|
||||||
{
|
|
||||||
FatalIOErrorIn
|
|
||||||
(
|
|
||||||
"processorFvPatchField<Type>::processorFvPatchField\n"
|
|
||||||
"(\n"
|
|
||||||
" const fvPatch& p,\n"
|
|
||||||
" const Field<Type>& field,\n"
|
|
||||||
" const dictionary& dict\n"
|
|
||||||
")\n",
|
|
||||||
dict
|
|
||||||
) << "\n patch type '" << p.type()
|
|
||||||
<< "' not constraint type '" << typeName << "'"
|
|
||||||
<< "\n for patch " << p.name()
|
|
||||||
<< " of field " << this->dimensionedInternalField().name()
|
|
||||||
<< " in file " << this->dimensionedInternalField().objectPath()
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
processorFvPatchField<Type>::processorFvPatchField
|
|
||||||
(
|
|
||||||
const processorFvPatchField<Type>& ptf
|
|
||||||
)
|
|
||||||
:
|
|
||||||
processorLduInterfaceField(),
|
|
||||||
coupledFvPatchField<Type>(ptf),
|
|
||||||
procPatch_(refCast<const processorFvPatch>(ptf.patch()))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
processorFvPatchField<Type>::processorFvPatchField
|
|
||||||
(
|
|
||||||
const processorFvPatchField<Type>& ptf,
|
|
||||||
const DimensionedField<Type, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
coupledFvPatchField<Type>(ptf, iF),
|
|
||||||
procPatch_(refCast<const processorFvPatch>(ptf.patch()))
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
processorFvPatchField<Type>::~processorFvPatchField()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
tmp<Field<Type> > processorFvPatchField<Type>::patchNeighbourField() const
|
|
||||||
{
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void processorFvPatchField<Type>::initEvaluate
|
|
||||||
(
|
|
||||||
const Pstream::commsTypes commsType
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (Pstream::parRun())
|
|
||||||
{
|
|
||||||
procPatch_.compressedSend(commsType, this->patchInternalField()());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void processorFvPatchField<Type>::evaluate
|
|
||||||
(
|
|
||||||
const Pstream::commsTypes commsType
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (Pstream::parRun())
|
|
||||||
{
|
|
||||||
procPatch_.compressedReceive<Type>(commsType, *this);
|
|
||||||
|
|
||||||
if (doTransform())
|
|
||||||
{
|
|
||||||
transform(*this, procPatch_.forwardT(), *this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
tmp<Field<Type> > processorFvPatchField<Type>::snGrad() const
|
|
||||||
{
|
|
||||||
return this->patch().deltaCoeffs()*(*this - this->patchInternalField());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void processorFvPatchField<Type>::initInterfaceMatrixUpdate
|
|
||||||
(
|
|
||||||
const scalarField& psiInternal,
|
|
||||||
scalarField&,
|
|
||||||
const lduMatrix&,
|
|
||||||
const scalarField&,
|
|
||||||
const direction,
|
|
||||||
const Pstream::commsTypes commsType
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
procPatch_.compressedSend
|
|
||||||
(
|
|
||||||
commsType,
|
|
||||||
this->patch().patchInternalField(psiInternal)()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void processorFvPatchField<Type>::updateInterfaceMatrix
|
|
||||||
(
|
|
||||||
const scalarField&,
|
|
||||||
scalarField& result,
|
|
||||||
const lduMatrix&,
|
|
||||||
const scalarField& coeffs,
|
|
||||||
const direction cmpt,
|
|
||||||
const Pstream::commsTypes commsType
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
scalarField pnf
|
|
||||||
(
|
|
||||||
procPatch_.compressedReceive<scalar>(commsType, this->size())()
|
|
||||||
);
|
|
||||||
|
|
||||||
// Transform according to the transformation tensor
|
|
||||||
transformCoupleField(pnf, cmpt);
|
|
||||||
|
|
||||||
// Multiply the field by coefficients and add into the result
|
|
||||||
|
|
||||||
const unallocLabelList& faceCells = this->patch().faceCells();
|
|
||||||
|
|
||||||
forAll(faceCells, elemI)
|
|
||||||
{
|
|
||||||
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,323 +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::processorFvPatchField
|
|
||||||
|
|
||||||
Description
|
|
||||||
Foam::processorFvPatchField
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
processorFvPatchField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef processorFvPatchField_H
|
|
||||||
#define processorFvPatchField_H
|
|
||||||
|
|
||||||
#include "coupledFvPatchField.H"
|
|
||||||
#include "processorLduInterfaceField.H"
|
|
||||||
#include "processorFvPatch.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class processorFvPatch Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
class processorFvPatchField
|
|
||||||
:
|
|
||||||
public processorLduInterfaceField,
|
|
||||||
public coupledFvPatchField<Type>
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Local reference cast into the processor patch
|
|
||||||
const processorFvPatch& procPatch_;
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Get other patchfield
|
|
||||||
const coupledFvPatchField<Type>& patchField(const label patchID) const;
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName(processorFvPatch::typeName_());
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
processorFvPatchField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<Type, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch and internal field and patch field
|
|
||||||
processorFvPatchField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<Type, volMesh>&,
|
|
||||||
const Field<Type>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
processorFvPatchField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<Type, volMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given processorFvPatchField onto a new patch
|
|
||||||
processorFvPatchField
|
|
||||||
(
|
|
||||||
const processorFvPatchField<Type>&,
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<Type, volMesh>&,
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
processorFvPatchField(const processorFvPatchField<Type>&);
|
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual tmp<fvPatchField<Type> > clone() const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchField<Type> >
|
|
||||||
(
|
|
||||||
new processorFvPatchField<Type>(*this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Construct as copy setting internal field reference
|
|
||||||
processorFvPatchField
|
|
||||||
(
|
|
||||||
const processorFvPatchField<Type>&,
|
|
||||||
const DimensionedField<Type, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchField<Type> > clone
|
|
||||||
(
|
|
||||||
const DimensionedField<Type, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchField<Type> >
|
|
||||||
(
|
|
||||||
new processorFvPatchField<Type>(*this, iF)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
|
||||||
~processorFvPatchField();
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
//- Return true if running parallel
|
|
||||||
virtual bool coupled() const
|
|
||||||
{
|
|
||||||
if (Pstream::parRun())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return neighbour field given internal field
|
|
||||||
tmp<Field<Type> > patchNeighbourField() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
|
||||||
|
|
||||||
//- Initialise the evaluation of the patch field
|
|
||||||
virtual void initEvaluate(const Pstream::commsTypes commsType);
|
|
||||||
|
|
||||||
//- Evaluate the patch field
|
|
||||||
virtual void evaluate(const Pstream::commsTypes commsType);
|
|
||||||
|
|
||||||
//- Return patch-normal gradient
|
|
||||||
virtual tmp<Field<Type> > snGrad() const;
|
|
||||||
|
|
||||||
//- Initialise neighbour matrix update
|
|
||||||
virtual void initInterfaceMatrixUpdate
|
|
||||||
(
|
|
||||||
const scalarField& psiInternal,
|
|
||||||
scalarField& result,
|
|
||||||
const lduMatrix& m,
|
|
||||||
const scalarField& coeffs,
|
|
||||||
const direction cmpt,
|
|
||||||
const Pstream::commsTypes commsType
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Update result field based on interface functionality
|
|
||||||
virtual void updateInterfaceMatrix
|
|
||||||
(
|
|
||||||
const scalarField& psiInternal,
|
|
||||||
scalarField& result,
|
|
||||||
const lduMatrix& m,
|
|
||||||
const scalarField& coeffs,
|
|
||||||
const direction cmpt,
|
|
||||||
const Pstream::commsTypes commsType
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Processor coupled interface functions
|
|
||||||
|
|
||||||
//- Return processor number
|
|
||||||
virtual int myProcNo() const
|
|
||||||
{
|
|
||||||
return procPatch_.myProcNo();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return neigbour processor number
|
|
||||||
virtual int neighbProcNo() const
|
|
||||||
{
|
|
||||||
return procPatch_.neighbProcNo();
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return rank of component for transform
|
|
||||||
virtual int rank() const
|
|
||||||
{
|
|
||||||
return pTraits<Type>::rank;
|
|
||||||
}
|
|
||||||
|
|
||||||
// //- Transform given patch component field
|
|
||||||
// void transformCoupleField
|
|
||||||
// (
|
|
||||||
// scalarField& f,
|
|
||||||
// const direction cmpt
|
|
||||||
// ) const;
|
|
||||||
|
|
||||||
// Referred-patch functionality. Get called with a slice (size, start)
|
|
||||||
// of a patch that supplies fields and geometry/topology.
|
|
||||||
|
|
||||||
//- Get patch-normal gradient
|
|
||||||
virtual void snGrad
|
|
||||||
(
|
|
||||||
Field<Type>& exchangeBuf,
|
|
||||||
const Field<Type>& subFld,
|
|
||||||
const coupledFvPatch& referringPatch,
|
|
||||||
const label size,
|
|
||||||
const label start
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
notImplemented("processorFvPatchField::snGrad(..)");
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Initialise the evaluation of the patch field.
|
|
||||||
virtual void initEvaluate
|
|
||||||
(
|
|
||||||
Field<Type>& exchangeBuf,
|
|
||||||
const coupledFvPatch& referringPatch,
|
|
||||||
const label size,
|
|
||||||
const label start
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
notImplemented("processorFvPatchField::initEvaluate(..)");
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Evaluate the patch field.
|
|
||||||
virtual void evaluate
|
|
||||||
(
|
|
||||||
Field<Type>& exchangeBuf,
|
|
||||||
const coupledFvPatch& referringPatch,
|
|
||||||
const label size,
|
|
||||||
const label start
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
notImplemented("processorFvPatchField::evaluate(..)");
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Initialise neighbour matrix update
|
|
||||||
virtual void initInterfaceMatrixUpdate
|
|
||||||
(
|
|
||||||
const scalarField& psiInternal,
|
|
||||||
scalarField& result,
|
|
||||||
const lduMatrix& m,
|
|
||||||
const scalarField& coeffs,
|
|
||||||
const direction cmpt,
|
|
||||||
const coupledFvPatch& referringPatch,
|
|
||||||
const label size,
|
|
||||||
const label start,
|
|
||||||
scalarField& exchangeBuf
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
notImplemented
|
|
||||||
(
|
|
||||||
"processorFvPatchField::initInterfaceMatrixUpdate(..)"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Update result field based on interface functionality
|
|
||||||
virtual void updateInterfaceMatrix
|
|
||||||
(
|
|
||||||
const scalarField& psiInternal,
|
|
||||||
scalarField& result,
|
|
||||||
const lduMatrix&,
|
|
||||||
const scalarField& coeffs,
|
|
||||||
const direction,
|
|
||||||
const coupledFvPatch& referringPatch,
|
|
||||||
const label size,
|
|
||||||
const label start,
|
|
||||||
scalarField& exchangeBuf
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
notImplemented
|
|
||||||
(
|
|
||||||
"processorFvPatchField::updateInterfaceMatrix(..)"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#ifdef NoRepository
|
|
||||||
# include "processorFvPatchField.C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -28,6 +28,7 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
|
#include "cyclicFvPatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -45,6 +46,7 @@ activeBaffleVelocityFvPatchVectorField
|
|||||||
orientation_(1),
|
orientation_(1),
|
||||||
initWallSf_(0),
|
initWallSf_(0),
|
||||||
initCyclicSf_(0),
|
initCyclicSf_(0),
|
||||||
|
nbrCyclicSf_(0),
|
||||||
openFraction_(0),
|
openFraction_(0),
|
||||||
openingTime_(0),
|
openingTime_(0),
|
||||||
maxOpenFractionDelta_(0),
|
maxOpenFractionDelta_(0),
|
||||||
@ -68,6 +70,7 @@ activeBaffleVelocityFvPatchVectorField
|
|||||||
orientation_(ptf.orientation_),
|
orientation_(ptf.orientation_),
|
||||||
initWallSf_(ptf.initWallSf_),
|
initWallSf_(ptf.initWallSf_),
|
||||||
initCyclicSf_(ptf.initCyclicSf_),
|
initCyclicSf_(ptf.initCyclicSf_),
|
||||||
|
nbrCyclicSf_(ptf.nbrCyclicSf_),
|
||||||
openFraction_(ptf.openFraction_),
|
openFraction_(ptf.openFraction_),
|
||||||
openingTime_(ptf.openingTime_),
|
openingTime_(ptf.openingTime_),
|
||||||
maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
|
maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
|
||||||
@ -84,23 +87,25 @@ activeBaffleVelocityFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(p, iF),
|
fixedValueFvPatchVectorField(p, iF),
|
||||||
pName_("p"),
|
pName_(dict.lookupOrDefault<word>("p", "p")),
|
||||||
cyclicPatchName_(dict.lookup("cyclicPatch")),
|
cyclicPatchName_(dict.lookup("cyclicPatch")),
|
||||||
cyclicPatchLabel_(p.patch().boundaryMesh().findPatchID(cyclicPatchName_)),
|
cyclicPatchLabel_(p.patch().boundaryMesh().findPatchID(cyclicPatchName_)),
|
||||||
orientation_(readLabel(dict.lookup("orientation"))),
|
orientation_(readLabel(dict.lookup("orientation"))),
|
||||||
initWallSf_(p.Sf()),
|
initWallSf_(p.Sf()),
|
||||||
initCyclicSf_(p.boundaryMesh()[cyclicPatchLabel_].Sf()),
|
initCyclicSf_(p.boundaryMesh()[cyclicPatchLabel_].Sf()),
|
||||||
|
nbrCyclicSf_
|
||||||
|
(
|
||||||
|
refCast<const cyclicFvPatch>
|
||||||
|
(
|
||||||
|
p.boundaryMesh()[cyclicPatchLabel_]
|
||||||
|
).neighbFvPatch().Sf()
|
||||||
|
),
|
||||||
openFraction_(readScalar(dict.lookup("openFraction"))),
|
openFraction_(readScalar(dict.lookup("openFraction"))),
|
||||||
openingTime_(readScalar(dict.lookup("openingTime"))),
|
openingTime_(readScalar(dict.lookup("openingTime"))),
|
||||||
maxOpenFractionDelta_(readScalar(dict.lookup("maxOpenFractionDelta"))),
|
maxOpenFractionDelta_(readScalar(dict.lookup("maxOpenFractionDelta"))),
|
||||||
curTimeIndex_(-1)
|
curTimeIndex_(-1)
|
||||||
{
|
{
|
||||||
fvPatchVectorField::operator=(vector::zero);
|
fvPatchVectorField::operator=(vector::zero);
|
||||||
|
|
||||||
if (dict.found("p"))
|
|
||||||
{
|
|
||||||
dict.lookup("p") >> pName_;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -117,6 +122,7 @@ activeBaffleVelocityFvPatchVectorField
|
|||||||
orientation_(ptf.orientation_),
|
orientation_(ptf.orientation_),
|
||||||
initWallSf_(ptf.initWallSf_),
|
initWallSf_(ptf.initWallSf_),
|
||||||
initCyclicSf_(ptf.initCyclicSf_),
|
initCyclicSf_(ptf.initCyclicSf_),
|
||||||
|
nbrCyclicSf_(ptf.nbrCyclicSf_),
|
||||||
openFraction_(ptf.openFraction_),
|
openFraction_(ptf.openFraction_),
|
||||||
openingTime_(ptf.openingTime_),
|
openingTime_(ptf.openingTime_),
|
||||||
maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
|
maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
|
||||||
@ -138,6 +144,7 @@ activeBaffleVelocityFvPatchVectorField
|
|||||||
orientation_(ptf.orientation_),
|
orientation_(ptf.orientation_),
|
||||||
initWallSf_(ptf.initWallSf_),
|
initWallSf_(ptf.initWallSf_),
|
||||||
initCyclicSf_(ptf.initCyclicSf_),
|
initCyclicSf_(ptf.initCyclicSf_),
|
||||||
|
nbrCyclicSf_(ptf.nbrCyclicSf_),
|
||||||
openFraction_(ptf.openFraction_),
|
openFraction_(ptf.openFraction_),
|
||||||
openingTime_(ptf.openingTime_),
|
openingTime_(ptf.openingTime_),
|
||||||
maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
|
maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
|
||||||
@ -166,6 +173,13 @@ void Foam::activeBaffleVelocityFvPatchVectorField::autoMap
|
|||||||
[
|
[
|
||||||
cyclicPatchLabel_
|
cyclicPatchLabel_
|
||||||
].patchSlice(areas);
|
].patchSlice(areas);
|
||||||
|
nbrCyclicSf_ = refCast<const cyclicFvPatch>
|
||||||
|
(
|
||||||
|
patch().boundaryMesh()
|
||||||
|
[
|
||||||
|
cyclicPatchLabel_
|
||||||
|
]
|
||||||
|
).neighbFvPatch().patch().patchSlice(areas);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Foam::activeBaffleVelocityFvPatchVectorField::rmap
|
void Foam::activeBaffleVelocityFvPatchVectorField::rmap
|
||||||
@ -183,6 +197,13 @@ void Foam::activeBaffleVelocityFvPatchVectorField::rmap
|
|||||||
[
|
[
|
||||||
cyclicPatchLabel_
|
cyclicPatchLabel_
|
||||||
].patchSlice(areas);
|
].patchSlice(areas);
|
||||||
|
nbrCyclicSf_ = refCast<const cyclicFvPatch>
|
||||||
|
(
|
||||||
|
patch().boundaryMesh()
|
||||||
|
[
|
||||||
|
cyclicPatchLabel_
|
||||||
|
]
|
||||||
|
).neighbFvPatch().patch().patchSlice(areas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -203,23 +224,31 @@ void Foam::activeBaffleVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
|
|
||||||
const fvPatch& cyclicPatch = patch().boundaryMesh()[cyclicPatchLabel_];
|
const fvPatch& cyclicPatch = patch().boundaryMesh()[cyclicPatchLabel_];
|
||||||
const labelList& cyclicFaceCells = cyclicPatch.patch().faceCells();
|
const labelList& cyclicFaceCells = cyclicPatch.patch().faceCells();
|
||||||
label nCyclicFaces = cyclicFaceCells.size();
|
const fvPatch& nbrPatch = refCast<const cyclicFvPatch>
|
||||||
label nCyclicFacesPerSide = nCyclicFaces/2;
|
(
|
||||||
|
cyclicPatch
|
||||||
|
).neighbFvPatch();
|
||||||
|
const labelList& nbrFaceCells = nbrPatch.patch().faceCells();
|
||||||
|
|
||||||
scalar forceDiff = 0;
|
scalar forceDiff = 0;
|
||||||
|
|
||||||
for (label facei=0; facei<nCyclicFacesPerSide; facei++)
|
// Add this side
|
||||||
|
forAll(cyclicFaceCells, facei)
|
||||||
{
|
{
|
||||||
forceDiff += p[cyclicFaceCells[facei]]*mag(initCyclicSf_[facei]);
|
forceDiff += p[cyclicFaceCells[facei]]*mag(initCyclicSf_[facei]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (label facei=nCyclicFacesPerSide; facei<nCyclicFaces; facei++)
|
// Remove other side
|
||||||
|
forAll(nbrFaceCells, facei)
|
||||||
{
|
{
|
||||||
forceDiff -= p[cyclicFaceCells[facei]]*mag(initCyclicSf_[facei]);
|
forceDiff -= p[nbrFaceCells[facei]]*mag(nbrCyclicSf_[facei]);
|
||||||
}
|
}
|
||||||
|
|
||||||
openFraction_ =
|
openFraction_ =
|
||||||
max(min(
|
max
|
||||||
|
(
|
||||||
|
min
|
||||||
|
(
|
||||||
openFraction_
|
openFraction_
|
||||||
+ max
|
+ max
|
||||||
(
|
(
|
||||||
@ -227,7 +256,10 @@ void Foam::activeBaffleVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
maxOpenFractionDelta_
|
maxOpenFractionDelta_
|
||||||
)
|
)
|
||||||
*(orientation_*sign(forceDiff)),
|
*(orientation_*sign(forceDiff)),
|
||||||
1 - 1e-6), 1e-6);
|
1 - 1e-6
|
||||||
|
),
|
||||||
|
1e-6
|
||||||
|
);
|
||||||
|
|
||||||
Info<< "openFraction = " << openFraction_ << endl;
|
Info<< "openFraction = " << openFraction_ << endl;
|
||||||
|
|
||||||
@ -239,10 +271,16 @@ void Foam::activeBaffleVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
const_cast<scalarField&>(patch().magSf()) = mag(patch().Sf());
|
const_cast<scalarField&>(patch().magSf()) = mag(patch().Sf());
|
||||||
|
|
||||||
|
// Update owner side of cyclic
|
||||||
const_cast<vectorField&>(cyclicPatch.Sf()) =
|
const_cast<vectorField&>(cyclicPatch.Sf()) =
|
||||||
openFraction_*initCyclicSf_;
|
openFraction_*initCyclicSf_;
|
||||||
const_cast<scalarField&>(cyclicPatch.magSf()) =
|
const_cast<scalarField&>(cyclicPatch.magSf()) =
|
||||||
mag(cyclicPatch.Sf());
|
mag(cyclicPatch.Sf());
|
||||||
|
// Update neighbour side of cyclic
|
||||||
|
const_cast<vectorField&>(nbrPatch.Sf()) =
|
||||||
|
openFraction_*nbrCyclicSf_;
|
||||||
|
const_cast<scalarField&>(nbrPatch.magSf()) =
|
||||||
|
mag(nbrPatch.Sf());
|
||||||
|
|
||||||
curTimeIndex_ = this->db().time().timeIndex();
|
curTimeIndex_ = this->db().time().timeIndex();
|
||||||
}
|
}
|
||||||
@ -264,8 +302,7 @@ void Foam::activeBaffleVelocityFvPatchVectorField::write(Ostream& os) const
|
|||||||
<< maxOpenFractionDelta_ << token::END_STATEMENT << nl;
|
<< maxOpenFractionDelta_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("openFraction")
|
os.writeKeyword("openFraction")
|
||||||
<< openFraction_ << token::END_STATEMENT << nl;
|
<< openFraction_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("p")
|
writeEntryIfDifferent<word>(os, "p", "p", pName_);
|
||||||
<< pName_ << token::END_STATEMENT << nl;
|
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -72,9 +72,12 @@ class activeBaffleVelocityFvPatchVectorField
|
|||||||
//- Initial wall patch areas
|
//- Initial wall patch areas
|
||||||
vectorField initWallSf_;
|
vectorField initWallSf_;
|
||||||
|
|
||||||
//- Initial cyclic patch areas
|
//- Initial this-side cyclic patch areas
|
||||||
vectorField initCyclicSf_;
|
vectorField initCyclicSf_;
|
||||||
|
|
||||||
|
//- Initial neighbour-side cyclic patch areas
|
||||||
|
vectorField nbrCyclicSf_;
|
||||||
|
|
||||||
//- Current fraction of the active baffle which is open
|
//- Current fraction of the active baffle which is open
|
||||||
scalar openFraction_;
|
scalar openFraction_;
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ fanFvPatchField<Type>::fanFvPatchField
|
|||||||
:
|
:
|
||||||
jumpCyclicFvPatchField<Type>(p, iF),
|
jumpCyclicFvPatchField<Type>(p, iF),
|
||||||
f_(0),
|
f_(0),
|
||||||
jump_(this->size()/2, 0.0)
|
jump_(this->size(), 0.0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -72,12 +72,14 @@ fanFvPatchField<Type>::fanFvPatchField
|
|||||||
:
|
:
|
||||||
jumpCyclicFvPatchField<Type>(p, iF),
|
jumpCyclicFvPatchField<Type>(p, iF),
|
||||||
f_(),
|
f_(),
|
||||||
jump_(this->size()/2, 0.0)
|
jump_(this->size(), 0.0)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
Istream& is = dict.lookup("f");
|
Istream& is = dict.lookup("f");
|
||||||
is.format(IOstream::ASCII);
|
is.format(IOstream::ASCII);
|
||||||
is >> f_;
|
is >> f_;
|
||||||
|
|
||||||
|
// Check that f_ table is same on both sides.?
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dict.found("value"))
|
if (dict.found("value"))
|
||||||
@ -129,21 +131,7 @@ void fanFvPatchField<Type>::autoMap
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
jumpCyclicFvPatchField<Type>::autoMap(m);
|
jumpCyclicFvPatchField<Type>::autoMap(m);
|
||||||
|
|
||||||
// Jump is half size. Expand to full size, map and truncate.
|
|
||||||
if (jump_.size() && jump_.size() == this->size()/2)
|
|
||||||
{
|
|
||||||
label oldSize = jump_.size();
|
|
||||||
jump_.setSize(this->size());
|
|
||||||
|
|
||||||
for (label i = oldSize; i < jump_.size(); i++)
|
|
||||||
{
|
|
||||||
jump_[i] = jump_[i-oldSize];
|
|
||||||
}
|
|
||||||
|
|
||||||
jump_.autoMap(m);
|
jump_.autoMap(m);
|
||||||
jump_.setSize(oldSize);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -156,24 +144,9 @@ void fanFvPatchField<Type>::rmap
|
|||||||
{
|
{
|
||||||
jumpCyclicFvPatchField<Type>::rmap(ptf, addr);
|
jumpCyclicFvPatchField<Type>::rmap(ptf, addr);
|
||||||
|
|
||||||
// Jump is half size. Expand to full size, map and truncate.
|
|
||||||
if (jump_.size() && jump_.size() == this->size()/2)
|
|
||||||
{
|
|
||||||
label oldSize = jump_.size();
|
|
||||||
jump_.setSize(this->size());
|
|
||||||
|
|
||||||
for (label i = oldSize; i < jump_.size(); i++)
|
|
||||||
{
|
|
||||||
jump_[i] = jump_[i-oldSize];
|
|
||||||
}
|
|
||||||
|
|
||||||
const fanFvPatchField<Type>& tiptf =
|
const fanFvPatchField<Type>& tiptf =
|
||||||
refCast<const fanFvPatchField<Type> >(ptf);
|
refCast<const fanFvPatchField<Type> >(ptf);
|
||||||
|
|
||||||
jump_.rmap(tiptf.jump_, addr);
|
jump_.rmap(tiptf.jump_, addr);
|
||||||
|
|
||||||
jump_.setSize(oldSize);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -132,7 +132,13 @@ public:
|
|||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return the "jump" across the patch as a "half" field
|
//- Return the polynomial coefficients
|
||||||
|
const List<scalar>& f() const
|
||||||
|
{
|
||||||
|
return f_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the "jump" across the patch.
|
||||||
virtual tmp<Field<Type> > jump() const
|
virtual tmp<Field<Type> > jump() const
|
||||||
{
|
{
|
||||||
return jump_;
|
return jump_;
|
||||||
|
|||||||
@ -47,6 +47,7 @@ void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Constant
|
||||||
jump_ = f_[0];
|
jump_ = f_[0];
|
||||||
|
|
||||||
if (f_.size() > 1)
|
if (f_.size() > 1)
|
||||||
@ -57,21 +58,11 @@ void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs()
|
|||||||
const fvsPatchField<scalar>& phip =
|
const fvsPatchField<scalar>& phip =
|
||||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||||
|
|
||||||
scalarField Un = max
|
scalarField Un = max(phip/patch().magSf(), scalar(0));
|
||||||
(
|
|
||||||
scalarField::subField(phip, size()/2)
|
|
||||||
/scalarField::subField(patch().magSf(), size()/2),
|
|
||||||
scalar(0)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
||||||
{
|
{
|
||||||
Un /=
|
Un /= patch().lookupPatchField<volScalarField, scalar>("rho");
|
||||||
scalarField::subField
|
|
||||||
(
|
|
||||||
patch().lookupPatchField<volScalarField, scalar>("rho"),
|
|
||||||
size()/2
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (label i=1; i<f_.size(); i++)
|
for (label i=1; i<f_.size(); i++)
|
||||||
|
|||||||
@ -0,0 +1,157 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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 "processorCyclicFvsPatchField.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
processorCyclicFvsPatchField<Type>::processorCyclicFvsPatchField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<Type, surfaceMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
coupledFvsPatchField<Type>(p, iF),
|
||||||
|
procPatch_(refCast<const processorCyclicFvPatch>(p))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
processorCyclicFvsPatchField<Type>::processorCyclicFvsPatchField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<Type, surfaceMesh>& iF,
|
||||||
|
const Field<Type>& f
|
||||||
|
)
|
||||||
|
:
|
||||||
|
coupledFvsPatchField<Type>(p, iF, f),
|
||||||
|
procPatch_(refCast<const processorCyclicFvPatch>(p))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Construct by mapping given processorCyclicFvsPatchField<Type>
|
||||||
|
template<class Type>
|
||||||
|
processorCyclicFvsPatchField<Type>::processorCyclicFvsPatchField
|
||||||
|
(
|
||||||
|
const processorCyclicFvsPatchField<Type>& ptf,
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<Type, surfaceMesh>& iF,
|
||||||
|
const fvPatchFieldMapper& mapper
|
||||||
|
)
|
||||||
|
:
|
||||||
|
coupledFvsPatchField<Type>(ptf, p, iF, mapper),
|
||||||
|
procPatch_(refCast<const processorCyclicFvPatch>(p))
|
||||||
|
{
|
||||||
|
if (!isType<processorCyclicFvPatch>(this->patch()))
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"processorCyclicFvsPatchField<Type>::processorCyclicFvsPatchField\n"
|
||||||
|
"(\n"
|
||||||
|
" const processorCyclicFvsPatchField<Type>& ptf,\n"
|
||||||
|
" const fvPatch& p,\n"
|
||||||
|
" const DimensionedField<Type, surfaceMesh>& iF,\n"
|
||||||
|
" const fvPatchFieldMapper& mapper\n"
|
||||||
|
")\n"
|
||||||
|
) << "Field type does not correspond to patch type for patch "
|
||||||
|
<< this->patch().index() << "." << endl
|
||||||
|
<< "Field type: " << typeName << endl
|
||||||
|
<< "Patch type: " << this->patch().type()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
processorCyclicFvsPatchField<Type>::processorCyclicFvsPatchField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<Type, surfaceMesh>& iF,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
coupledFvsPatchField<Type>(p, iF, dict),
|
||||||
|
procPatch_(refCast<const processorCyclicFvPatch>(p))
|
||||||
|
{
|
||||||
|
if (!isType<processorCyclicFvPatch>(p))
|
||||||
|
{
|
||||||
|
FatalIOErrorIn
|
||||||
|
(
|
||||||
|
"processorCyclicFvsPatchField<Type>::processorCyclicFvsPatchField\n"
|
||||||
|
"(\n"
|
||||||
|
" const fvPatch& p,\n"
|
||||||
|
" const Field<Type>& field,\n"
|
||||||
|
" const dictionary& dict\n"
|
||||||
|
")\n",
|
||||||
|
dict
|
||||||
|
) << "patch " << this->patch().index() << " not processor type. "
|
||||||
|
<< "Patch type = " << p.type()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
processorCyclicFvsPatchField<Type>::processorCyclicFvsPatchField
|
||||||
|
(
|
||||||
|
const processorCyclicFvsPatchField<Type>& ptf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
coupledFvsPatchField<Type>(ptf),
|
||||||
|
procPatch_(refCast<const processorCyclicFvPatch>(ptf.patch()))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
processorCyclicFvsPatchField<Type>::processorCyclicFvsPatchField
|
||||||
|
(
|
||||||
|
const processorCyclicFvsPatchField<Type>& ptf,
|
||||||
|
const DimensionedField<Type, surfaceMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
coupledFvsPatchField<Type>(ptf, iF),
|
||||||
|
procPatch_(refCast<const processorCyclicFvPatch>(ptf.patch()))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
processorCyclicFvsPatchField<Type>::~processorCyclicFvsPatchField()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,173 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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::processorCyclicFvsPatchField
|
||||||
|
|
||||||
|
Description
|
||||||
|
Foam::processorCyclicFvsPatchField
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
processorCyclicFvsPatchField.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef processorCyclicFvsPatchField_H
|
||||||
|
#define processorCyclicFvsPatchField_H
|
||||||
|
|
||||||
|
#include "coupledFvsPatchField.H"
|
||||||
|
#include "processorCyclicFvPatch.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class processorCyclicFvsPatch Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
class processorCyclicFvsPatchField
|
||||||
|
:
|
||||||
|
public coupledFvsPatchField<Type>
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Local reference cast into the processor patch
|
||||||
|
const processorCyclicFvPatch& procPatch_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName(processorCyclicFvPatch::typeName_());
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from patch and internal field
|
||||||
|
processorCyclicFvsPatchField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<Type, surfaceMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from patch and internal field and patch field
|
||||||
|
processorCyclicFvsPatchField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<Type, surfaceMesh>&,
|
||||||
|
const Field<Type>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from patch, internal field and dictionary
|
||||||
|
processorCyclicFvsPatchField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<Type, surfaceMesh>&,
|
||||||
|
const dictionary&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct by mapping given processorCyclicFvsPatchField onto a
|
||||||
|
// new patch
|
||||||
|
processorCyclicFvsPatchField
|
||||||
|
(
|
||||||
|
const processorCyclicFvsPatchField<Type>&,
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<Type, surfaceMesh>&,
|
||||||
|
const fvPatchFieldMapper&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct as copy
|
||||||
|
processorCyclicFvsPatchField(const processorCyclicFvsPatchField<Type>&);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual tmp<fvsPatchField<Type> > clone() const
|
||||||
|
{
|
||||||
|
return tmp<fvsPatchField<Type> >
|
||||||
|
(
|
||||||
|
new processorCyclicFvsPatchField<Type>(*this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Construct as copy setting internal field reference
|
||||||
|
processorCyclicFvsPatchField
|
||||||
|
(
|
||||||
|
const processorCyclicFvsPatchField<Type>&,
|
||||||
|
const DimensionedField<Type, surfaceMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone setting internal field reference
|
||||||
|
virtual tmp<fvsPatchField<Type> > clone
|
||||||
|
(
|
||||||
|
const DimensionedField<Type, surfaceMesh>& iF
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<fvsPatchField<Type> >
|
||||||
|
(
|
||||||
|
new processorCyclicFvsPatchField<Type>(*this, iF)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
|
||||||
|
~processorCyclicFvsPatchField();
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return true if running parallel
|
||||||
|
virtual bool coupled() const
|
||||||
|
{
|
||||||
|
if (Pstream::parRun())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "processorCyclicFvsPatchField.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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 "processorCyclicFvsPatchFields.H"
|
||||||
|
#include "fvsPatchFields.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
makeFvsPatchFields(processorCyclic);
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef processorCyclicFvsPatchFields_H
|
||||||
|
#define processorCyclicFvsPatchFields_H
|
||||||
|
|
||||||
|
#include "processorCyclicFvsPatchField.H"
|
||||||
|
#include "fieldTypes.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
makeFvsPatchTypeFieldTypedefs(processorCyclic)
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef processorCyclicFvsPatchFieldsFwd_H
|
||||||
|
#define processorCyclicFvsPatchFieldsFwd_H
|
||||||
|
|
||||||
|
#include "fieldTypes.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type> class processorCyclicFvsPatchField;
|
||||||
|
|
||||||
|
makeFvsPatchTypeFieldTypedefs(processor)
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -103,6 +103,8 @@ void Foam::fvMeshSubset::doCoupledPatches
|
|||||||
|
|
||||||
if (syncPar && Pstream::parRun())
|
if (syncPar && Pstream::parRun())
|
||||||
{
|
{
|
||||||
|
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||||
|
|
||||||
// Send face usage across processor patches
|
// Send face usage across processor patches
|
||||||
forAll (oldPatches, oldPatchI)
|
forAll (oldPatches, oldPatchI)
|
||||||
{
|
{
|
||||||
@ -113,17 +115,14 @@ void Foam::fvMeshSubset::doCoupledPatches
|
|||||||
const processorPolyPatch& procPatch =
|
const processorPolyPatch& procPatch =
|
||||||
refCast<const processorPolyPatch>(pp);
|
refCast<const processorPolyPatch>(pp);
|
||||||
|
|
||||||
OPstream toNeighbour
|
UOPstream toNeighbour(procPatch.neighbProcNo(), pBufs);
|
||||||
(
|
|
||||||
Pstream::blocking,
|
|
||||||
procPatch.neighbProcNo()
|
|
||||||
);
|
|
||||||
|
|
||||||
toNeighbour
|
toNeighbour
|
||||||
<< SubList<label>(nCellsUsingFace, pp.size(), pp.start());
|
<< SubList<label>(nCellsUsingFace, pp.size(), pp.start());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pBufs.finishedSends();
|
||||||
|
|
||||||
// Receive face usage count and check for faces that become uncoupled.
|
// Receive face usage count and check for faces that become uncoupled.
|
||||||
forAll (oldPatches, oldPatchI)
|
forAll (oldPatches, oldPatchI)
|
||||||
@ -135,11 +134,7 @@ void Foam::fvMeshSubset::doCoupledPatches
|
|||||||
const processorPolyPatch& procPatch =
|
const processorPolyPatch& procPatch =
|
||||||
refCast<const processorPolyPatch>(pp);
|
refCast<const processorPolyPatch>(pp);
|
||||||
|
|
||||||
IPstream fromNeighbour
|
UIPstream fromNeighbour(procPatch.neighbProcNo(), pBufs);
|
||||||
(
|
|
||||||
Pstream::blocking,
|
|
||||||
procPatch.neighbProcNo()
|
|
||||||
);
|
|
||||||
|
|
||||||
labelList nbrCellsUsingFace(fromNeighbour);
|
labelList nbrCellsUsingFace(fromNeighbour);
|
||||||
|
|
||||||
|
|||||||
@ -100,6 +100,12 @@ public:
|
|||||||
return procPolyPatch_.neighbProcNo();
|
return procPolyPatch_.neighbProcNo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Return message tag used for sending
|
||||||
|
virtual int tag() const
|
||||||
|
{
|
||||||
|
return UPstream::msgType();
|
||||||
|
}
|
||||||
|
|
||||||
//- Return true if running parallel
|
//- Return true if running parallel
|
||||||
virtual bool coupled() const
|
virtual bool coupled() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -0,0 +1,170 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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 "processorCyclicFvPatch.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "transformField.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
defineTypeNameAndDebug(processorCyclicFvPatch, 0);
|
||||||
|
addToRunTimeSelectionTable(fvPatch, processorCyclicFvPatch, polyPatch);
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//void processorCyclicFvPatch::makeWeights(scalarField& w) const
|
||||||
|
//{
|
||||||
|
// if (Pstream::parRun())
|
||||||
|
// {
|
||||||
|
// // The face normals point in the opposite direction on the other side
|
||||||
|
// scalarField neighbFaceCentresCn
|
||||||
|
// (
|
||||||
|
// (
|
||||||
|
// procPolyPatch_.neighbFaceAreas()
|
||||||
|
// /(mag(procPolyPatch_.neighbFaceAreas()) + VSMALL)
|
||||||
|
// )
|
||||||
|
// & (
|
||||||
|
// procPolyPatch_.neighbFaceCentres()
|
||||||
|
// - procPolyPatch_.neighbFaceCellCentres())
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// w = neighbFaceCentresCn/((nf()&fvPatch::delta()) + neighbFaceCentresCn);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// w = 1.0;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//void processorCyclicFvPatch::makeDeltaCoeffs(scalarField& dc) const
|
||||||
|
//{
|
||||||
|
// if (Pstream::parRun())
|
||||||
|
// {
|
||||||
|
// dc = (1.0 - weights())/(nf() & fvPatch::delta());
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// dc = 1.0/(nf() & fvPatch::delta());
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//tmp<vectorField> processorCyclicFvPatch::delta() const
|
||||||
|
//{
|
||||||
|
// if (Pstream::parRun())
|
||||||
|
// {
|
||||||
|
// // To the transformation if necessary
|
||||||
|
// if (parallel())
|
||||||
|
// {
|
||||||
|
// return
|
||||||
|
// fvPatch::delta()
|
||||||
|
// - (
|
||||||
|
// procPolyPatch_.neighbFaceCentres()
|
||||||
|
// - procPolyPatch_.neighbFaceCellCentres()
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// return
|
||||||
|
// fvPatch::delta()
|
||||||
|
// - transform
|
||||||
|
// (
|
||||||
|
// forwardT(),
|
||||||
|
// (
|
||||||
|
// procPolyPatch_.neighbFaceCentres()
|
||||||
|
// - procPolyPatch_.neighbFaceCellCentres()
|
||||||
|
// )
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// return fvPatch::delta();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//tmp<labelField> processorCyclicFvPatch::interfaceInternalField
|
||||||
|
//(
|
||||||
|
// const unallocLabelList& internalData
|
||||||
|
//) const
|
||||||
|
//{
|
||||||
|
// return patchInternalField(internalData);
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
// void processorCyclicFvPatch::initTransfer
|
||||||
|
// (
|
||||||
|
// const Pstream::commsTypes commsType,
|
||||||
|
// const unallocLabelList& interfaceData
|
||||||
|
// ) const
|
||||||
|
// {
|
||||||
|
// send(commsType, interfaceData);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// tmp<labelField> processorCyclicFvPatch::transfer
|
||||||
|
// (
|
||||||
|
// const Pstream::commsTypes commsType,
|
||||||
|
// const unallocLabelList&
|
||||||
|
// ) const
|
||||||
|
// {
|
||||||
|
// return receive<label>(commsType, this->size());
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
//void processorCyclicFvPatch::initInternalFieldTransfer
|
||||||
|
//(
|
||||||
|
// const Pstream::commsTypes commsType,
|
||||||
|
// const unallocLabelList& iF
|
||||||
|
//) const
|
||||||
|
//{
|
||||||
|
// send(commsType, patchInternalField(iF)());
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//tmp<labelField> processorCyclicFvPatch::internalFieldTransfer
|
||||||
|
//(
|
||||||
|
// const Pstream::commsTypes commsType,
|
||||||
|
// const unallocLabelList&
|
||||||
|
//) const
|
||||||
|
//{
|
||||||
|
// return receive<label>(commsType, this->size());
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,214 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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::processorCyclicFvPatch
|
||||||
|
|
||||||
|
Description
|
||||||
|
Processor patch.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
processorCyclicFvPatch.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef processorCyclicFvPatch_H
|
||||||
|
#define processorCyclicFvPatch_H
|
||||||
|
|
||||||
|
//#include "coupledFvPatch.H"
|
||||||
|
//#include "processorLduInterface.H"
|
||||||
|
#include "processorCyclicPolyPatch.H"
|
||||||
|
#include "processorFvPatch.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class processorCyclicFvPatch Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class processorCyclicFvPatch
|
||||||
|
:
|
||||||
|
// public coupledFvPatch,
|
||||||
|
// public processorLduInterface
|
||||||
|
public processorFvPatch
|
||||||
|
{
|
||||||
|
// Private Data
|
||||||
|
|
||||||
|
const processorCyclicPolyPatch& procPolyPatch_;
|
||||||
|
|
||||||
|
|
||||||
|
//protected:
|
||||||
|
//
|
||||||
|
// // Protected Member functions
|
||||||
|
//
|
||||||
|
// //- Make patch weighting factors
|
||||||
|
// void makeWeights(scalarField&) const;
|
||||||
|
//
|
||||||
|
// //- Make patch face - neighbour cell distances
|
||||||
|
// void makeDeltaCoeffs(scalarField&) const;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName(processorCyclicPolyPatch::typeName_());
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
processorCyclicFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
|
||||||
|
:
|
||||||
|
// coupledFvPatch(patch, bm),
|
||||||
|
processorFvPatch(patch, bm),
|
||||||
|
procPolyPatch_(refCast<const processorCyclicPolyPatch>(patch))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
// //- Return processor number
|
||||||
|
// int myProcNo() const
|
||||||
|
// {
|
||||||
|
// return procPolyPatch_.myProcNo();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //- Return neigbour processor number
|
||||||
|
// int neighbProcNo() const
|
||||||
|
// {
|
||||||
|
// return procPolyPatch_.neighbProcNo();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //- Return true if running parallel
|
||||||
|
// virtual bool coupled() const
|
||||||
|
// {
|
||||||
|
// if (Pstream::parRun())
|
||||||
|
// {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
//- Return message tag used for sending
|
||||||
|
virtual int tag() const
|
||||||
|
{
|
||||||
|
// Allocate from Pstream?
|
||||||
|
return procPolyPatch_.tag();
|
||||||
|
}
|
||||||
|
|
||||||
|
const processorCyclicPolyPatch& procPolyPatch() const
|
||||||
|
{
|
||||||
|
return procPolyPatch_;
|
||||||
|
}
|
||||||
|
|
||||||
|
// //- Are the planes separated.
|
||||||
|
// virtual bool separated() const
|
||||||
|
// {
|
||||||
|
// return procPolyPatch_.separated();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //- If the planes are separated the separation vector.
|
||||||
|
// virtual const vector& separation() const
|
||||||
|
// {
|
||||||
|
// return procPolyPatch_.separation();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
|
||||||
|
//- Are the cyclic planes parallel
|
||||||
|
virtual bool parallel() const
|
||||||
|
{
|
||||||
|
return procPolyPatch_.parallel();
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return face transformation tensor
|
||||||
|
virtual const tensor& forwardT() const
|
||||||
|
{
|
||||||
|
return procPolyPatch_.forwardT();
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return neighbour-cell transformation tensor
|
||||||
|
virtual const tensor& reverseT() const
|
||||||
|
{
|
||||||
|
return procPolyPatch_.reverseT();
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// //- Return delta (P to N) vectors across coupled patch
|
||||||
|
// virtual tmp<vectorField> delta() const;
|
||||||
|
|
||||||
|
|
||||||
|
// Interface transfer functions
|
||||||
|
|
||||||
|
// //- Return the values of the given internal data adjacent to
|
||||||
|
// // the interface as a field
|
||||||
|
// virtual tmp<labelField> interfaceInternalField
|
||||||
|
// (
|
||||||
|
// const unallocLabelList& internalData
|
||||||
|
// ) const;
|
||||||
|
|
||||||
|
// //- Initialise interface data transfer
|
||||||
|
// virtual void initTransfer
|
||||||
|
// (
|
||||||
|
// const Pstream::commsTypes commsType,
|
||||||
|
// const unallocLabelList& interfaceData
|
||||||
|
// ) const;
|
||||||
|
//
|
||||||
|
// //- Transfer and return neighbour field
|
||||||
|
// virtual tmp<labelField> transfer
|
||||||
|
// (
|
||||||
|
// const Pstream::commsTypes commsType,
|
||||||
|
// const unallocLabelList& interfaceData
|
||||||
|
// ) const;
|
||||||
|
|
||||||
|
// //- Initialise neighbour field transfer
|
||||||
|
// virtual void initInternalFieldTransfer
|
||||||
|
// (
|
||||||
|
// const Pstream::commsTypes commsType,
|
||||||
|
// const unallocLabelList& internalData
|
||||||
|
// ) const;
|
||||||
|
//
|
||||||
|
// //- Return neighbour field
|
||||||
|
// virtual tmp<labelField> internalFieldTransfer
|
||||||
|
// (
|
||||||
|
// const Pstream::commsTypes commsType,
|
||||||
|
// const unallocLabelList& internalData
|
||||||
|
// ) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -322,13 +322,15 @@ Foam::pointField Foam::autoSnapDriver::smoothPatchDisplacement
|
|||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
{
|
{
|
||||||
if (Pstream::parRun() && isA<processorPolyPatch>(patches[patchI]))
|
if
|
||||||
|
(
|
||||||
|
patches[patchI].coupled()
|
||||||
|
&& refCast<const coupledPolyPatch>(patches[patchI]).owner()
|
||||||
|
)
|
||||||
{
|
{
|
||||||
const processorPolyPatch& pp =
|
const coupledPolyPatch& pp =
|
||||||
refCast<const processorPolyPatch>(patches[patchI]);
|
refCast<const coupledPolyPatch>(patches[patchI]);
|
||||||
|
|
||||||
if (pp.myProcNo() < pp.neighbProcNo())
|
|
||||||
{
|
|
||||||
const vectorField::subField faceCentres = pp.faceCentres();
|
const vectorField::subField faceCentres = pp.faceCentres();
|
||||||
|
|
||||||
forAll(pp, i)
|
forAll(pp, i)
|
||||||
@ -344,26 +346,6 @@ Foam::pointField Foam::autoSnapDriver::smoothPatchDisplacement
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isA<cyclicPolyPatch>(patches[patchI]))
|
|
||||||
{
|
|
||||||
const cyclicPolyPatch& pp =
|
|
||||||
refCast<const cyclicPolyPatch>(patches[patchI]);
|
|
||||||
|
|
||||||
const vectorField::subField faceCentres = pp.faceCentres();
|
|
||||||
|
|
||||||
for (label i = 0; i < pp.size()/2; i++)
|
|
||||||
{
|
|
||||||
const face& f = pp[i];
|
|
||||||
const point& fc = faceCentres[i];
|
|
||||||
|
|
||||||
forAll(f, fp)
|
|
||||||
{
|
|
||||||
globalSum[f[fp]] += fc;
|
|
||||||
globalNum[f[fp]]++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
syncTools::syncPointList
|
syncTools::syncPointList
|
||||||
(
|
(
|
||||||
|
|||||||
@ -91,20 +91,6 @@ bool Foam::blockMesh::readPatches
|
|||||||
>> patchTypes[nPatches]
|
>> patchTypes[nPatches]
|
||||||
>> patchNames[nPatches];
|
>> patchNames[nPatches];
|
||||||
|
|
||||||
// Read optional neighbour patch name
|
|
||||||
if (patchTypes[nPatches] == cyclicPolyPatch::typeName)
|
|
||||||
{
|
|
||||||
patchStream >> lastToken;
|
|
||||||
if (lastToken.isWord())
|
|
||||||
{
|
|
||||||
nbrPatchNames[nPatches] = lastToken.wordToken();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
patchStream.putBack(lastToken);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read patch faces
|
// Read patch faces
|
||||||
patchStream >> tmpBlocksPatches[nPatches];
|
patchStream >> tmpBlocksPatches[nPatches];
|
||||||
|
|
||||||
@ -137,8 +123,6 @@ bool Foam::blockMesh::readPatches
|
|||||||
// Split old style cyclics
|
// Split old style cyclics
|
||||||
|
|
||||||
if (patchTypes[nPatches-1] == cyclicPolyPatch::typeName)
|
if (patchTypes[nPatches-1] == cyclicPolyPatch::typeName)
|
||||||
{
|
|
||||||
if (nbrPatchNames[nPatches] == word::null)
|
|
||||||
{
|
{
|
||||||
word halfA = patchNames[nPatches-1] + "_half0";
|
word halfA = patchNames[nPatches-1] + "_half0";
|
||||||
word halfB = patchNames[nPatches-1] + "_half1";
|
word halfB = patchNames[nPatches-1] + "_half1";
|
||||||
@ -148,8 +132,8 @@ bool Foam::blockMesh::readPatches
|
|||||||
<< " Splitting patch "
|
<< " Splitting patch "
|
||||||
<< patchNames[nPatches-1] << " into two halves "
|
<< patchNames[nPatches-1] << " into two halves "
|
||||||
<< halfA << " and " << halfB << endl
|
<< halfA << " and " << halfB << endl
|
||||||
<< " Alternatively use new syntax "
|
<< " Alternatively use new 'boundary' dictionary syntax."
|
||||||
<< " cyclic <name> <neighbourname> <faces>" << endl;
|
<< endl;
|
||||||
|
|
||||||
// Add extra patch
|
// Add extra patch
|
||||||
if (tmpBlocksPatches.size() <= nPatches)
|
if (tmpBlocksPatches.size() <= nPatches)
|
||||||
@ -160,8 +144,10 @@ bool Foam::blockMesh::readPatches
|
|||||||
nbrPatchNames.setSize(nPatches + 1);
|
nbrPatchNames.setSize(nPatches + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update halfA info
|
||||||
patchNames[nPatches-1] = halfA;
|
patchNames[nPatches-1] = halfA;
|
||||||
nbrPatchNames[nPatches-1] = halfB;
|
nbrPatchNames[nPatches-1] = halfB;
|
||||||
|
// Update halfB info
|
||||||
patchTypes[nPatches] = patchTypes[nPatches-1];
|
patchTypes[nPatches] = patchTypes[nPatches-1];
|
||||||
patchNames[nPatches] = halfB;
|
patchNames[nPatches] = halfB;
|
||||||
nbrPatchNames[nPatches] = halfA;
|
nbrPatchNames[nPatches] = halfA;
|
||||||
@ -189,7 +175,6 @@ bool Foam::blockMesh::readPatches
|
|||||||
|
|
||||||
nPatches++;
|
nPatches++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
patchStream >> lastToken;
|
patchStream >> lastToken;
|
||||||
}
|
}
|
||||||
@ -495,6 +480,29 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
|
|||||||
patchPhysicalTypes
|
patchPhysicalTypes
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Convert into dictionary
|
||||||
|
PtrList<dictionary> patchDicts(patchNames.size());
|
||||||
|
forAll(patchDicts, patchI)
|
||||||
|
{
|
||||||
|
patchDicts.set(patchI, new dictionary());
|
||||||
|
patchDicts[patchI].set("name", patchNames[patchI]);
|
||||||
|
patchDicts[patchI].set("type", patchTypes[patchI]);
|
||||||
|
if (nbrPatchNames[patchI] != word::null)
|
||||||
|
{
|
||||||
|
patchDicts[patchI].set("neighbourPatch", nbrPatchNames[patchI]);
|
||||||
|
}
|
||||||
|
if (patchPhysicalTypes[patchI] != word::null)
|
||||||
|
{
|
||||||
|
patchDicts[patchI].set
|
||||||
|
(
|
||||||
|
"physicalType",
|
||||||
|
patchPhysicalTypes[patchI]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
blockMeshPtr = new polyMesh
|
blockMeshPtr = new polyMesh
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -509,11 +517,9 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
|
|||||||
xferCopy(blockPointField_), // copy these points, do NOT move
|
xferCopy(blockPointField_), // copy these points, do NOT move
|
||||||
tmpBlockCells,
|
tmpBlockCells,
|
||||||
tmpBlocksPatches,
|
tmpBlocksPatches,
|
||||||
patchNames,
|
patchDicts,
|
||||||
patchTypes,
|
|
||||||
defaultPatchName,
|
defaultPatchName,
|
||||||
defaultPatchType,
|
defaultPatchType
|
||||||
patchPhysicalTypes
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (meshDescription.found("boundary"))
|
else if (meshDescription.found("boundary"))
|
||||||
|
|||||||
@ -57,49 +57,6 @@ void Foam::PointEdgeWave<Type>::offset(const label val, labelList& elems)
|
|||||||
// - list of halfA points (in cyclic patch points)
|
// - list of halfA points (in cyclic patch points)
|
||||||
// - list of halfB points (can overlap with A!)
|
// - list of halfB points (can overlap with A!)
|
||||||
// - for every patchPoint its corresponding point
|
// - for every patchPoint its corresponding point
|
||||||
template <class Type>
|
|
||||||
void Foam::PointEdgeWave<Type>::calcCyclicAddressing()
|
|
||||||
{
|
|
||||||
label cycHalf = 0;
|
|
||||||
|
|
||||||
forAll(mesh_.boundaryMesh(), patchI)
|
|
||||||
{
|
|
||||||
const polyPatch& patch = mesh_.boundaryMesh()[patchI];
|
|
||||||
|
|
||||||
if (isA<cyclicPolyPatch>(patch))
|
|
||||||
{
|
|
||||||
label halfSize = patch.size()/2;
|
|
||||||
|
|
||||||
SubList<face> halfAFaces
|
|
||||||
(
|
|
||||||
mesh_.faces(),
|
|
||||||
halfSize,
|
|
||||||
patch.start()
|
|
||||||
);
|
|
||||||
|
|
||||||
cycHalves_.set
|
|
||||||
(
|
|
||||||
cycHalf++,
|
|
||||||
new primitivePatch(halfAFaces, mesh_.points())
|
|
||||||
);
|
|
||||||
|
|
||||||
SubList<face> halfBFaces
|
|
||||||
(
|
|
||||||
mesh_.faces(),
|
|
||||||
halfSize,
|
|
||||||
patch.start() + halfSize
|
|
||||||
);
|
|
||||||
|
|
||||||
cycHalves_.set
|
|
||||||
(
|
|
||||||
cycHalf++,
|
|
||||||
new primitivePatch(halfBFaces, mesh_.points())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Handle leaving domain. Implementation referred to Type
|
// Handle leaving domain. Implementation referred to Type
|
||||||
template <class Type>
|
template <class Type>
|
||||||
void Foam::PointEdgeWave<Type>::leaveDomain
|
void Foam::PointEdgeWave<Type>::leaveDomain
|
||||||
@ -559,96 +516,57 @@ void Foam::PointEdgeWave<Type>::handleCyclicPatches()
|
|||||||
// 1. Send all point info on cyclic patches. Send as
|
// 1. Send all point info on cyclic patches. Send as
|
||||||
// face label + offset in face.
|
// face label + offset in face.
|
||||||
|
|
||||||
label cycHalf = 0;
|
|
||||||
|
|
||||||
forAll(mesh_.boundaryMesh(), patchI)
|
forAll(mesh_.boundaryMesh(), patchI)
|
||||||
{
|
{
|
||||||
const polyPatch& patch = mesh_.boundaryMesh()[patchI];
|
const polyPatch& patch = mesh_.boundaryMesh()[patchI];
|
||||||
|
|
||||||
if (isA<cyclicPolyPatch>(patch))
|
if (isA<cyclicPolyPatch>(patch))
|
||||||
{
|
{
|
||||||
const primitivePatch& halfA = cycHalves_[cycHalf++];
|
|
||||||
const primitivePatch& halfB = cycHalves_[cycHalf++];
|
|
||||||
|
|
||||||
// HalfA : get all changed points in relative addressing
|
|
||||||
|
|
||||||
DynamicList<Type> halfAInfo(halfA.nPoints());
|
|
||||||
DynamicList<label> halfAPoints(halfA.nPoints());
|
|
||||||
DynamicList<label> halfAOwner(halfA.nPoints());
|
|
||||||
DynamicList<label> halfAIndex(halfA.nPoints());
|
|
||||||
|
|
||||||
getChangedPatchPoints
|
|
||||||
(
|
|
||||||
halfA,
|
|
||||||
halfAInfo,
|
|
||||||
halfAPoints,
|
|
||||||
halfAOwner,
|
|
||||||
halfAIndex
|
|
||||||
);
|
|
||||||
|
|
||||||
// HalfB : get all changed points in relative addressing
|
|
||||||
|
|
||||||
DynamicList<Type> halfBInfo(halfB.nPoints());
|
|
||||||
DynamicList<label> halfBPoints(halfB.nPoints());
|
|
||||||
DynamicList<label> halfBOwner(halfB.nPoints());
|
|
||||||
DynamicList<label> halfBIndex(halfB.nPoints());
|
|
||||||
|
|
||||||
getChangedPatchPoints
|
|
||||||
(
|
|
||||||
halfB,
|
|
||||||
halfBInfo,
|
|
||||||
halfBPoints,
|
|
||||||
halfBOwner,
|
|
||||||
halfBIndex
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// HalfA : adapt for leaving domain
|
|
||||||
leaveDomain(patch, halfA, halfAPoints, halfAInfo);
|
|
||||||
|
|
||||||
// HalfB : adapt for leaving domain
|
|
||||||
leaveDomain(patch, halfB, halfBPoints, halfBInfo);
|
|
||||||
|
|
||||||
|
|
||||||
// Apply rotation for non-parallel planes
|
|
||||||
const cyclicPolyPatch& cycPatch =
|
const cyclicPolyPatch& cycPatch =
|
||||||
refCast<const cyclicPolyPatch>(patch);
|
refCast<const cyclicPolyPatch>(patch);
|
||||||
|
|
||||||
|
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
|
||||||
|
|
||||||
|
DynamicList<Type> nbrInfo(nbrPatch.nPoints());
|
||||||
|
DynamicList<label> nbrPoints(nbrPatch.nPoints());
|
||||||
|
DynamicList<label> nbrOwner(nbrPatch.nPoints());
|
||||||
|
DynamicList<label> nbrIndex(nbrPatch.nPoints());
|
||||||
|
|
||||||
|
getChangedPatchPoints
|
||||||
|
(
|
||||||
|
nbrPatch,
|
||||||
|
nbrInfo,
|
||||||
|
nbrPoints,
|
||||||
|
nbrOwner,
|
||||||
|
nbrIndex
|
||||||
|
);
|
||||||
|
|
||||||
|
// nbr : adapt for leaving domain
|
||||||
|
leaveDomain(nbrPatch, nbrPatch, nbrPoints, nbrInfo);
|
||||||
|
|
||||||
|
// Apply rotation for non-parallel planes
|
||||||
|
|
||||||
if (!cycPatch.parallel())
|
if (!cycPatch.parallel())
|
||||||
{
|
{
|
||||||
// received data from half1
|
// received data from half1
|
||||||
transform(cycPatch.forwardT(), halfAInfo);
|
transform(cycPatch.forwardT(), nbrInfo);
|
||||||
|
|
||||||
// received data from half2
|
|
||||||
transform(cycPatch.reverseT(), halfBInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "Cyclic patch " << patchI << ' ' << patch.name()
|
Pout<< "Cyclic patch " << patchI << ' ' << patch.name()
|
||||||
<< " Changed on first half : " << halfAInfo.size()
|
<< " Changed : " << nbrInfo.size()
|
||||||
<< " Changed on second half : " << halfBInfo.size()
|
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Half1: update with data from halfB
|
// Half1: update with data from halfB
|
||||||
updateFromPatchInfo
|
updateFromPatchInfo
|
||||||
(
|
(
|
||||||
patch,
|
cycPatch,
|
||||||
halfA,
|
cycPatch,
|
||||||
halfBOwner,
|
nbrOwner,
|
||||||
halfBIndex,
|
nbrIndex,
|
||||||
halfBInfo
|
nbrInfo
|
||||||
);
|
|
||||||
|
|
||||||
// Half2: update with data from halfA
|
|
||||||
updateFromPatchInfo
|
|
||||||
(
|
|
||||||
patch,
|
|
||||||
halfB,
|
|
||||||
halfAOwner,
|
|
||||||
halfAIndex,
|
|
||||||
halfAInfo
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -687,7 +605,6 @@ Foam::PointEdgeWave<Type>::PointEdgeWave
|
|||||||
changedEdges_(mesh_.nEdges()),
|
changedEdges_(mesh_.nEdges()),
|
||||||
nChangedEdges_(0),
|
nChangedEdges_(0),
|
||||||
nCyclicPatches_(countPatchType<cyclicPolyPatch>()),
|
nCyclicPatches_(countPatchType<cyclicPolyPatch>()),
|
||||||
cycHalves_(2*nCyclicPatches_),
|
|
||||||
nEvals_(0),
|
nEvals_(0),
|
||||||
nUnvisitedPoints_(mesh_.nPoints()),
|
nUnvisitedPoints_(mesh_.nPoints()),
|
||||||
nUnvisitedEdges_(mesh_.nEdges())
|
nUnvisitedEdges_(mesh_.nEdges())
|
||||||
@ -720,13 +637,6 @@ Foam::PointEdgeWave<Type>::PointEdgeWave
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Calculate cyclic halves addressing.
|
|
||||||
if (nCyclicPatches_ > 0)
|
|
||||||
{
|
|
||||||
calcCyclicAddressing();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Set from initial changed points data
|
// Set from initial changed points data
|
||||||
setPointInfo(changedPoints, changedPointsInfo);
|
setPointInfo(changedPoints, changedPointsInfo);
|
||||||
|
|
||||||
|
|||||||
@ -231,9 +231,6 @@ class PointEdgeWave
|
|||||||
//- Merge data from across processor boundaries
|
//- Merge data from across processor boundaries
|
||||||
void handleProcPatches();
|
void handleProcPatches();
|
||||||
|
|
||||||
//- Calculate cyclic halves addressing.
|
|
||||||
void calcCyclicAddressing();
|
|
||||||
|
|
||||||
//- Merge data from across cyclic boundaries
|
//- Merge data from across cyclic boundaries
|
||||||
void handleCyclicPatches();
|
void handleCyclicPatches();
|
||||||
|
|
||||||
|
|||||||
@ -210,16 +210,22 @@ void Foam::regionSplit::fillSeedMask
|
|||||||
{
|
{
|
||||||
const polyPatch& pp = patches[patchI];
|
const polyPatch& pp = patches[patchI];
|
||||||
|
|
||||||
if (isA<cyclicPolyPatch>(pp))
|
if
|
||||||
|
(
|
||||||
|
isA<cyclicPolyPatch>(pp)
|
||||||
|
&& refCast<const cyclicPolyPatch>(pp).owner()
|
||||||
|
)
|
||||||
{
|
{
|
||||||
label faceI = pp.start();
|
// Transfer from neighbourPatch to here or vice versa.
|
||||||
|
|
||||||
label halfSz = pp.size()/2;
|
const cyclicPolyPatch& cycPatch =
|
||||||
|
refCast<const cyclicPolyPatch>(pp);
|
||||||
|
|
||||||
for (label i = 0; i < halfSz; i++)
|
label faceI = cycPatch.start();
|
||||||
|
|
||||||
|
forAll(cycPatch, i)
|
||||||
{
|
{
|
||||||
label otherFaceI = refCast<const cyclicPolyPatch>(pp)
|
label otherFaceI = cycPatch.transformGlobalFace(faceI);
|
||||||
.transformGlobalFace(faceI);
|
|
||||||
|
|
||||||
transferCoupledFaceRegion
|
transferCoupledFaceRegion
|
||||||
(
|
(
|
||||||
|
|||||||
@ -27,8 +27,6 @@ License
|
|||||||
#include "cellZoneSet.H"
|
#include "cellZoneSet.H"
|
||||||
#include "mapPolyMesh.H"
|
#include "mapPolyMesh.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "processorPolyPatch.H"
|
|
||||||
#include "cyclicPolyPatch.H"
|
|
||||||
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
|||||||
@ -27,8 +27,6 @@ License
|
|||||||
#include "faceSet.H"
|
#include "faceSet.H"
|
||||||
#include "mapPolyMesh.H"
|
#include "mapPolyMesh.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "processorPolyPatch.H"
|
|
||||||
#include "cyclicPolyPatch.H"
|
|
||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
@ -139,105 +137,6 @@ void faceSet::sync(const polyMesh& mesh)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
|
||||||
//
|
|
||||||
//if (Pstream::parRun())
|
|
||||||
//{
|
|
||||||
// // Send faces in set that are on a processorPatch. Send as patch face
|
|
||||||
// // indices.
|
|
||||||
// forAll(patches, patchI)
|
|
||||||
// {
|
|
||||||
// const polyPatch& pp = patches[patchI];
|
|
||||||
//
|
|
||||||
// if (isType<processorPolyPatch>(pp))
|
|
||||||
// {
|
|
||||||
// const processorPolyPatch& procPatch =
|
|
||||||
// refCast<const processorPolyPatch>(pp);
|
|
||||||
//
|
|
||||||
// // Convert faceSet locally to labelList.
|
|
||||||
// DynamicList<label> setFaces(pp.size());
|
|
||||||
//
|
|
||||||
// forAll(pp, i)
|
|
||||||
// {
|
|
||||||
// if (found(pp.start() + i))
|
|
||||||
// {
|
|
||||||
// setFaces.append(i);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// setFaces.shrink();
|
|
||||||
//
|
|
||||||
// OPstream toNeighbour
|
|
||||||
// (
|
|
||||||
// Pstream::blocking,
|
|
||||||
// procPatch.neighbProcNo()
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// toNeighbour << setFaces;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // Receive
|
|
||||||
// forAll(patches, patchI)
|
|
||||||
// {
|
|
||||||
// const polyPatch& pp = patches[patchI];
|
|
||||||
//
|
|
||||||
// if (isType<processorPolyPatch>(pp))
|
|
||||||
// {
|
|
||||||
// const processorPolyPatch& procPatch =
|
|
||||||
// refCast<const processorPolyPatch>(pp);
|
|
||||||
//
|
|
||||||
// IPstream fromNeighbour
|
|
||||||
// (
|
|
||||||
// Pstream::blocking,
|
|
||||||
// procPatch.neighbProcNo()
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// labelList setFaces(fromNeighbour);
|
|
||||||
//
|
|
||||||
// forAll(setFaces, i)
|
|
||||||
// {
|
|
||||||
// if (insert(pp.start() + setFaces[i]))
|
|
||||||
// {
|
|
||||||
// nAdded++;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//// Couple cyclic patches
|
|
||||||
//forAll (patches, patchI)
|
|
||||||
//{
|
|
||||||
// const polyPatch& pp = patches[patchI];
|
|
||||||
//
|
|
||||||
// if (typeid(pp) == typeid(cyclicPolyPatch))
|
|
||||||
// {
|
|
||||||
// const cyclicPolyPatch& cycPatch =
|
|
||||||
// refCast<const cyclicPolyPatch>(pp);
|
|
||||||
//
|
|
||||||
// forAll (cycPatch, i)
|
|
||||||
// {
|
|
||||||
// label thisFaceI = cycPatch.start() + i;
|
|
||||||
// label otherFaceI = cycPatch.transformGlobalFace(thisFaceI);
|
|
||||||
//
|
|
||||||
// if (found(thisFaceI))
|
|
||||||
// {
|
|
||||||
// if (insert(otherFaceI))
|
|
||||||
// {
|
|
||||||
// nAdded++;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else if (found(otherFaceI))
|
|
||||||
// {
|
|
||||||
// if (insert(thisFaceI))
|
|
||||||
// {
|
|
||||||
// nAdded++;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
reduce(nAdded, sumOp<label>());
|
reduce(nAdded, sumOp<label>());
|
||||||
if (nAdded > 0)
|
if (nAdded > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user