mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev
Conflicts: src/parallel/decompose/scotchDecomp/scotchDecomp.C
This commit is contained in:
@ -64,11 +64,17 @@ Usage
|
||||
#include "IOobjectList.H"
|
||||
#include "domainDecomposition.H"
|
||||
#include "labelIOField.H"
|
||||
#include "labelFieldIOField.H"
|
||||
#include "scalarIOField.H"
|
||||
#include "scalarFieldIOField.H"
|
||||
#include "vectorIOField.H"
|
||||
#include "vectorFieldIOField.H"
|
||||
#include "sphericalTensorIOField.H"
|
||||
#include "sphericalTensorFieldIOField.H"
|
||||
#include "symmTensorIOField.H"
|
||||
#include "symmTensorFieldIOField.H"
|
||||
#include "tensorIOField.H"
|
||||
#include "tensorFieldIOField.H"
|
||||
#include "pointFields.H"
|
||||
|
||||
#include "readFields.H"
|
||||
@ -374,20 +380,42 @@ int main(int argc, char *argv[])
|
||||
PtrList< List<SLList<indexedParticle*>*> > cellParticles(cloudDirs.size());
|
||||
|
||||
PtrList<PtrList<labelIOField> > lagrangianLabelFields(cloudDirs.size());
|
||||
PtrList<PtrList<labelIOFieldField> > lagrangianLabelFieldFields
|
||||
(
|
||||
cloudDirs.size()
|
||||
);
|
||||
PtrList<PtrList<scalarIOField> > lagrangianScalarFields(cloudDirs.size());
|
||||
PtrList<PtrList<scalarIOFieldField> > lagrangianScalarFieldFields
|
||||
(
|
||||
cloudDirs.size()
|
||||
);
|
||||
PtrList<PtrList<vectorIOField> > lagrangianVectorFields(cloudDirs.size());
|
||||
PtrList<PtrList<vectorIOFieldField> > lagrangianVectorFieldFields
|
||||
(
|
||||
cloudDirs.size()
|
||||
);
|
||||
PtrList<PtrList<sphericalTensorIOField> > lagrangianSphericalTensorFields
|
||||
(
|
||||
cloudDirs.size()
|
||||
);
|
||||
PtrList<PtrList<sphericalTensorIOFieldField> >
|
||||
lagrangianSphericalTensorFieldFields(cloudDirs.size());
|
||||
PtrList<PtrList<symmTensorIOField> > lagrangianSymmTensorFields
|
||||
(
|
||||
cloudDirs.size()
|
||||
);
|
||||
PtrList<PtrList<symmTensorIOFieldField> > lagrangianSymmTensorFieldFields
|
||||
(
|
||||
cloudDirs.size()
|
||||
);
|
||||
PtrList<PtrList<tensorIOField> > lagrangianTensorFields
|
||||
(
|
||||
cloudDirs.size()
|
||||
);
|
||||
PtrList<PtrList<tensorIOFieldField> > lagrangianTensorFieldFields
|
||||
(
|
||||
cloudDirs.size()
|
||||
);
|
||||
|
||||
label cloudI = 0;
|
||||
|
||||
@ -487,6 +515,13 @@ int main(int argc, char *argv[])
|
||||
lagrangianLabelFields
|
||||
);
|
||||
|
||||
lagrangianFieldDecomposer::readFieldFields
|
||||
(
|
||||
cloudI,
|
||||
lagrangianObjects,
|
||||
lagrangianLabelFieldFields
|
||||
);
|
||||
|
||||
lagrangianFieldDecomposer::readFields
|
||||
(
|
||||
cloudI,
|
||||
@ -494,6 +529,14 @@ int main(int argc, char *argv[])
|
||||
lagrangianScalarFields
|
||||
);
|
||||
|
||||
lagrangianFieldDecomposer::readFieldFields
|
||||
(
|
||||
cloudI,
|
||||
lagrangianObjects,
|
||||
lagrangianScalarFieldFields
|
||||
);
|
||||
|
||||
|
||||
lagrangianFieldDecomposer::readFields
|
||||
(
|
||||
cloudI,
|
||||
@ -501,6 +544,13 @@ int main(int argc, char *argv[])
|
||||
lagrangianVectorFields
|
||||
);
|
||||
|
||||
lagrangianFieldDecomposer::readFieldFields
|
||||
(
|
||||
cloudI,
|
||||
lagrangianObjects,
|
||||
lagrangianVectorFieldFields
|
||||
);
|
||||
|
||||
lagrangianFieldDecomposer::readFields
|
||||
(
|
||||
cloudI,
|
||||
@ -508,6 +558,13 @@ int main(int argc, char *argv[])
|
||||
lagrangianSphericalTensorFields
|
||||
);
|
||||
|
||||
lagrangianFieldDecomposer::readFieldFields
|
||||
(
|
||||
cloudI,
|
||||
lagrangianObjects,
|
||||
lagrangianSphericalTensorFieldFields
|
||||
);
|
||||
|
||||
lagrangianFieldDecomposer::readFields
|
||||
(
|
||||
cloudI,
|
||||
@ -515,6 +572,13 @@ int main(int argc, char *argv[])
|
||||
lagrangianSymmTensorFields
|
||||
);
|
||||
|
||||
lagrangianFieldDecomposer::readFieldFields
|
||||
(
|
||||
cloudI,
|
||||
lagrangianObjects,
|
||||
lagrangianSymmTensorFieldFields
|
||||
);
|
||||
|
||||
lagrangianFieldDecomposer::readFields
|
||||
(
|
||||
cloudI,
|
||||
@ -522,6 +586,13 @@ int main(int argc, char *argv[])
|
||||
lagrangianTensorFields
|
||||
);
|
||||
|
||||
lagrangianFieldDecomposer::readFieldFields
|
||||
(
|
||||
cloudI,
|
||||
lagrangianObjects,
|
||||
lagrangianTensorFieldFields
|
||||
);
|
||||
|
||||
cloudI++;
|
||||
}
|
||||
}
|
||||
@ -529,11 +600,17 @@ int main(int argc, char *argv[])
|
||||
lagrangianPositions.setSize(cloudI);
|
||||
cellParticles.setSize(cloudI);
|
||||
lagrangianLabelFields.setSize(cloudI);
|
||||
lagrangianLabelFieldFields.setSize(cloudI);
|
||||
lagrangianScalarFields.setSize(cloudI);
|
||||
lagrangianScalarFieldFields.setSize(cloudI);
|
||||
lagrangianVectorFields.setSize(cloudI);
|
||||
lagrangianVectorFieldFields.setSize(cloudI);
|
||||
lagrangianSphericalTensorFields.setSize(cloudI);
|
||||
lagrangianSphericalTensorFieldFields.setSize(cloudI);
|
||||
lagrangianSymmTensorFields.setSize(cloudI);
|
||||
lagrangianSymmTensorFieldFields.setSize(cloudI);
|
||||
lagrangianTensorFields.setSize(cloudI);
|
||||
lagrangianTensorFieldFields.setSize(cloudI);
|
||||
|
||||
|
||||
// Any uniform data to copy/link?
|
||||
@ -725,11 +802,17 @@ int main(int argc, char *argv[])
|
||||
if
|
||||
(
|
||||
lagrangianLabelFields[cloudI].size()
|
||||
|| lagrangianLabelFieldFields[cloudI].size()
|
||||
|| lagrangianScalarFields[cloudI].size()
|
||||
|| lagrangianScalarFieldFields[cloudI].size()
|
||||
|| lagrangianVectorFields[cloudI].size()
|
||||
|| lagrangianVectorFieldFields[cloudI].size()
|
||||
|| lagrangianSphericalTensorFields[cloudI].size()
|
||||
|| lagrangianSphericalTensorFieldFields[cloudI].size()
|
||||
|| lagrangianSymmTensorFields[cloudI].size()
|
||||
|| lagrangianSymmTensorFieldFields[cloudI].size()
|
||||
|| lagrangianTensorFields[cloudI].size()
|
||||
|| lagrangianTensorFieldFields[cloudI].size()
|
||||
)
|
||||
{
|
||||
fieldDecomposer.decomposeFields
|
||||
@ -737,31 +820,61 @@ int main(int argc, char *argv[])
|
||||
cloudDirs[cloudI],
|
||||
lagrangianLabelFields[cloudI]
|
||||
);
|
||||
fieldDecomposer.decomposeFieldFields
|
||||
(
|
||||
cloudDirs[cloudI],
|
||||
lagrangianLabelFieldFields[cloudI]
|
||||
);
|
||||
fieldDecomposer.decomposeFields
|
||||
(
|
||||
cloudDirs[cloudI],
|
||||
lagrangianScalarFields[cloudI]
|
||||
);
|
||||
fieldDecomposer.decomposeFieldFields
|
||||
(
|
||||
cloudDirs[cloudI],
|
||||
lagrangianScalarFieldFields[cloudI]
|
||||
);
|
||||
fieldDecomposer.decomposeFields
|
||||
(
|
||||
cloudDirs[cloudI],
|
||||
lagrangianVectorFields[cloudI]
|
||||
);
|
||||
fieldDecomposer.decomposeFieldFields
|
||||
(
|
||||
cloudDirs[cloudI],
|
||||
lagrangianVectorFieldFields[cloudI]
|
||||
);
|
||||
fieldDecomposer.decomposeFields
|
||||
(
|
||||
cloudDirs[cloudI],
|
||||
lagrangianSphericalTensorFields[cloudI]
|
||||
);
|
||||
fieldDecomposer.decomposeFieldFields
|
||||
(
|
||||
cloudDirs[cloudI],
|
||||
lagrangianSphericalTensorFieldFields[cloudI]
|
||||
);
|
||||
fieldDecomposer.decomposeFields
|
||||
(
|
||||
cloudDirs[cloudI],
|
||||
lagrangianSymmTensorFields[cloudI]
|
||||
);
|
||||
fieldDecomposer.decomposeFieldFields
|
||||
(
|
||||
cloudDirs[cloudI],
|
||||
lagrangianSymmTensorFieldFields[cloudI]
|
||||
);
|
||||
fieldDecomposer.decomposeFields
|
||||
(
|
||||
cloudDirs[cloudI],
|
||||
lagrangianTensorFields[cloudI]
|
||||
);
|
||||
fieldDecomposer.decomposeFieldFields
|
||||
(
|
||||
cloudDirs[cloudI],
|
||||
lagrangianTensorFieldFields[cloudI]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
/*-------------------------------*- C++ -*---------------------------------*\
|
||||
| ========= |
|
||||
| \\ / OpenFOAM |
|
||||
| \\ / |
|
||||
| \\ / The Open Source CFD Toolbox |
|
||||
| \\/ http://www.OpenFOAM.org |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.6 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
|
||||
@ -112,11 +112,7 @@ Foam::domainDecomposition::domainDecomposition(const IOobject& io)
|
||||
procProcessorPatchSubPatchIDs_(nProcs_),
|
||||
procProcessorPatchSubPatchStarts_(nProcs_)
|
||||
{
|
||||
if (decompositionDict_.found("distributed"))
|
||||
{
|
||||
Switch distributed(decompositionDict_.lookup("distributed"));
|
||||
distributed_ = distributed;
|
||||
}
|
||||
decompositionDict_.readIfPresent("distributed", distributed_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -130,7 +130,7 @@ void Foam::domainDecomposition::decomposeMesh()
|
||||
procFaceAddressing_.setSize(nProcs_);
|
||||
|
||||
// Internal faces
|
||||
forAll (neighbour, facei)
|
||||
forAll(neighbour, facei)
|
||||
{
|
||||
if (cellToProc_[owner[facei]] == cellToProc_[neighbour[facei]])
|
||||
{
|
||||
@ -141,16 +141,16 @@ void Foam::domainDecomposition::decomposeMesh()
|
||||
|
||||
// for all processors, set the size of start index and patch size
|
||||
// lists to the number of patches in the mesh
|
||||
forAll (procPatchSize_, procI)
|
||||
forAll(procPatchSize_, procI)
|
||||
{
|
||||
procPatchSize_[procI].setSize(patches.size());
|
||||
procPatchStartIndex_[procI].setSize(patches.size());
|
||||
}
|
||||
|
||||
forAll (patches, patchi)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
// Reset size and start index for all processors
|
||||
forAll (procPatchSize_, procI)
|
||||
forAll(procPatchSize_, procI)
|
||||
{
|
||||
procPatchSize_[procI][patchi] = 0;
|
||||
procPatchStartIndex_[procI][patchi] =
|
||||
@ -167,7 +167,7 @@ void Foam::domainDecomposition::decomposeMesh()
|
||||
const unallocLabelList& patchFaceCells =
|
||||
patches[patchi].faceCells();
|
||||
|
||||
forAll (patchFaceCells, facei)
|
||||
forAll(patchFaceCells, facei)
|
||||
{
|
||||
const label curProc = cellToProc_[patchFaceCells[facei]];
|
||||
|
||||
@ -190,7 +190,7 @@ void Foam::domainDecomposition::decomposeMesh()
|
||||
const unallocLabelList& nbrPatchFaceCells =
|
||||
pp.neighbPatch().faceCells();
|
||||
|
||||
forAll (patchFaceCells, facei)
|
||||
forAll(patchFaceCells, facei)
|
||||
{
|
||||
const label curProc = cellToProc_[patchFaceCells[facei]];
|
||||
const label nbrProc = cellToProc_[nbrPatchFaceCells[facei]];
|
||||
@ -216,7 +216,7 @@ void Foam::domainDecomposition::decomposeMesh()
|
||||
List<DynamicList<DynamicList<label> > > interPatchFaces(nProcs_);
|
||||
|
||||
// Processor boundaries from internal faces
|
||||
forAll (neighbour, facei)
|
||||
forAll(neighbour, facei)
|
||||
{
|
||||
label ownerProc = cellToProc_[owner[facei]];
|
||||
label nbrProc = cellToProc_[neighbour[facei]];
|
||||
@ -249,7 +249,7 @@ void Foam::domainDecomposition::decomposeMesh()
|
||||
}
|
||||
|
||||
// Processor boundaries from split cyclics
|
||||
forAll (patches, patchi)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
if (isA<cyclicPolyPatch>(patches[patchi]))
|
||||
{
|
||||
@ -279,7 +279,7 @@ void Foam::domainDecomposition::decomposeMesh()
|
||||
}
|
||||
|
||||
// Add faces with different owner and neighbour processors
|
||||
forAll (patchFaceCells, facei)
|
||||
forAll(patchFaceCells, facei)
|
||||
{
|
||||
const label ownerProc = cellToProc_[patchFaceCells[facei]];
|
||||
const label nbrProc = cellToProc_[nbrPatchFaceCells[facei]];
|
||||
|
||||
@ -37,6 +37,7 @@ SourceFiles
|
||||
#define lagrangianFieldDecomposer_H
|
||||
|
||||
#include "Cloud.H"
|
||||
#include "IOFieldField.H"
|
||||
#include "indexedParticle.H"
|
||||
#include "passiveParticle.H"
|
||||
|
||||
@ -102,6 +103,19 @@ public:
|
||||
// PtrList<IOField<Type> >& lagrangianFields
|
||||
);
|
||||
|
||||
template<class Type>
|
||||
static void readFieldFields
|
||||
(
|
||||
const label cloudI,
|
||||
const IOobjectList& lagrangianObjects,
|
||||
PtrList
|
||||
<
|
||||
PtrList<IOFieldField<Field<Type>, Type> >
|
||||
>& lagrangianFields
|
||||
// PtrList<IOFieldField<Field<Type>, Type > >& lagrangianFields
|
||||
);
|
||||
|
||||
|
||||
//- Decompose volume field
|
||||
template<class Type>
|
||||
tmp<IOField<Type> > decomposeField
|
||||
@ -110,12 +124,27 @@ public:
|
||||
const IOField<Type>& field
|
||||
) const;
|
||||
|
||||
template<class Type>
|
||||
tmp<IOFieldField<Field<Type>, Type> > decomposeFieldField
|
||||
(
|
||||
const word& cloudName,
|
||||
const IOFieldField<Field<Type>, Type>& field
|
||||
) const;
|
||||
|
||||
|
||||
template<class GeoField>
|
||||
void decomposeFields
|
||||
(
|
||||
const word& cloudName,
|
||||
const PtrList<GeoField>& fields
|
||||
) const;
|
||||
|
||||
template<class GeoField>
|
||||
void decomposeFieldFields
|
||||
(
|
||||
const word& cloudName,
|
||||
const PtrList<GeoField>& fields
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -63,6 +63,56 @@ void Foam::lagrangianFieldDecomposer::readFields
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::lagrangianFieldDecomposer::readFieldFields
|
||||
(
|
||||
const label cloudI,
|
||||
const IOobjectList& lagrangianObjects,
|
||||
PtrList<PtrList<IOFieldField<Field<Type>, Type> > >& lagrangianFields
|
||||
)
|
||||
{
|
||||
// Search list of objects for lagrangian fields
|
||||
IOobjectList lagrangianTypeObjectsA
|
||||
(
|
||||
lagrangianObjects.lookupClass(IOField<Field<Type> >::typeName)
|
||||
);
|
||||
|
||||
IOobjectList lagrangianTypeObjectsB
|
||||
(
|
||||
lagrangianObjects.lookupClass(IOFieldField<Field<Type>, Type>::typeName)
|
||||
);
|
||||
|
||||
lagrangianFields.set
|
||||
(
|
||||
cloudI,
|
||||
new PtrList<IOFieldField<Field<Type>, Type> >
|
||||
(
|
||||
lagrangianTypeObjectsA.size() + lagrangianTypeObjectsB.size()
|
||||
)
|
||||
);
|
||||
|
||||
label lagrangianFieldi=0;
|
||||
|
||||
forAllIter(IOobjectList, lagrangianTypeObjectsA, iter)
|
||||
{
|
||||
lagrangianFields[cloudI].set
|
||||
(
|
||||
lagrangianFieldi++,
|
||||
new IOFieldField<Field<Type>, Type>(*iter())
|
||||
);
|
||||
}
|
||||
|
||||
forAllIter(IOobjectList, lagrangianTypeObjectsB, iter)
|
||||
{
|
||||
lagrangianFields[cloudI].set
|
||||
(
|
||||
lagrangianFieldi++,
|
||||
new IOFieldField<Field<Type>, Type>(*iter())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::IOField<Type> >
|
||||
Foam::lagrangianFieldDecomposer::decomposeField
|
||||
@ -94,6 +144,37 @@ Foam::lagrangianFieldDecomposer::decomposeField
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::IOFieldField<Foam::Field<Type>, Type> >
|
||||
Foam::lagrangianFieldDecomposer::decomposeFieldField
|
||||
(
|
||||
const word& cloudName,
|
||||
const IOFieldField<Field<Type>, Type>& field
|
||||
) const
|
||||
{
|
||||
// Create and map the internal field values
|
||||
Field<Field<Type> > procField(field, particleIndices_);
|
||||
|
||||
// Create the field for the processor
|
||||
return tmp<IOFieldField<Field<Type>, Type> >
|
||||
(
|
||||
new IOFieldField<Field<Type>, Type>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
field.name(),
|
||||
procMesh_.time().timeName(),
|
||||
cloud::prefix/cloudName,
|
||||
procMesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
procField
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class GeoField>
|
||||
void Foam::lagrangianFieldDecomposer::decomposeFields
|
||||
(
|
||||
@ -111,4 +192,21 @@ void Foam::lagrangianFieldDecomposer::decomposeFields
|
||||
}
|
||||
|
||||
|
||||
template<class GeoField>
|
||||
void Foam::lagrangianFieldDecomposer::decomposeFieldFields
|
||||
(
|
||||
const word& cloudName,
|
||||
const PtrList<GeoField>& fields
|
||||
) const
|
||||
{
|
||||
if (particleIndices_.size())
|
||||
{
|
||||
forAll(fields, fieldI)
|
||||
{
|
||||
decomposeFieldField(cloudName, fields[fieldI])().write();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
Reference in New Issue
Block a user