mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into splitCyclic
Conflicts: applications/utilities/mesh/advanced/modifyMesh/cellSplitter.C applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L applications/utilities/mesh/generation/blockMesh/blockMesh.C applications/utilities/mesh/generation/blockMesh/createTopology.C applications/utilities/mesh/generation/snappyHexMesh/Make/options src/OpenFOAM/containers/Lists/ListOps/ListOps.H src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C src/OpenFOAM/containers/Lists/UList/UList.H src/OpenFOAM/containers/Lists/UList/UListI.H src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.C src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C src/decompositionAgglomeration/Allwmake src/decompositionAgglomeration/decompositionMethods/Make/files src/decompositionAgglomeration/decompositionMethods/Make/options src/dynamicMesh/attachDetach/attachInterface.C src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.H src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.H src/dynamicMesh/polyTopoChange/polyTopoChange/removePoints.H src/dynamicMesh/slidingInterface/coupleSlidingInterface.C src/finiteVolume/Make/files tutorials/channelOodles/channel395/constant/polyMesh/blockMeshDict tutorials/icoFoam/cavity/constant/polyMesh/blockMeshDict wmake/rules/linux64Gcc/c++Opt
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,6 +37,9 @@ Usage
|
||||
Write the cell distribution as a labelList for use with 'manual'
|
||||
decomposition method and as a volScalarField for post-processing.
|
||||
|
||||
@param -region regionName \n
|
||||
Decompose named region. Does not check for existence of processor*.
|
||||
|
||||
@param -copyUniform \n
|
||||
Copy any @a uniform directories too.
|
||||
|
||||
@ -83,6 +86,7 @@ Usage
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noParallel();
|
||||
# include "addRegionOption.H"
|
||||
argList::validOptions.insert("cellDist", "");
|
||||
argList::validOptions.insert("copyUniform", "");
|
||||
argList::validOptions.insert("fields", "");
|
||||
@ -92,12 +96,23 @@ int main(int argc, char *argv[])
|
||||
|
||||
# include "setRootCase.H"
|
||||
|
||||
bool writeCellDist(args.options().found("cellDist"));
|
||||
bool copyUniform(args.options().found("copyUniform"));
|
||||
bool decomposeFieldsOnly(args.options().found("fields"));
|
||||
bool filterPatches(args.options().found("filterPatches"));
|
||||
bool forceOverwrite(args.options().found("force"));
|
||||
bool ifRequiredDecomposition(args.options().found("ifRequired"));
|
||||
word regionName = fvMesh::defaultRegion;
|
||||
word regionDir = word::null;
|
||||
|
||||
if (args.optionFound("region"))
|
||||
{
|
||||
regionName = args.option("region");
|
||||
regionDir = regionName;
|
||||
Info<< "Decomposing mesh " << regionName << nl << endl;
|
||||
}
|
||||
|
||||
|
||||
bool writeCellDist = args.optionFound("cellDist");
|
||||
bool copyUniform = args.optionFound("copyUniform");
|
||||
bool decomposeFieldsOnly = args.optionFound("fields");
|
||||
bool filterPatches = args.optionFound("filterPatches");
|
||||
bool forceOverwrite = args.optionFound("force");
|
||||
bool ifRequiredDecomposition = args.optionFound("ifRequired");
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
@ -105,7 +120,17 @@ int main(int argc, char *argv[])
|
||||
|
||||
// determine the existing processor count directly
|
||||
label nProcs = 0;
|
||||
while (dir(runTime.path()/(word("processor") + name(nProcs))))
|
||||
while
|
||||
(
|
||||
isDir
|
||||
(
|
||||
runTime.path()
|
||||
/(word("processor") + name(nProcs))
|
||||
/runTime.constant()
|
||||
/regionDir
|
||||
/polyMesh::meshSubDir
|
||||
)
|
||||
)
|
||||
{
|
||||
++nProcs;
|
||||
}
|
||||
@ -119,6 +144,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
"decomposeParDict",
|
||||
runTime.time().system(),
|
||||
regionDir, // use region if non-standard
|
||||
runTime,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
@ -196,7 +222,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
domainDecomposition::defaultRegion,
|
||||
regionName,
|
||||
runTime.timeName(),
|
||||
runTime
|
||||
)
|
||||
@ -219,7 +245,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
runTime.path()
|
||||
/ mesh.facesInstance()
|
||||
/ polyMesh::defaultRegion
|
||||
/ regionName
|
||||
/ "cellDecomposition"
|
||||
);
|
||||
|
||||
@ -312,7 +338,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
fileNameList cloudDirs
|
||||
(
|
||||
readDir(runTime.timePath()/"lagrangian", fileName::DIRECTORY)
|
||||
readDir(runTime.timePath()/cloud::prefix, fileName::DIRECTORY)
|
||||
);
|
||||
|
||||
// Particles
|
||||
@ -344,7 +370,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
"lagrangian"/cloudDirs[i]
|
||||
cloud::prefix/cloudDirs[i]
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||
@ -383,7 +409,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
label i = 0;
|
||||
|
||||
forAllIter(Cloud<indexedParticle>, lagrangianPositions[cloudI], iter)
|
||||
forAllIter
|
||||
(
|
||||
Cloud<indexedParticle>,
|
||||
lagrangianPositions[cloudI],
|
||||
iter
|
||||
)
|
||||
{
|
||||
iter().index() = i++;
|
||||
|
||||
@ -405,7 +436,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (!cellParticles[cloudI][celli])
|
||||
{
|
||||
cellParticles[cloudI][celli] = new SLList<indexedParticle*>();
|
||||
cellParticles[cloudI][celli] = new SLList<indexedParticle*>
|
||||
();
|
||||
}
|
||||
|
||||
cellParticles[cloudI][celli]->append(&iter());
|
||||
@ -418,7 +450,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
"lagrangian"/cloudDirs[cloudI]
|
||||
cloud::prefix/cloudDirs[cloudI]
|
||||
);
|
||||
|
||||
lagrangianFieldDecomposer::readFields
|
||||
@ -480,7 +512,7 @@ int main(int argc, char *argv[])
|
||||
// Any uniform data to copy/link?
|
||||
fileName uniformDir("uniform");
|
||||
|
||||
if (dir(runTime.timePath()/uniformDir))
|
||||
if (isDir(runTime.timePath()/uniformDir))
|
||||
{
|
||||
Info<< "Detected additional non-decomposed files in "
|
||||
<< runTime.timePath()/uniformDir
|
||||
@ -508,12 +540,22 @@ int main(int argc, char *argv[])
|
||||
|
||||
processorDb.setTime(runTime);
|
||||
|
||||
// remove files remnants that can cause horrible problems
|
||||
// - mut and nut are used to mark the new turbulence models,
|
||||
// their existence prevents old models from being upgraded
|
||||
{
|
||||
fileName timeDir(processorDb.path()/processorDb.timeName());
|
||||
|
||||
rm(timeDir/"mut");
|
||||
rm(timeDir/"nut");
|
||||
}
|
||||
|
||||
// read the mesh
|
||||
fvMesh procMesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
fvMesh::defaultRegion,
|
||||
regionName,
|
||||
processorDb.timeName(),
|
||||
processorDb
|
||||
)
|
||||
@ -524,7 +566,7 @@ int main(int argc, char *argv[])
|
||||
IOobject
|
||||
(
|
||||
"cellProcAddressing",
|
||||
"constant",
|
||||
procMesh.facesInstance(),
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
@ -537,7 +579,7 @@ int main(int argc, char *argv[])
|
||||
IOobject
|
||||
(
|
||||
"boundaryProcAddressing",
|
||||
"constant",
|
||||
procMesh.facesInstance(),
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
@ -561,7 +603,7 @@ int main(int argc, char *argv[])
|
||||
IOobject
|
||||
(
|
||||
"faceProcAddressing",
|
||||
"constant",
|
||||
procMesh.facesInstance(),
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
@ -603,7 +645,7 @@ int main(int argc, char *argv[])
|
||||
IOobject
|
||||
(
|
||||
"pointProcAddressing",
|
||||
"constant",
|
||||
procMesh.facesInstance(),
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::MUST_READ,
|
||||
@ -723,7 +765,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "\nEnd.\n" << endl;
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -19,11 +19,12 @@ FoamFile
|
||||
|
||||
numberOfSubdomains 4;
|
||||
|
||||
// preservePatches (inlet);
|
||||
//- Keep owner and neighbour on same processor for faces in zones:
|
||||
// preserveFaceZones (heater solid1 solid3);
|
||||
|
||||
method simple;
|
||||
method scotch;
|
||||
// method hierarchical;
|
||||
// method simple;
|
||||
// method metis;
|
||||
// method manual;
|
||||
|
||||
@ -53,13 +54,26 @@ metisCoeffs
|
||||
*/
|
||||
}
|
||||
|
||||
scotchCoeffs
|
||||
{
|
||||
//processorWeights
|
||||
//(
|
||||
// 1
|
||||
// 1
|
||||
// 1
|
||||
// 1
|
||||
//);
|
||||
//writeGraph true;
|
||||
//strategy "b";
|
||||
}
|
||||
|
||||
manualCoeffs
|
||||
{
|
||||
dataFile "decompositionData";
|
||||
}
|
||||
|
||||
|
||||
//// Is the case distributred
|
||||
//// Is the case distributed
|
||||
//distributed yes;
|
||||
//// Per slave (so nProcs-1 entries) the directory above the case.
|
||||
//roots
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -44,35 +44,6 @@ void domainDecomposition::distributeCells()
|
||||
|
||||
labelHashSet sameProcFaces;
|
||||
|
||||
if (decompositionDict_.found("preservePatches"))
|
||||
{
|
||||
wordList pNames(decompositionDict_.lookup("preservePatches"));
|
||||
|
||||
Info<< "Keeping owner and neighbour of faces in patches " << pNames
|
||||
<< " on same processor" << endl;
|
||||
|
||||
const polyBoundaryMesh& patches = boundaryMesh();
|
||||
|
||||
forAll(pNames, i)
|
||||
{
|
||||
label patchI = patches.findPatchID(pNames[i]);
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
FatalErrorIn("domainDecomposition::distributeCells()")
|
||||
<< "Unknown preservePatch " << pNames[i]
|
||||
<< endl << "Valid patches are " << patches.names()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
const polyPatch& pp = patches[patchI];
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
sameProcFaces.insert(pp.start() + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (decompositionDict_.found("preserveFaceZones"))
|
||||
{
|
||||
wordList zNames(decompositionDict_.lookup("preserveFaceZones"));
|
||||
@ -103,14 +74,6 @@ void domainDecomposition::distributeCells()
|
||||
}
|
||||
}
|
||||
|
||||
if (sameProcFaces.size() > 0)
|
||||
{
|
||||
Info<< "Selected " << sameProcFaces.size()
|
||||
<< " faces whose owner and neighbour cell should be kept on the"
|
||||
<< " same processor" << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Construct decomposition method and either do decomposition on
|
||||
// cell centres or on agglomeration
|
||||
@ -122,12 +85,16 @@ void domainDecomposition::distributeCells()
|
||||
*this
|
||||
);
|
||||
|
||||
if (sameProcFaces.size() == 0)
|
||||
if (sameProcFaces.empty())
|
||||
{
|
||||
cellToProc_ = decomposePtr().decompose(cellCentres());
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Selected " << sameProcFaces.size()
|
||||
<< " faces whose owner and neighbour cell should be kept on the"
|
||||
<< " same processor" << endl;
|
||||
|
||||
// Faces where owner and neighbour are not 'connected' (= all except
|
||||
// sameProcFaces)
|
||||
boolList blockedFace(nFaces(), true);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -259,13 +259,13 @@ bool domainDecomposition::writeDecomposition()
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
polyMesh::defaultRegion,
|
||||
"constant",
|
||||
this->polyMesh::name(), // region name of undecomposed mesh
|
||||
pointsInstance(),
|
||||
processorDb
|
||||
),
|
||||
procPoints,
|
||||
procFaces,
|
||||
procCells
|
||||
xferMove(procPoints),
|
||||
xferMove(procFaces),
|
||||
xferMove(procCells)
|
||||
);
|
||||
|
||||
// Create processor boundary patches
|
||||
@ -296,7 +296,7 @@ bool domainDecomposition::writeDecomposition()
|
||||
(
|
||||
curPatchSizes.size()
|
||||
+ curProcessorPatchSizes.size(),
|
||||
reinterpret_cast<polyPatch*>(NULL)
|
||||
reinterpret_cast<polyPatch*>(0)
|
||||
);
|
||||
|
||||
label nPatches = 0;
|
||||
@ -363,7 +363,7 @@ forAll(procPatches, patchI)
|
||||
// Estimate size
|
||||
forAll(zonePoints, zoneI)
|
||||
{
|
||||
zonePoints[zoneI].setSize(pz[zoneI].size() / nProcs_);
|
||||
zonePoints[zoneI].setCapacity(pz[zoneI].size() / nProcs_);
|
||||
}
|
||||
|
||||
// Use the pointToZone map to find out the single zone (if any),
|
||||
@ -432,8 +432,8 @@ forAll(procPatches, patchI)
|
||||
{
|
||||
label procSize = fz[zoneI].size() / nProcs_;
|
||||
|
||||
zoneFaces[zoneI].setSize(procSize);
|
||||
zoneFaceFlips[zoneI].setSize(procSize);
|
||||
zoneFaces[zoneI].setCapacity(procSize);
|
||||
zoneFaceFlips[zoneI].setCapacity(procSize);
|
||||
}
|
||||
|
||||
// Go through all the zoned faces and find out if they
|
||||
@ -523,7 +523,7 @@ forAll(procPatches, patchI)
|
||||
// Estimate size
|
||||
forAll(zoneCells, zoneI)
|
||||
{
|
||||
zoneCells[zoneI].setSize(cz[zoneI].size() / nProcs_);
|
||||
zoneCells[zoneI].setCapacity(cz[zoneI].size() / nProcs_);
|
||||
}
|
||||
|
||||
forAll (curCellLabels, celli)
|
||||
@ -629,7 +629,7 @@ forAll(procPatches, patchI)
|
||||
IOobject
|
||||
(
|
||||
"pointProcAddressing",
|
||||
"constant",
|
||||
procMesh.facesInstance(),
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::NO_READ,
|
||||
@ -644,7 +644,7 @@ forAll(procPatches, patchI)
|
||||
IOobject
|
||||
(
|
||||
"faceProcAddressing",
|
||||
"constant",
|
||||
procMesh.facesInstance(),
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::NO_READ,
|
||||
@ -659,7 +659,7 @@ forAll(procPatches, patchI)
|
||||
IOobject
|
||||
(
|
||||
"cellProcAddressing",
|
||||
"constant",
|
||||
procMesh.facesInstance(),
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::NO_READ,
|
||||
@ -674,7 +674,7 @@ forAll(procPatches, patchI)
|
||||
IOobject
|
||||
(
|
||||
"boundaryProcAddressing",
|
||||
"constant",
|
||||
procMesh.facesInstance(),
|
||||
procMesh.meshSubDir,
|
||||
procMesh,
|
||||
IOobject::NO_READ,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -56,14 +56,12 @@ processorVolPatchFieldDecomposer
|
||||
const unallocLabelList& addressingSlice
|
||||
)
|
||||
:
|
||||
addressing_(addressingSlice.size()),
|
||||
weights_(addressingSlice.size())
|
||||
directAddressing_(addressingSlice.size())
|
||||
{
|
||||
const scalarField& weights = mesh.weights().internalField();
|
||||
const labelList& own = mesh.faceOwner();
|
||||
const labelList& neighb = mesh.faceNeighbour();
|
||||
|
||||
forAll (addressing_, i)
|
||||
forAll (directAddressing_, i)
|
||||
{
|
||||
// Subtract one to align addressing.
|
||||
label ai = mag(addressingSlice[i]) - 1;
|
||||
@ -72,15 +70,18 @@ processorVolPatchFieldDecomposer
|
||||
{
|
||||
// This is a regular face. it has been an internal face
|
||||
// of the original mesh and now it has become a face
|
||||
// on the parallel boundary
|
||||
addressing_[i].setSize(2);
|
||||
weights_[i].setSize(2);
|
||||
// on the parallel boundary.
|
||||
// Give face the value of the neighbour.
|
||||
|
||||
addressing_[i][0] = own[ai];
|
||||
addressing_[i][1] = neighb[ai];
|
||||
|
||||
weights_[i][0] = weights[ai];
|
||||
weights_[i][1] = 1.0 - weights[ai];
|
||||
if (addressingSlice[i] >= 0)
|
||||
{
|
||||
// I have the owner so use the neighbour value
|
||||
directAddressing_[i] = neighb[ai];
|
||||
}
|
||||
else
|
||||
{
|
||||
directAddressing_[i] = own[ai];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -89,13 +90,8 @@ processorVolPatchFieldDecomposer
|
||||
// do the interpolation properly (I would need to look
|
||||
// up the different (face) list of data), so I will
|
||||
// just grab the value from the owner cell
|
||||
//
|
||||
addressing_[i].setSize(1);
|
||||
weights_[i].setSize(1);
|
||||
|
||||
addressing_[i][0] = own[ai];
|
||||
|
||||
weights_[i][0] = 1.0;
|
||||
directAddressing_[i] = own[ai];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -96,15 +96,16 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Processor patch field decomposer class
|
||||
//- Processor patch field decomposer class. Maps either owner or
|
||||
// neighbour data (no interpolate anymore - processorFvPatchField
|
||||
// holds neighbour data)
|
||||
class processorVolPatchFieldDecomposer
|
||||
:
|
||||
public fvPatchFieldMapper
|
||||
{
|
||||
// Private data
|
||||
|
||||
labelListList addressing_;
|
||||
scalarListList weights_;
|
||||
labelList directAddressing_;
|
||||
|
||||
public:
|
||||
|
||||
@ -120,27 +121,23 @@ public:
|
||||
|
||||
label size() const
|
||||
{
|
||||
return addressing_.size();
|
||||
return directAddressing_.size();
|
||||
}
|
||||
|
||||
bool direct() const
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
const labelListList& addressing() const
|
||||
const unallocLabelList& directAddressing() const
|
||||
{
|
||||
return addressing_;
|
||||
}
|
||||
|
||||
const scalarListList& weights() const
|
||||
{
|
||||
return weights_;
|
||||
return directAddressing_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//- Processor patch field decomposer class
|
||||
//- Processor patch field decomposer class. Surface field is assumed
|
||||
// to have direction (so manipulates sign when mapping)
|
||||
class processorSurfacePatchFieldDecomposer
|
||||
:
|
||||
public fvPatchFieldMapper
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -88,7 +88,7 @@ tmp<IOField<Type> > lagrangianFieldDecomposer::decomposeField
|
||||
(
|
||||
field.name(),
|
||||
procMesh_.time().timeName(),
|
||||
"lagrangian"/cloudName,
|
||||
cloud::prefix/cloudName,
|
||||
procMesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -200,12 +200,6 @@ void Foam::processorMeshes::reconstructPoints(fvMesh& mesh)
|
||||
// Read the field for all the processors
|
||||
PtrList<pointIOField> procsPoints(meshes_.size());
|
||||
|
||||
fileName regionPrefix = "";
|
||||
if (meshName_ != fvMesh::defaultRegion)
|
||||
{
|
||||
regionPrefix = meshName_;
|
||||
}
|
||||
|
||||
forAll (meshes_, procI)
|
||||
{
|
||||
procsPoints.set
|
||||
@ -217,7 +211,7 @@ void Foam::processorMeshes::reconstructPoints(fvMesh& mesh)
|
||||
(
|
||||
"points",
|
||||
meshes_[procI].time().timeName(),
|
||||
regionPrefix/polyMesh::meshSubDir,
|
||||
polyMesh::meshSubDir,
|
||||
meshes_[procI],
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,6 +36,7 @@ SourceFiles
|
||||
#ifndef reconstructLagrangian_H
|
||||
#define reconstructLagrangian_H
|
||||
|
||||
#include "cloud.H"
|
||||
#include "polyMesh.H"
|
||||
#include "IOobjectList.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -47,7 +47,7 @@ Foam::tmp<Foam::IOField<Type> > Foam::reconstructLagrangianField
|
||||
(
|
||||
fieldName,
|
||||
mesh.time().timeName(),
|
||||
"lagrangian"/cloudName,
|
||||
cloud::prefix/cloudName,
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
@ -61,10 +61,10 @@ Foam::tmp<Foam::IOField<Type> > Foam::reconstructLagrangianField
|
||||
{
|
||||
// Check object on local mesh
|
||||
IOobject localIOobject
|
||||
(
|
||||
(
|
||||
fieldName,
|
||||
meshes[i].time().timeName(),
|
||||
"lagrangian"/cloudName,
|
||||
cloud::prefix/cloudName,
|
||||
meshes[i],
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -45,23 +45,28 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// enable -constant ... if someone really wants it
|
||||
// enable -zeroTime to prevent accidentally trashing the initial fields
|
||||
timeSelector::addOptions(true, true);
|
||||
argList::noParallel();
|
||||
timeSelector::addOptions();
|
||||
# include "addRegionOption.H"
|
||||
argList::validOptions.insert("fields", "\"(list of fields)\"");
|
||||
argList::validOptions.insert("noLagrangian", "");
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
HashSet<word> selectedFields;
|
||||
if (args.options().found("fields"))
|
||||
if (args.optionFound("fields"))
|
||||
{
|
||||
IStringStream(args.options()["fields"])() >> selectedFields;
|
||||
args.optionLookup("fields")() >> selectedFields;
|
||||
}
|
||||
|
||||
bool noLagrangian = args.optionFound("noLagrangian");
|
||||
|
||||
// determine the processor count directly
|
||||
label nProcs = 0;
|
||||
while (dir(args.path()/(word("processor") + name(nProcs))))
|
||||
while (isDir(args.path()/(word("processor") + name(nProcs))))
|
||||
{
|
||||
++nProcs;
|
||||
}
|
||||
@ -98,7 +103,7 @@ int main(int argc, char *argv[])
|
||||
args
|
||||
);
|
||||
|
||||
if (!timeDirs.size())
|
||||
if (timeDirs.empty())
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "No times selected"
|
||||
@ -112,19 +117,16 @@ int main(int argc, char *argv[])
|
||||
regionPrefix = regionName;
|
||||
}
|
||||
|
||||
|
||||
// Set all times (on reconstructed mesh and on processor meshes)
|
||||
runTime.setTime(timeDirs[0], 0);
|
||||
mesh.readUpdate();
|
||||
|
||||
// Set all times on processor meshes equal to reconstructed mesh
|
||||
forAll (databases, procI)
|
||||
{
|
||||
databases[procI].setTime(timeDirs[0], 0);
|
||||
databases[procI].setTime(runTime.timeName(), runTime.timeIndex());
|
||||
}
|
||||
|
||||
// Read all meshes and addressing to reconstructed mesh
|
||||
processorMeshes procMeshes(databases, regionName);
|
||||
|
||||
|
||||
// check face addressing for meshes that have been decomposed
|
||||
// with a very old foam version
|
||||
# include "checkFaceAddressingComp.H"
|
||||
@ -277,121 +279,124 @@ int main(int argc, char *argv[])
|
||||
// the first processor that has them. They are in pass2 only used
|
||||
// for name and type (scalar, vector etc).
|
||||
|
||||
HashTable<IOobjectList> cloudObjects;
|
||||
|
||||
forAll (databases, procI)
|
||||
if (!noLagrangian)
|
||||
{
|
||||
fileNameList cloudDirs
|
||||
(
|
||||
readDir
|
||||
(
|
||||
databases[procI].timePath()/regionPrefix/"lagrangian",
|
||||
fileName::DIRECTORY
|
||||
)
|
||||
);
|
||||
HashTable<IOobjectList> cloudObjects;
|
||||
|
||||
forAll (cloudDirs, i)
|
||||
forAll (databases, procI)
|
||||
{
|
||||
// Check if we already have cloud objects for this cloudname.
|
||||
HashTable<IOobjectList>::const_iterator iter =
|
||||
cloudObjects.find(cloudDirs[i]);
|
||||
|
||||
if (iter == cloudObjects.end())
|
||||
{
|
||||
// Do local scan for valid cloud objects.
|
||||
IOobjectList sprayObjs
|
||||
fileNameList cloudDirs
|
||||
(
|
||||
readDir
|
||||
(
|
||||
procMeshes.meshes()[procI],
|
||||
databases[procI].timeName(),
|
||||
"lagrangian"/cloudDirs[i]
|
||||
);
|
||||
databases[procI].timePath()/regionPrefix/cloud::prefix,
|
||||
fileName::DIRECTORY
|
||||
)
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||
forAll (cloudDirs, i)
|
||||
{
|
||||
// Check if we already have cloud objects for this cloudname
|
||||
HashTable<IOobjectList>::const_iterator iter =
|
||||
cloudObjects.find(cloudDirs[i]);
|
||||
|
||||
if (positionsPtr)
|
||||
if (iter == cloudObjects.end())
|
||||
{
|
||||
cloudObjects.insert(cloudDirs[i], sprayObjs);
|
||||
// Do local scan for valid cloud objects
|
||||
IOobjectList sprayObjs
|
||||
(
|
||||
procMeshes.meshes()[procI],
|
||||
databases[procI].timeName(),
|
||||
cloud::prefix/cloudDirs[i]
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||
|
||||
if (positionsPtr)
|
||||
{
|
||||
cloudObjects.insert(cloudDirs[i], sprayObjs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (cloudObjects.size() > 0)
|
||||
{
|
||||
// Pass2: reconstruct the cloud
|
||||
forAllConstIter(HashTable<IOobjectList>, cloudObjects, iter)
|
||||
if (cloudObjects.size())
|
||||
{
|
||||
const word cloudName = string::validate<word>(iter.key());
|
||||
// Pass2: reconstruct the cloud
|
||||
forAllConstIter(HashTable<IOobjectList>, cloudObjects, iter)
|
||||
{
|
||||
const word cloudName = string::validate<word>(iter.key());
|
||||
|
||||
// Objects (on arbitrary processor)
|
||||
const IOobjectList& sprayObjs = iter();
|
||||
// Objects (on arbitrary processor)
|
||||
const IOobjectList& sprayObjs = iter();
|
||||
|
||||
Info<< "Reconstructing lagrangian fields for cloud "
|
||||
<< cloudName << nl << endl;
|
||||
Info<< "Reconstructing lagrangian fields for cloud "
|
||||
<< cloudName << nl << endl;
|
||||
|
||||
reconstructLagrangianPositions
|
||||
(
|
||||
mesh,
|
||||
cloudName,
|
||||
procMeshes.meshes(),
|
||||
procMeshes.faceProcAddressing(),
|
||||
procMeshes.cellProcAddressing()
|
||||
);
|
||||
reconstructLagrangianFields<label>
|
||||
(
|
||||
cloudName,
|
||||
mesh,
|
||||
procMeshes.meshes(),
|
||||
sprayObjs
|
||||
);
|
||||
reconstructLagrangianFields<scalar>
|
||||
(
|
||||
cloudName,
|
||||
mesh,
|
||||
procMeshes.meshes(),
|
||||
sprayObjs
|
||||
);
|
||||
reconstructLagrangianFields<vector>
|
||||
(
|
||||
cloudName,
|
||||
mesh,
|
||||
procMeshes.meshes(),
|
||||
sprayObjs
|
||||
);
|
||||
reconstructLagrangianFields<sphericalTensor>
|
||||
(
|
||||
cloudName,
|
||||
mesh,
|
||||
procMeshes.meshes(),
|
||||
sprayObjs
|
||||
);
|
||||
reconstructLagrangianFields<symmTensor>
|
||||
(
|
||||
cloudName,
|
||||
mesh,
|
||||
procMeshes.meshes(),
|
||||
sprayObjs
|
||||
);
|
||||
reconstructLagrangianFields<tensor>
|
||||
(
|
||||
cloudName,
|
||||
mesh,
|
||||
procMeshes.meshes(),
|
||||
sprayObjs
|
||||
);
|
||||
reconstructLagrangianPositions
|
||||
(
|
||||
mesh,
|
||||
cloudName,
|
||||
procMeshes.meshes(),
|
||||
procMeshes.faceProcAddressing(),
|
||||
procMeshes.cellProcAddressing()
|
||||
);
|
||||
reconstructLagrangianFields<label>
|
||||
(
|
||||
cloudName,
|
||||
mesh,
|
||||
procMeshes.meshes(),
|
||||
sprayObjs
|
||||
);
|
||||
reconstructLagrangianFields<scalar>
|
||||
(
|
||||
cloudName,
|
||||
mesh,
|
||||
procMeshes.meshes(),
|
||||
sprayObjs
|
||||
);
|
||||
reconstructLagrangianFields<vector>
|
||||
(
|
||||
cloudName,
|
||||
mesh,
|
||||
procMeshes.meshes(),
|
||||
sprayObjs
|
||||
);
|
||||
reconstructLagrangianFields<sphericalTensor>
|
||||
(
|
||||
cloudName,
|
||||
mesh,
|
||||
procMeshes.meshes(),
|
||||
sprayObjs
|
||||
);
|
||||
reconstructLagrangianFields<symmTensor>
|
||||
(
|
||||
cloudName,
|
||||
mesh,
|
||||
procMeshes.meshes(),
|
||||
sprayObjs
|
||||
);
|
||||
reconstructLagrangianFields<tensor>
|
||||
(
|
||||
cloudName,
|
||||
mesh,
|
||||
procMeshes.meshes(),
|
||||
sprayObjs
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << "No lagrangian fields" << nl << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info << "No lagrangian fields" << nl << endl;
|
||||
}
|
||||
|
||||
// If there are any "uniform" directories copy them from
|
||||
// the master processor.
|
||||
// the master processor
|
||||
|
||||
fileName uniformDir0 = databases[0].timePath()/"uniform";
|
||||
if (dir(uniformDir0))
|
||||
if (isDir(uniformDir0))
|
||||
{
|
||||
cp(uniformDir0, runTime.timePath());
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,9 +26,10 @@ Application
|
||||
reconstructParMesh
|
||||
|
||||
Description
|
||||
Reconstructs a mesh using geometric information only. Writes
|
||||
point/face/cell procAddressing so afterwards reconstructPar can be used to
|
||||
reconstruct fields.
|
||||
Reconstructs a mesh using geometric information only.
|
||||
|
||||
Writes point/face/cell procAddressing so afterwards reconstructPar can be
|
||||
used to reconstruct fields.
|
||||
|
||||
Note:
|
||||
- uses geometric matching tolerance (set with -mergeTol option)
|
||||
@ -46,6 +47,8 @@ Description
|
||||
#include "mapAddedPolyMesh.H"
|
||||
#include "polyMeshAdder.H"
|
||||
#include "faceCoupleInfo.H"
|
||||
#include "fvMeshAdder.H"
|
||||
#include "polyTopoChange.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -203,6 +206,78 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
||||
}
|
||||
|
||||
|
||||
autoPtr<mapPolyMesh> mergeSharedPoints
|
||||
(
|
||||
const scalar mergeDist,
|
||||
polyMesh& mesh,
|
||||
labelListList& pointProcAddressing
|
||||
)
|
||||
{
|
||||
// Find out which sets of points get merged and create a map from
|
||||
// mesh point to unique point.
|
||||
Map<label> pointToMaster
|
||||
(
|
||||
fvMeshAdder::findSharedPoints
|
||||
(
|
||||
mesh,
|
||||
mergeDist
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "mergeSharedPoints : detected " << pointToMaster.size()
|
||||
<< " points that are to be merged." << endl;
|
||||
|
||||
if (returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
|
||||
{
|
||||
return autoPtr<mapPolyMesh>(NULL);
|
||||
}
|
||||
|
||||
polyTopoChange meshMod(mesh);
|
||||
|
||||
fvMeshAdder::mergePoints(mesh, pointToMaster, meshMod);
|
||||
|
||||
// Change the mesh (no inflation). Note: parallel comms allowed.
|
||||
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false, true);
|
||||
|
||||
// Update fields. No inflation, parallel sync.
|
||||
mesh.updateMesh(map);
|
||||
|
||||
// pointProcAddressing give indices into the master mesh so adapt them
|
||||
// for changed point numbering.
|
||||
|
||||
// Adapt constructMaps for merged points.
|
||||
forAll(pointProcAddressing, procI)
|
||||
{
|
||||
labelList& constructMap = pointProcAddressing[procI];
|
||||
|
||||
forAll(constructMap, i)
|
||||
{
|
||||
label oldPointI = constructMap[i];
|
||||
|
||||
// New label of point after changeMesh.
|
||||
label newPointI = map().reversePointMap()[oldPointI];
|
||||
|
||||
if (newPointI < -1)
|
||||
{
|
||||
constructMap[i] = -newPointI-2;
|
||||
}
|
||||
else if (newPointI >= 0)
|
||||
{
|
||||
constructMap[i] = newPointI;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn("fvMeshDistribute::mergeSharedPoints()")
|
||||
<< "Problem. oldPointI:" << oldPointI
|
||||
<< " newPointI:" << newPointI << abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noParallel();
|
||||
@ -214,7 +289,7 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
Pout<< "This is an experimental tool which tries to merge"
|
||||
Info<< "This is an experimental tool which tries to merge"
|
||||
<< " individual processor" << nl
|
||||
<< "meshes back into one master mesh. Use it if the original"
|
||||
<< " master mesh has" << nl
|
||||
@ -232,21 +307,19 @@ int main(int argc, char *argv[])
|
||||
|
||||
word regionName = polyMesh::defaultRegion;
|
||||
fileName regionPrefix = "";
|
||||
if (args.options().found("region"))
|
||||
if (args.optionFound("region"))
|
||||
{
|
||||
regionName = args.options()["region"];
|
||||
regionName = args.option("region");
|
||||
regionPrefix = regionName;
|
||||
Info<< "Operating on region " << regionName << nl << endl;
|
||||
}
|
||||
|
||||
scalar mergeTol = defaultMergeTol;
|
||||
if (args.options().found("mergeTol"))
|
||||
{
|
||||
mergeTol = readScalar(IStringStream(args.options()["mergeTol"])());
|
||||
}
|
||||
args.optionReadIfPresent("mergeTol", mergeTol);
|
||||
|
||||
scalar writeTol = Foam::pow(10.0, -scalar(IOstream::defaultPrecision()));
|
||||
|
||||
Pout<< "Merge tolerance : " << mergeTol << nl
|
||||
Info<< "Merge tolerance : " << mergeTol << nl
|
||||
<< "Write tolerance : " << writeTol << endl;
|
||||
|
||||
if (runTime.writeFormat() == IOstream::ASCII && mergeTol < writeTol)
|
||||
@ -263,15 +336,15 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
const bool fullMatch = args.options().found("fullMatch");
|
||||
const bool fullMatch = args.optionFound("fullMatch");
|
||||
|
||||
if (fullMatch)
|
||||
{
|
||||
Pout<< "Doing geometric matching on all boundary faces." << nl << endl;
|
||||
Info<< "Doing geometric matching on all boundary faces." << nl << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Pout<< "Doing geometric matching on correct procBoundaries only."
|
||||
Info<< "Doing geometric matching on correct procBoundaries only."
|
||||
<< nl << "This assumes a correct decomposition." << endl;
|
||||
}
|
||||
|
||||
@ -281,7 +354,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
while
|
||||
(
|
||||
exists
|
||||
isDir
|
||||
(
|
||||
args.rootPath()
|
||||
/ args.caseName()
|
||||
@ -292,7 +365,7 @@ int main(int argc, char *argv[])
|
||||
nProcs++;
|
||||
}
|
||||
|
||||
Pout<< "Found " << nProcs << " processor directories" << nl << endl;
|
||||
Info<< "Found " << nProcs << " processor directories" << nl << endl;
|
||||
|
||||
|
||||
// Read all databases.
|
||||
@ -300,7 +373,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll (databases, procI)
|
||||
{
|
||||
Pout<< "Reading database "
|
||||
Info<< "Reading database "
|
||||
<< args.caseName()/fileName(word("processor") + name(procI))
|
||||
<< endl;
|
||||
|
||||
@ -337,18 +410,14 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Set master time
|
||||
Pout<< "Setting master time to " << databases[0].timeName() << nl << endl;
|
||||
Info<< "Setting master time to " << databases[0].timeName() << nl << endl;
|
||||
runTime.setTime(databases[0]);
|
||||
|
||||
|
||||
// Read point on individual processors to determine merge tolerance
|
||||
// (otherwise single cell domains might give problems)
|
||||
|
||||
boundBox bb
|
||||
(
|
||||
point(GREAT, GREAT, GREAT),
|
||||
point(-GREAT, -GREAT, -GREAT)
|
||||
);
|
||||
boundBox bb = boundBox::invertedBox;
|
||||
|
||||
for (label procI = 0; procI < nProcs; procI++)
|
||||
{
|
||||
@ -373,7 +442,7 @@ int main(int argc, char *argv[])
|
||||
<< endl << exit(FatalError);
|
||||
}
|
||||
|
||||
Pout<< "Reading points from "
|
||||
Info<< "Reading points from "
|
||||
<< databases[procI].caseName()
|
||||
<< " for time = " << databases[procI].timeName()
|
||||
<< nl << endl;
|
||||
@ -401,9 +470,9 @@ int main(int argc, char *argv[])
|
||||
bb.min() = min(bb.min(), domainBb.min());
|
||||
bb.max() = max(bb.max(), domainBb.max());
|
||||
}
|
||||
const scalar mergeDist = mergeTol*mag(bb.max() - bb.min());
|
||||
const scalar mergeDist = mergeTol * bb.mag();
|
||||
|
||||
Pout<< "Overall mesh bounding box : " << bb << nl
|
||||
Info<< "Overall mesh bounding box : " << bb << nl
|
||||
<< "Relative tolerance : " << mergeTol << nl
|
||||
<< "Absolute matching distance : " << mergeDist << nl
|
||||
<< endl;
|
||||
@ -422,7 +491,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
{
|
||||
// Construct empty mesh.
|
||||
Pout<< "Constructing empty mesh to add to." << nl << endl;
|
||||
Info<< "Constructing empty mesh to add to." << nl << endl;
|
||||
polyMesh masterMesh
|
||||
(
|
||||
IOobject
|
||||
@ -432,14 +501,14 @@ int main(int argc, char *argv[])
|
||||
runTime,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
pointField(0),
|
||||
faceList(0),
|
||||
cellList(0)
|
||||
xferCopy(pointField()),
|
||||
xferCopy(faceList()),
|
||||
xferCopy(cellList())
|
||||
);
|
||||
|
||||
for (label procI = 0; procI < nProcs; procI++)
|
||||
{
|
||||
Pout<< "Reading mesh to add from "
|
||||
Info<< "Reading mesh to add from "
|
||||
<< databases[procI].caseName()
|
||||
<< " for time = " << databases[procI].timeName()
|
||||
<< nl << endl;
|
||||
@ -463,19 +532,18 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Find geometrically shared points/faces.
|
||||
autoPtr<faceCoupleInfo> couples =
|
||||
determineCoupledFaces
|
||||
(
|
||||
fullMatch,
|
||||
procI,
|
||||
masterMesh,
|
||||
meshToAdd,
|
||||
mergeDist
|
||||
);
|
||||
autoPtr<faceCoupleInfo> couples = determineCoupledFaces
|
||||
(
|
||||
fullMatch,
|
||||
procI,
|
||||
masterMesh,
|
||||
meshToAdd,
|
||||
mergeDist
|
||||
);
|
||||
|
||||
|
||||
// Add elements to mesh
|
||||
Pout<< "Adding to master mesh" << nl << endl;
|
||||
Info<< "Adding to master mesh" << nl << endl;
|
||||
|
||||
autoPtr<mapAddedPolyMesh> map = polyMeshAdder::add
|
||||
(
|
||||
@ -503,16 +571,19 @@ int main(int argc, char *argv[])
|
||||
renumber(map().addedPointMap(), pointProcAddressing[procI]);
|
||||
renumber(map().addedPatchMap(), boundaryProcAddressing[procI]);
|
||||
|
||||
Pout<< endl;
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
// See if any points on the mastermesh have become connected
|
||||
// because of connections through processor meshes.
|
||||
mergeSharedPoints(mergeDist, masterMesh, pointProcAddressing);
|
||||
|
||||
// Save some properties on the reconstructed mesh
|
||||
masterInternalFaces = masterMesh.nInternalFaces();
|
||||
masterOwner = masterMesh.faceOwner();
|
||||
|
||||
|
||||
Pout<< "\nWriting merged mesh to "
|
||||
Info<< "\nWriting merged mesh to "
|
||||
<< runTime.path()/runTime.timeName()
|
||||
<< nl << endl;
|
||||
|
||||
@ -527,12 +598,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Write the addressing
|
||||
|
||||
Pout<< "Reconstructing the addressing from the processor meshes"
|
||||
Info<< "Reconstructing the addressing from the processor meshes"
|
||||
<< " to the newly reconstructed mesh" << nl << endl;
|
||||
|
||||
forAll(databases, procI)
|
||||
{
|
||||
Pout<< "Reading processor " << procI << " mesh from "
|
||||
Info<< "Reading processor " << procI << " mesh from "
|
||||
<< databases[procI].caseName() << endl;
|
||||
|
||||
polyMesh procMesh
|
||||
@ -548,7 +619,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// From processor point to reconstructed mesh point
|
||||
|
||||
Pout<< "Writing pointProcAddressing to "
|
||||
Info<< "Writing pointProcAddressing to "
|
||||
<< databases[procI].caseName()
|
||||
/procMesh.facesInstance()
|
||||
/polyMesh::meshSubDir
|
||||
@ -572,7 +643,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// From processor face to reconstructed mesh face
|
||||
|
||||
Pout<< "Writing faceProcAddressing to "
|
||||
Info<< "Writing faceProcAddressing to "
|
||||
<< databases[procI].caseName()
|
||||
/procMesh.facesInstance()
|
||||
/polyMesh::meshSubDir
|
||||
@ -635,7 +706,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// From processor cell to reconstructed mesh cell
|
||||
|
||||
Pout<< "Writing cellProcAddressing to "
|
||||
Info<< "Writing cellProcAddressing to "
|
||||
<< databases[procI].caseName()
|
||||
/procMesh.facesInstance()
|
||||
/polyMesh::meshSubDir
|
||||
@ -660,7 +731,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// From processor patch to reconstructed mesh patch
|
||||
|
||||
Pout<< "Writing boundaryProcAddressing to "
|
||||
Info<< "Writing boundaryProcAddressing to "
|
||||
<< databases[procI].caseName()
|
||||
/procMesh.facesInstance()
|
||||
/polyMesh::meshSubDir
|
||||
@ -681,10 +752,10 @@ int main(int argc, char *argv[])
|
||||
boundaryProcAddressing[procI]
|
||||
).write();
|
||||
|
||||
Pout<< endl;
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
Pout<< "End.\n" << endl;
|
||||
Info<< "End.\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,17 @@ Application
|
||||
redistributeMeshPar
|
||||
|
||||
Description
|
||||
Parallel redecomposition of mesh.
|
||||
Redistributes existing decomposed mesh and fields according to the current
|
||||
settings in the decomposeParDict file.
|
||||
|
||||
Must be run on maximum number of source and destination processors.
|
||||
Balances mesh and writes new mesh to new time directory.
|
||||
|
||||
Can also work like decomposePar:
|
||||
|
||||
mkdir processor0
|
||||
cp -r constant processor0
|
||||
mpirun -np ddd redistributeMeshPar -parallel
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -70,10 +80,10 @@ autoPtr<fvMesh> createMesh
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
pointField(0),
|
||||
faceList(0),
|
||||
labelList(0),
|
||||
labelList(0)
|
||||
xferCopy(pointField()),
|
||||
xferCopy(faceList()),
|
||||
xferCopy(labelList()),
|
||||
xferCopy(labelList())
|
||||
);
|
||||
|
||||
if (!haveMesh)
|
||||
@ -240,11 +250,9 @@ scalar getMergeDistance
|
||||
)
|
||||
{
|
||||
scalar mergeTol = defaultMergeTol;
|
||||
if (args.options().found("mergeTol"))
|
||||
{
|
||||
mergeTol = readScalar(IStringStream(args.options()["mergeTol"])());
|
||||
}
|
||||
scalar writeTol =
|
||||
args.optionReadIfPresent("mergeTol", mergeTol);
|
||||
|
||||
scalar writeTol =
|
||||
Foam::pow(scalar(10.0), -scalar(IOstream::defaultPrecision()));
|
||||
|
||||
Info<< "Merge tolerance : " << mergeTol << nl
|
||||
@ -263,7 +271,7 @@ scalar getMergeDistance
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
scalar mergeDist = mergeTol*mag(bb.max() - bb.min());
|
||||
scalar mergeDist = mergeTol * bb.mag();
|
||||
|
||||
Info<< "Overall meshes bounding box : " << bb << nl
|
||||
<< "Relative tolerance : " << mergeTol << nl
|
||||
@ -276,26 +284,15 @@ scalar getMergeDistance
|
||||
|
||||
void printMeshData(Ostream& os, const polyMesh& mesh)
|
||||
{
|
||||
os << "Number of points: "
|
||||
<< mesh.points().size() << nl
|
||||
<< " edges: "
|
||||
<< mesh.edges().size() << nl
|
||||
<< " faces: "
|
||||
<< mesh.faces().size() << nl
|
||||
<< " internal faces: "
|
||||
<< mesh.faceNeighbour().size() << nl
|
||||
<< " cells: "
|
||||
<< mesh.cells().size() << nl
|
||||
<< " boundary patches: "
|
||||
<< mesh.boundaryMesh().size() << nl
|
||||
<< " point zones: "
|
||||
<< mesh.pointZones().size() << nl
|
||||
|
||||
<< " face zones: "
|
||||
<< mesh.faceZones().size() << nl
|
||||
|
||||
<< " cell zones: "
|
||||
<< mesh.cellZones().size() << nl;
|
||||
os << "Number of points: " << mesh.points().size() << nl
|
||||
<< " edges: " << mesh.edges().size() << nl
|
||||
<< " faces: " << mesh.faces().size() << nl
|
||||
<< " internal faces: " << mesh.faceNeighbour().size() << nl
|
||||
<< " cells: " << mesh.cells().size() << nl
|
||||
<< " boundary patches: " << mesh.boundaryMesh().size() << nl
|
||||
<< " point zones: " << mesh.pointZones().size() << nl
|
||||
<< " face zones: " << mesh.faceZones().size() << nl
|
||||
<< " cell zones: " << mesh.cellZones().size() << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -308,7 +305,7 @@ void writeDecomposition
|
||||
)
|
||||
{
|
||||
Info<< "Writing wanted cell distribution to volScalarField " << name
|
||||
<< " for postprocessing purposes." << nl << endl;
|
||||
<< " for postprocessing purposes." << nl << endl;
|
||||
|
||||
volScalarField procCells
|
||||
(
|
||||
@ -513,7 +510,7 @@ int main(int argc, char *argv[])
|
||||
# include "setRootCase.H"
|
||||
|
||||
// Create processor directory if non-existing
|
||||
if (!Pstream::master() && !dir(args.path()))
|
||||
if (!Pstream::master() && !isDir(args.path()))
|
||||
{
|
||||
Pout<< "Creating case directory " << args.path() << endl;
|
||||
mkDir(args.path());
|
||||
@ -535,7 +532,7 @@ int main(int argc, char *argv[])
|
||||
const fileName meshDir = runTime.path()/masterInstDir/polyMesh::meshSubDir;
|
||||
|
||||
boolList haveMesh(Pstream::nProcs(), false);
|
||||
haveMesh[Pstream::myProcNo()] = dir(meshDir);
|
||||
haveMesh[Pstream::myProcNo()] = isDir(meshDir);
|
||||
Pstream::gatherList(haveMesh);
|
||||
Pstream::scatterList(haveMesh);
|
||||
Info<< "Per processor mesh availability : " << haveMesh << endl;
|
||||
|
||||
Reference in New Issue
Block a user