mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge remote-tracking branch 'upstream/develop' into wp3-directional-refinement
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -1094,7 +1094,9 @@ int main(int argc, char *argv[])
|
||||
// Update proc maps
|
||||
if (cellProcAddressing.headerOk())
|
||||
{
|
||||
if (cellProcAddressing.size() == mesh.nCells())
|
||||
bool localOk = (cellProcAddressing.size() == mesh.nCells());
|
||||
|
||||
if (returnReduce(localOk, andOp<bool>()))
|
||||
{
|
||||
Info<< "Renumbering processor cell decomposition map "
|
||||
<< cellProcAddressing.name() << endl;
|
||||
@ -1118,7 +1120,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (faceProcAddressing.headerOk())
|
||||
{
|
||||
if (faceProcAddressing.size() == mesh.nFaces())
|
||||
bool localOk = (faceProcAddressing.size() == mesh.nFaces());
|
||||
|
||||
if (returnReduce(localOk, andOp<bool>()))
|
||||
{
|
||||
Info<< "Renumbering processor face decomposition map "
|
||||
<< faceProcAddressing.name() << endl;
|
||||
@ -1158,7 +1162,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (pointProcAddressing.headerOk())
|
||||
{
|
||||
if (pointProcAddressing.size() == mesh.nPoints())
|
||||
bool localOk = (pointProcAddressing.size() == mesh.nPoints());
|
||||
|
||||
if (returnReduce(localOk, andOp<bool>()))
|
||||
{
|
||||
Info<< "Renumbering processor point decomposition map "
|
||||
<< pointProcAddressing.name() << endl;
|
||||
@ -1182,7 +1188,16 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (boundaryProcAddressing.headerOk())
|
||||
{
|
||||
if (boundaryProcAddressing.size() != mesh.boundaryMesh().size())
|
||||
bool localOk =
|
||||
(
|
||||
boundaryProcAddressing.size()
|
||||
== mesh.boundaryMesh().size()
|
||||
);
|
||||
if (returnReduce(localOk, andOp<bool>()))
|
||||
{
|
||||
// No renumbering needed
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Not writing inconsistent processor patch decomposition"
|
||||
<< " map " << boundaryProcAddressing.filePath() << endl;
|
||||
|
||||
@ -125,12 +125,6 @@ Foam::domainDecomposition::domainDecomposition
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::domainDecomposition::~domainDecomposition()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
|
||||
@ -160,7 +160,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from IOobjects (for mesh and optional non-standard
|
||||
// decomposeParDict location)
|
||||
//- decomposeParDict location)
|
||||
domainDecomposition
|
||||
(
|
||||
const IOobject& io,
|
||||
@ -169,7 +169,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
~domainDecomposition();
|
||||
~domainDecomposition() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -204,7 +204,6 @@ public:
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
|
||||
@ -34,11 +34,11 @@ License
|
||||
#include "OSspecific.H"
|
||||
#include "Map.H"
|
||||
#include "globalMeshData.H"
|
||||
|
||||
#include "decompositionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void faMeshDecomposition::distributeFaces()
|
||||
void Foam::faMeshDecomposition::distributeFaces()
|
||||
{
|
||||
Info<< "\nCalculating distribution of faces" << endl;
|
||||
|
||||
@ -71,7 +71,7 @@ void faMeshDecomposition::distributeFaces()
|
||||
// located at the end of the faceProcAddressing, cutting it at
|
||||
// i = owner.size() will correctly decompose faMesh faces.
|
||||
// Vanja Skuric, 2016-04-21
|
||||
if (decompositionDict_.found("globalFaceZones"))
|
||||
if (hasGlobalFaceZones_)
|
||||
{
|
||||
labelList faceProcAddressing
|
||||
(
|
||||
@ -153,25 +153,30 @@ void faMeshDecomposition::distributeFaces()
|
||||
<< " s" << endl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// from components
|
||||
faMeshDecomposition::faMeshDecomposition(const fvMesh& mesh)
|
||||
Foam::faMeshDecomposition::faMeshDecomposition
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const fileName& decompDictFile
|
||||
)
|
||||
:
|
||||
faMesh(mesh),
|
||||
decompositionDict_
|
||||
decompDictFile_(decompDictFile),
|
||||
nProcs_
|
||||
(
|
||||
IOobject
|
||||
decompositionMethod::nDomains
|
||||
(
|
||||
"decomposeParDict",
|
||||
time().system(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
decompositionModel::New
|
||||
(
|
||||
mesh,
|
||||
decompDictFile
|
||||
)
|
||||
)
|
||||
),
|
||||
nProcs_(readInt(decompositionDict_.lookup("numberOfSubdomains"))),
|
||||
distributed_(false),
|
||||
hasGlobalFaceZones_(false),
|
||||
faceToProc_(nFaces()),
|
||||
procFaceLabels_(nProcs_),
|
||||
procMeshEdgesMap_(nProcs_),
|
||||
@ -190,22 +195,20 @@ faMeshDecomposition::faMeshDecomposition(const fvMesh& mesh)
|
||||
globallySharedPoints_(0),
|
||||
cyclicParallel_(false)
|
||||
{
|
||||
if (decompositionDict_.found("distributed"))
|
||||
{
|
||||
distributed_ = Switch(decompositionDict_.lookup("distributed"));
|
||||
}
|
||||
const decompositionModel& model = decompositionModel::New
|
||||
(
|
||||
mesh,
|
||||
decompDictFile
|
||||
);
|
||||
|
||||
model.readIfPresent("distributed", distributed_);
|
||||
hasGlobalFaceZones_ = model.found("globalFaceZones");
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
faMeshDecomposition::~faMeshDecomposition()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void faMeshDecomposition::decomposeMesh()
|
||||
void Foam::faMeshDecomposition::decomposeMesh()
|
||||
{
|
||||
// Decide which cell goes to which processor
|
||||
distributeFaces();
|
||||
@ -273,7 +276,7 @@ void faMeshDecomposition::decomposeMesh()
|
||||
)
|
||||
);
|
||||
|
||||
HashTable<label, label, Hash<label> > fvFaceProcAddressingHash;
|
||||
Map<label> fvFaceProcAddressingHash;
|
||||
|
||||
{
|
||||
labelIOList fvFaceProcAddressing
|
||||
@ -323,11 +326,11 @@ void faMeshDecomposition::decomposeMesh()
|
||||
const indirectPrimitivePatch& patch = this->patch();
|
||||
const Map<label>& map = patch.meshPointMap();
|
||||
|
||||
HashTable<label, edge, Hash<edge> > edgesHash;
|
||||
EdgeMap<label> edgesHash;
|
||||
|
||||
label edgeI = -1;
|
||||
|
||||
label nIntEdges = patch.nInternalEdges();
|
||||
const label nIntEdges = patch.nInternalEdges();
|
||||
|
||||
for (label curEdge = 0; curEdge < nIntEdges; curEdge++)
|
||||
{
|
||||
@ -338,7 +341,7 @@ void faMeshDecomposition::decomposeMesh()
|
||||
{
|
||||
// Include emptyFaPatch
|
||||
|
||||
label size = boundary()[patchI].labelList::size();
|
||||
const label size = boundary()[patchI].labelList::size();
|
||||
|
||||
for(int eI=0; eI<size; eI++)
|
||||
{
|
||||
@ -428,8 +431,8 @@ void faMeshDecomposition::decomposeMesh()
|
||||
// inside boundaries for the owner processor and try to find
|
||||
// this inter-processor patch.
|
||||
|
||||
label ownerProc = faceToProc_[owner[edgeI]];
|
||||
label neighbourProc = faceToProc_[neighbour[edgeI]];
|
||||
const label ownerProc = faceToProc_[owner[edgeI]];
|
||||
const label neighbourProc = faceToProc_[neighbour[edgeI]];
|
||||
|
||||
SLList<label>::iterator curInterProcBdrsOwnIter =
|
||||
interProcBoundaries[ownerProc].begin();
|
||||
@ -559,7 +562,7 @@ void faMeshDecomposition::decomposeMesh()
|
||||
|
||||
const labelListList& eF = patch().edgeFaces();
|
||||
|
||||
label size = patches[patchI].labelList::size();
|
||||
const label size = patches[patchI].labelList::size();
|
||||
|
||||
labelList patchEdgeFaces(size, -1);
|
||||
|
||||
@ -1153,7 +1156,7 @@ void faMeshDecomposition::decomposeMesh()
|
||||
}
|
||||
|
||||
|
||||
bool faMeshDecomposition::writeDecomposition()
|
||||
bool Foam::faMeshDecomposition::writeDecomposition()
|
||||
{
|
||||
Info<< "\nConstructing processor FA meshes" << endl;
|
||||
|
||||
@ -1412,3 +1415,6 @@ bool faMeshDecomposition::writeDecomposition()
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -48,10 +48,8 @@ SourceFiles
|
||||
#include "PtrList.H"
|
||||
#include "point.H"
|
||||
|
||||
#ifndef namespaceFoam
|
||||
#define namespaceFoam
|
||||
using namespace Foam;
|
||||
#endif
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class faMeshDecomposition Declaration
|
||||
@ -63,8 +61,8 @@ class faMeshDecomposition
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Mesh decomposition control dictionary
|
||||
IOdictionary decompositionDict_;
|
||||
//- Optional non-standard file for decomposeParDict
|
||||
const fileName decompDictFile_;
|
||||
|
||||
//- Number of processors in decomposition
|
||||
label nProcs_;
|
||||
@ -72,6 +70,9 @@ class faMeshDecomposition
|
||||
//- Is the decomposition data to be distributed for each processor
|
||||
bool distributed_;
|
||||
|
||||
//- Are globalFaceZones being used
|
||||
bool hasGlobalFaceZones_;
|
||||
|
||||
//- Processor label for each cell
|
||||
labelList faceToProc_;
|
||||
|
||||
@ -134,13 +135,17 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from fvMesh
|
||||
faMeshDecomposition(const fvMesh& mesh);
|
||||
//- Construct from fvMesh (for mesh and optional non-standard
|
||||
//- decomposeParDict location)
|
||||
faMeshDecomposition
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const fileName& decompDictFile = ""
|
||||
);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
~faMeshDecomposition();
|
||||
//- Destructor
|
||||
~faMeshDecomposition() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -171,6 +176,10 @@ public:
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
@ -2545,7 +2545,8 @@ int main(int argc, char *argv[])
|
||||
haveMesh[Pstream::myProcNo()] = isFile(meshPath);
|
||||
Pstream::gatherList(haveMesh);
|
||||
Pstream::scatterList(haveMesh);
|
||||
Info<< "Per processor mesh availability : " << haveMesh << endl;
|
||||
Info<< "Per processor mesh availability:" << nl
|
||||
<< " " << flatOutput(haveMesh) << nl << endl;
|
||||
|
||||
|
||||
// Addressing back to reconstructed mesh as xxxProcAddressing.
|
||||
@ -2898,7 +2899,8 @@ int main(int argc, char *argv[])
|
||||
haveMesh[Pstream::myProcNo()] = isFile(meshPath);
|
||||
Pstream::gatherList(haveMesh);
|
||||
Pstream::scatterList(haveMesh);
|
||||
Info<< "Per processor mesh availability : " << haveMesh << endl;
|
||||
Info<< "Per processor mesh availability:" << nl
|
||||
<< " " << flatOutput(haveMesh) << nl << endl;
|
||||
|
||||
// Load mesh (or create dummy one)
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@ -2930,7 +2932,7 @@ int main(int argc, char *argv[])
|
||||
fvMesh& mesh = meshPtr();
|
||||
|
||||
|
||||
label nOldCells = mesh.nCells();
|
||||
const label nOldCells = mesh.nCells();
|
||||
//Pout<< "Loaded mesh : nCells:" << nOldCells
|
||||
// << " nPatches:" << mesh.boundaryMesh().size() << endl;
|
||||
|
||||
|
||||
@ -74,7 +74,7 @@ void Foam::ensightCloud::writePositions
|
||||
// Master
|
||||
forAllConstIter(Cloud<passiveParticle>, cloudPtr(), elmnt)
|
||||
{
|
||||
const point& p = elmnt().position();
|
||||
const point p(elmnt().position());
|
||||
|
||||
os.write(p.x());
|
||||
os.write(p.y());
|
||||
@ -104,7 +104,7 @@ void Foam::ensightCloud::writePositions
|
||||
label parcelId = 0;
|
||||
forAllConstIter(Cloud<passiveParticle>, cloudPtr(), elmnt)
|
||||
{
|
||||
const point& p = elmnt().position();
|
||||
const point p(elmnt().position());
|
||||
|
||||
os.write(++parcelId, 8); // unusual width
|
||||
os.write(p.x());
|
||||
@ -140,7 +140,7 @@ void Foam::ensightCloud::writePositions
|
||||
label pti = 0;
|
||||
forAllConstIter(Cloud<passiveParticle>, cloudPtr(), elmnt)
|
||||
{
|
||||
const point& p = elmnt().position();
|
||||
const point p(elmnt().position());
|
||||
points[pti++] = p;
|
||||
}
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ void Foam::vtk::lagrangianWriter::writePoints()
|
||||
|
||||
forAllConstIters(parcels, iter)
|
||||
{
|
||||
const point& pt = iter().position();
|
||||
const point pt(iter().position());
|
||||
|
||||
vtk::write(format(), pt);
|
||||
}
|
||||
|
||||
@ -283,7 +283,7 @@ int main(int argc, char *argv[])
|
||||
forAll(ids, j)
|
||||
{
|
||||
const label localId = particleIds[j];
|
||||
const vector& pos = particles[localId].position();
|
||||
const vector pos(particles[localId].position());
|
||||
os << pos.x() << ' ' << pos.y() << ' ' << pos.z()
|
||||
<< nl;
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -133,7 +133,6 @@ void createFieldFiles
|
||||
Info<< " Generating field files" << nl << endl;
|
||||
|
||||
// Create files
|
||||
mkDir(runTime.path()/runTime.timeName()/regionName);
|
||||
forAll(fieldNames, i)
|
||||
{
|
||||
const_cast<word&>(IOdictionary::typeName) =
|
||||
@ -181,8 +180,8 @@ void createFieldFiles
|
||||
field2.remove("initialConditions");
|
||||
field2.remove("boundaryConditions");
|
||||
|
||||
// Construct and write field dictionary
|
||||
IOdictionary fieldOut
|
||||
// Construct and write field dictionary. Note use of localIOdictionary
|
||||
localIOdictionary fieldOut
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user