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:
@ -29,6 +29,7 @@ License
|
||||
#include "dictionary.H"
|
||||
#include "labelIOList.H"
|
||||
#include "processorPolyPatch.H"
|
||||
#include "processorCyclicPolyPatch.H"
|
||||
#include "fvMesh.H"
|
||||
#include "OSspecific.H"
|
||||
#include "Map.H"
|
||||
@ -293,10 +294,34 @@ bool Foam::domainDecomposition::writeDecomposition()
|
||||
|
||||
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
|
||||
(
|
||||
curPatchSizes.size()
|
||||
+ curProcessorPatchSizes.size(),
|
||||
+ nInterProcPatches, //curProcessorPatchSizes.size(),
|
||||
reinterpret_cast<polyPatch*>(0)
|
||||
);
|
||||
|
||||
@ -335,23 +360,72 @@ bool Foam::domainDecomposition::writeDecomposition()
|
||||
|
||||
forAll(curProcessorPatchSizes, procPatchI)
|
||||
{
|
||||
procPatches[nPatches] =
|
||||
new processorPolyPatch
|
||||
(
|
||||
word("procBoundary") + Foam::name(procI)
|
||||
+ word("to")
|
||||
+ Foam::name(curNeighbourProcessors[procPatchI]),
|
||||
curProcessorPatchSizes[procPatchI],
|
||||
curProcessorPatchStarts[procPatchI],
|
||||
nPatches,
|
||||
procMesh.boundaryMesh(),
|
||||
procI,
|
||||
curNeighbourProcessors[procPatchI],
|
||||
curSubPatchIDs[procPatchI],
|
||||
curSubStarts[procPatchI]
|
||||
);
|
||||
const labelList& subPatchID = curSubPatchIDs[procPatchI];
|
||||
const labelList& subStarts = curSubStarts[procPatchI];
|
||||
|
||||
nPatches++;
|
||||
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] =
|
||||
new processorPolyPatch
|
||||
(
|
||||
word("procBoundary") + Foam::name(procI)
|
||||
+ "to"
|
||||
+ Foam::name(curNeighbourProcessors[procPatchI]),
|
||||
size,
|
||||
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,
|
||||
procMesh.boundaryMesh(),
|
||||
procI,
|
||||
curNeighbourProcessors[procPatchI],
|
||||
referPatch
|
||||
);
|
||||
}
|
||||
|
||||
curStart += size;
|
||||
|
||||
nPatches++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user