mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
move reconstructPar 'guts' to src/parallel/reconstruct
- in preparation for adding an optional '-reconstruct' to a few utilities
re-use as -lreconstruct library
- move related stuff there too
src/decompositionMethods/decompositionMethods
-> src/parallel/decompositionMethods
- added missing namespace qualifiers
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
decomposeMesh.C
|
||||
decomposePar.C
|
||||
domainDecomposition.C
|
||||
distributeCells.C
|
||||
domainDecompositionMesh.C
|
||||
domainDecompositionDistribute.C
|
||||
fvFieldDecomposer.C
|
||||
pointFieldDecomposer.C
|
||||
lagrangianFieldDecomposer.C
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
@ -106,7 +106,6 @@ int main(int argc, char *argv[])
|
||||
Info<< "Decomposing mesh " << regionName << nl << endl;
|
||||
}
|
||||
|
||||
|
||||
bool writeCellDist = args.optionFound("cellDist");
|
||||
bool copyUniform = args.optionFound("copyUniform");
|
||||
bool decomposeFieldsOnly = args.optionFound("fields");
|
||||
|
||||
@ -38,7 +38,7 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void domainDecomposition::mark
|
||||
void Foam::domainDecomposition::mark
|
||||
(
|
||||
const labelList& zoneElems,
|
||||
const label zoneI,
|
||||
@ -66,7 +66,7 @@ void domainDecomposition::mark
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// from components
|
||||
domainDecomposition::domainDecomposition(const IOobject& io)
|
||||
Foam::domainDecomposition::domainDecomposition(const IOobject& io)
|
||||
:
|
||||
fvMesh(io),
|
||||
decompositionDict_
|
||||
@ -105,13 +105,13 @@ domainDecomposition::domainDecomposition(const IOobject& io)
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
domainDecomposition::~domainDecomposition()
|
||||
Foam::domainDecomposition::~domainDecomposition()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool domainDecomposition::writeDecomposition()
|
||||
bool Foam::domainDecomposition::writeDecomposition()
|
||||
{
|
||||
Info<< "\nConstructing processor meshes" << endl;
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ Class
|
||||
Foam::domainDecomposition
|
||||
|
||||
Description
|
||||
Automatic domain decomposition class for FOAM meshes
|
||||
Automatic domain decomposition class for finite-volume meshes
|
||||
|
||||
SourceFiles
|
||||
domainDecomposition.C
|
||||
@ -42,13 +42,11 @@ SourceFiles
|
||||
#include "PtrList.H"
|
||||
#include "point.H"
|
||||
|
||||
#ifndef namespaceFoam
|
||||
#define namespaceFoam
|
||||
using namespace Foam;
|
||||
#endif
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class domainDecomposition Declaration
|
||||
Class domainDecomposition Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class domainDecomposition
|
||||
@ -79,7 +77,7 @@ class domainDecomposition
|
||||
// original face. In order to do this properly, all face
|
||||
// indices will be incremented by 1 and the decremented as
|
||||
// necessary t avoid the problem of face number zero having no
|
||||
// sign.
|
||||
// sign.
|
||||
labelListList procFaceAddressing_;
|
||||
|
||||
//- Labels of cells for each processor
|
||||
@ -165,6 +163,11 @@ public:
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
@ -33,7 +33,7 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
void domainDecomposition::distributeCells()
|
||||
void Foam::domainDecomposition::distributeCells()
|
||||
{
|
||||
Info<< "\nCalculating distribution of cells" << endl;
|
||||
|
||||
@ -40,7 +40,7 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
void Foam::domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
{
|
||||
// Decide which cell goes to which processor
|
||||
distributeCells();
|
||||
@ -775,3 +775,5 @@ void domainDecomposition::decomposeMesh(const bool filterEmptyPatches)
|
||||
sort(globallySharedPoints_);
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -26,14 +26,10 @@ License
|
||||
|
||||
#include "fvFieldDecomposer.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
fvFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
Foam::fvFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
(
|
||||
const unallocLabelList& addressingSlice,
|
||||
const label addressingOffset
|
||||
@ -41,15 +37,15 @@ fvFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
:
|
||||
directAddressing_(addressingSlice)
|
||||
{
|
||||
forAll (directAddressing_, i)
|
||||
forAll(directAddressing_, i)
|
||||
{
|
||||
// Subtract one to align addressing.
|
||||
// Subtract one to align addressing.
|
||||
directAddressing_[i] -= addressingOffset + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fvFieldDecomposer::processorVolPatchFieldDecomposer::
|
||||
Foam::fvFieldDecomposer::processorVolPatchFieldDecomposer::
|
||||
processorVolPatchFieldDecomposer
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
@ -61,9 +57,9 @@ processorVolPatchFieldDecomposer
|
||||
const labelList& own = mesh.faceOwner();
|
||||
const labelList& neighb = mesh.faceNeighbour();
|
||||
|
||||
forAll (directAddressing_, i)
|
||||
forAll(directAddressing_, i)
|
||||
{
|
||||
// Subtract one to align addressing.
|
||||
// Subtract one to align addressing.
|
||||
label ai = mag(addressingSlice[i]) - 1;
|
||||
|
||||
if (ai < neighb.size())
|
||||
@ -97,7 +93,7 @@ processorVolPatchFieldDecomposer
|
||||
}
|
||||
|
||||
|
||||
fvFieldDecomposer::processorSurfacePatchFieldDecomposer::
|
||||
Foam::fvFieldDecomposer::processorSurfacePatchFieldDecomposer::
|
||||
processorSurfacePatchFieldDecomposer
|
||||
(
|
||||
const unallocLabelList& addressingSlice
|
||||
@ -106,7 +102,7 @@ processorSurfacePatchFieldDecomposer
|
||||
addressing_(addressingSlice.size()),
|
||||
weights_(addressingSlice.size())
|
||||
{
|
||||
forAll (addressing_, i)
|
||||
forAll(addressing_, i)
|
||||
{
|
||||
addressing_[i].setSize(1);
|
||||
weights_[i].setSize(1);
|
||||
@ -117,7 +113,7 @@ processorSurfacePatchFieldDecomposer
|
||||
}
|
||||
|
||||
|
||||
fvFieldDecomposer::fvFieldDecomposer
|
||||
Foam::fvFieldDecomposer::fvFieldDecomposer
|
||||
(
|
||||
const fvMesh& completeMesh,
|
||||
const fvMesh& procMesh,
|
||||
@ -147,7 +143,7 @@ fvFieldDecomposer::fvFieldDecomposer
|
||||
static_cast<processorSurfacePatchFieldDecomposer*>(NULL)
|
||||
)
|
||||
{
|
||||
forAll (boundaryAddressing_, patchi)
|
||||
forAll(boundaryAddressing_, patchi)
|
||||
{
|
||||
if (boundaryAddressing_[patchi] >= 0)
|
||||
{
|
||||
@ -162,14 +158,14 @@ fvFieldDecomposer::fvFieldDecomposer
|
||||
}
|
||||
else
|
||||
{
|
||||
processorVolPatchFieldDecomposerPtrs_[patchi] =
|
||||
processorVolPatchFieldDecomposerPtrs_[patchi] =
|
||||
new processorVolPatchFieldDecomposer
|
||||
(
|
||||
completeMesh_,
|
||||
procMesh_.boundary()[patchi].patchSlice(faceAddressing_)
|
||||
);
|
||||
|
||||
processorSurfacePatchFieldDecomposerPtrs_[patchi] =
|
||||
processorSurfacePatchFieldDecomposerPtrs_[patchi] =
|
||||
new processorSurfacePatchFieldDecomposer
|
||||
(
|
||||
static_cast<const unallocLabelList&>
|
||||
@ -187,9 +183,9 @@ fvFieldDecomposer::fvFieldDecomposer
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
fvFieldDecomposer::~fvFieldDecomposer()
|
||||
Foam::fvFieldDecomposer::~fvFieldDecomposer()
|
||||
{
|
||||
forAll (patchFieldDecomposerPtrs_, patchi)
|
||||
forAll(patchFieldDecomposerPtrs_, patchi)
|
||||
{
|
||||
if (patchFieldDecomposerPtrs_[patchi])
|
||||
{
|
||||
@ -197,7 +193,7 @@ fvFieldDecomposer::~fvFieldDecomposer()
|
||||
}
|
||||
}
|
||||
|
||||
forAll (processorVolPatchFieldDecomposerPtrs_, patchi)
|
||||
forAll(processorVolPatchFieldDecomposerPtrs_, patchi)
|
||||
{
|
||||
if (processorVolPatchFieldDecomposerPtrs_[patchi])
|
||||
{
|
||||
@ -205,7 +201,7 @@ fvFieldDecomposer::~fvFieldDecomposer()
|
||||
}
|
||||
}
|
||||
|
||||
forAll (processorSurfacePatchFieldDecomposerPtrs_, patchi)
|
||||
forAll(processorSurfacePatchFieldDecomposerPtrs_, patchi)
|
||||
{
|
||||
if (processorSurfacePatchFieldDecomposerPtrs_[patchi])
|
||||
{
|
||||
@ -214,9 +210,4 @@ fvFieldDecomposer::~fvFieldDecomposer()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -28,16 +28,11 @@ License
|
||||
#include "processorFvPatchField.H"
|
||||
#include "processorFvsPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> >
|
||||
fvFieldDecomposer::decomposeField
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||
Foam::fvFieldDecomposer::decomposeField
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field
|
||||
) const
|
||||
@ -106,8 +101,8 @@ fvFieldDecomposer::decomposeField
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
fvFieldDecomposer::decomposeField
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >
|
||||
Foam::fvFieldDecomposer::decomposeField
|
||||
(
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh>& field
|
||||
) const
|
||||
@ -217,7 +212,7 @@ fvFieldDecomposer::decomposeField
|
||||
|
||||
|
||||
template<class GeoField>
|
||||
void fvFieldDecomposer::decomposeFields
|
||||
void Foam::fvFieldDecomposer::decomposeFields
|
||||
(
|
||||
const PtrList<GeoField>& fields
|
||||
) const
|
||||
@ -229,8 +224,4 @@ void fvFieldDecomposer::decomposeFields
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -29,16 +29,10 @@ Description
|
||||
|
||||
#include "lagrangianFieldDecomposer.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct from components
|
||||
lagrangianFieldDecomposer::lagrangianFieldDecomposer
|
||||
Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const polyMesh& procMesh,
|
||||
@ -88,6 +82,4 @@ lagrangianFieldDecomposer::lagrangianFieldDecomposer
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -27,15 +27,10 @@ License
|
||||
#include "lagrangianFieldDecomposer.H"
|
||||
#include "IOobjectList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
void lagrangianFieldDecomposer::readFields
|
||||
void Foam::lagrangianFieldDecomposer::readFields
|
||||
(
|
||||
const label cloudI,
|
||||
const IOobjectList& lagrangianObjects,
|
||||
@ -70,7 +65,8 @@ void lagrangianFieldDecomposer::readFields
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<IOField<Type> > lagrangianFieldDecomposer::decomposeField
|
||||
Foam::tmp<Foam::IOField<Type> >
|
||||
Foam::lagrangianFieldDecomposer::decomposeField
|
||||
(
|
||||
const word& cloudName,
|
||||
const IOField<Type>& field
|
||||
@ -100,7 +96,7 @@ tmp<IOField<Type> > lagrangianFieldDecomposer::decomposeField
|
||||
|
||||
|
||||
template<class GeoField>
|
||||
void lagrangianFieldDecomposer::decomposeFields
|
||||
void Foam::lagrangianFieldDecomposer::decomposeFields
|
||||
(
|
||||
const word& cloudName,
|
||||
const PtrList<GeoField>& fields
|
||||
@ -116,8 +112,4 @@ void lagrangianFieldDecomposer::decomposeFields
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -26,14 +26,9 @@ License
|
||||
|
||||
#include "pointFieldDecomposer.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
|
||||
Foam::pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
(
|
||||
const pointPatch& completeMeshPatch,
|
||||
const pointPatch& procMeshPatch,
|
||||
@ -52,7 +47,7 @@ pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
|
||||
const labelList& completeMeshPatchPoints = completeMeshPatch.meshPoints();
|
||||
|
||||
forAll (completeMeshPatchPoints, pointi)
|
||||
forAll(completeMeshPatchPoints, pointi)
|
||||
{
|
||||
pointMap[completeMeshPatchPoints[pointi]] = pointi;
|
||||
}
|
||||
@ -61,7 +56,7 @@ pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
// patch
|
||||
const labelList& procMeshPatchPoints = procMeshPatch.meshPoints();
|
||||
|
||||
forAll (procMeshPatchPoints, pointi)
|
||||
forAll(procMeshPatchPoints, pointi)
|
||||
{
|
||||
directAddressing_[pointi] =
|
||||
pointMap[directAddr[procMeshPatchPoints[pointi]]];
|
||||
@ -79,7 +74,7 @@ pointFieldDecomposer::patchFieldDecomposer::patchFieldDecomposer
|
||||
}
|
||||
|
||||
|
||||
pointFieldDecomposer::pointFieldDecomposer
|
||||
Foam::pointFieldDecomposer::pointFieldDecomposer
|
||||
(
|
||||
const pointMesh& completeMesh,
|
||||
const pointMesh& procMesh,
|
||||
@ -97,7 +92,7 @@ pointFieldDecomposer::pointFieldDecomposer
|
||||
static_cast<patchFieldDecomposer*>(NULL)
|
||||
)
|
||||
{
|
||||
forAll (boundaryAddressing_, patchi)
|
||||
forAll(boundaryAddressing_, patchi)
|
||||
{
|
||||
if (boundaryAddressing_[patchi] >= 0)
|
||||
{
|
||||
@ -114,9 +109,9 @@ pointFieldDecomposer::pointFieldDecomposer
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
pointFieldDecomposer::~pointFieldDecomposer()
|
||||
Foam::pointFieldDecomposer::~pointFieldDecomposer()
|
||||
{
|
||||
forAll (patchFieldDecomposerPtrs_, patchi)
|
||||
forAll(patchFieldDecomposerPtrs_, patchi)
|
||||
{
|
||||
if (patchFieldDecomposerPtrs_[patchi])
|
||||
{
|
||||
@ -128,6 +123,4 @@ pointFieldDecomposer::~pointFieldDecomposer()
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -28,16 +28,11 @@ License
|
||||
#include "processorPointPatchFields.H"
|
||||
#include "globalPointPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh> >
|
||||
pointFieldDecomposer::decomposeField
|
||||
Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> >
|
||||
Foam::pointFieldDecomposer::decomposeField
|
||||
(
|
||||
const GeometricField<Type, pointPatchField, pointMesh>& field
|
||||
) const
|
||||
@ -117,7 +112,7 @@ pointFieldDecomposer::decomposeField
|
||||
|
||||
|
||||
template<class GeoField>
|
||||
void pointFieldDecomposer::decomposeFields
|
||||
void Foam::pointFieldDecomposer::decomposeFields
|
||||
(
|
||||
const PtrList<GeoField>& fields
|
||||
) const
|
||||
@ -131,6 +126,4 @@ void pointFieldDecomposer::decomposeFields
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
Reference in New Issue
Block a user