mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add regular expressions for reconstructPar, mapFieldsPar -fields option
- improved flexibility - reconstruction of Lagrangian positions/fields now handled as a class for better modularity
This commit is contained in:
@ -42,7 +42,7 @@ Description
|
|||||||
#include "regionProperties.H"
|
#include "regionProperties.H"
|
||||||
#include "fvFieldReconstructor.H"
|
#include "fvFieldReconstructor.H"
|
||||||
#include "pointFieldReconstructor.H"
|
#include "pointFieldReconstructor.H"
|
||||||
#include "reconstructLagrangian.H"
|
#include "lagrangianReconstructor.H"
|
||||||
|
|
||||||
#include "faCFD.H"
|
#include "faCFD.H"
|
||||||
#include "faMesh.H"
|
#include "faMesh.H"
|
||||||
@ -95,9 +95,9 @@ int main(int argc, char *argv[])
|
|||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"fields",
|
"fields",
|
||||||
"list",
|
"wordRes",
|
||||||
"Specify a list of fields to be reconstructed. Eg, '(U T p)' - "
|
"Specify single or multiple fields to reconstruct (all by default)."
|
||||||
"regular expressions not currently supported"
|
" Eg, 'T' or '(p T U \"alpha.*\")'"
|
||||||
);
|
);
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
@ -107,16 +107,18 @@ int main(int argc, char *argv[])
|
|||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"lagrangianFields",
|
"lagrangianFields",
|
||||||
"list",
|
"wordRes",
|
||||||
"Specify a list of lagrangian fields to be reconstructed. Eg, '(U d)' -"
|
"Specify single or multiple lagrangian fields to reconstruct"
|
||||||
"regular expressions not currently supported, "
|
" (all by default)."
|
||||||
"positions always included."
|
" Eg, '(U d)'"
|
||||||
|
" - Positions are always included."
|
||||||
);
|
);
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
"noLagrangian",
|
"noLagrangian",
|
||||||
"Skip reconstructing lagrangian positions and fields"
|
"Skip reconstructing lagrangian positions and fields"
|
||||||
);
|
);
|
||||||
|
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
"noSets",
|
"noSets",
|
||||||
@ -131,48 +133,40 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|
||||||
wordHashSet selectedFields;
|
|
||||||
args.readIfPresent("fields", selectedFields);
|
|
||||||
|
|
||||||
const bool noFields = args.found("noFields");
|
wordRes selectedFields;
|
||||||
|
args.readListIfPresent<wordRe>("fields", selectedFields);
|
||||||
|
|
||||||
if (noFields)
|
const bool doFields = !args.found("noFields");
|
||||||
|
|
||||||
|
if (!doFields)
|
||||||
{
|
{
|
||||||
Info<< "Skipping reconstructing fields"
|
Info<< "Skipping reconstructing fields"
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool noLagrangian = args.found("noLagrangian");
|
wordRes selectedLagrangianFields;
|
||||||
|
args.readListIfPresent<wordRe>
|
||||||
|
(
|
||||||
|
"lagrangianFields", selectedLagrangianFields
|
||||||
|
);
|
||||||
|
|
||||||
if (noLagrangian)
|
const bool doLagrangian = !args.found("noLagrangian");
|
||||||
|
|
||||||
|
if (!doLagrangian)
|
||||||
{
|
{
|
||||||
Info<< "Skipping reconstructing lagrangian positions and fields"
|
Info<< "Skipping reconstructing lagrangian positions and fields"
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool doReconstructSets = !args.found("noSets");
|
||||||
|
|
||||||
const bool noReconstructSets = args.found("noSets");
|
if (!doReconstructSets)
|
||||||
|
|
||||||
if (noReconstructSets)
|
|
||||||
{
|
{
|
||||||
Info<< "Skipping reconstructing cellSets, faceSets and pointSets"
|
Info<< "Skipping reconstructing cellSets, faceSets and pointSets"
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wordHashSet selectedLagrangianFields;
|
|
||||||
if (args.readIfPresent("lagrangianFields", selectedLagrangianFields))
|
|
||||||
{
|
|
||||||
if (noLagrangian)
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Cannot specify noLagrangian and lagrangianFields "
|
|
||||||
<< "options together."
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const bool newTimes = args.found("newTimes");
|
const bool newTimes = args.found("newTimes");
|
||||||
const bool allRegions = args.found("allRegions");
|
const bool allRegions = args.found("allRegions");
|
||||||
|
|
||||||
@ -367,12 +361,12 @@ int main(int argc, char *argv[])
|
|||||||
databases[0].timeName()
|
databases[0].timeName()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!noFields)
|
if (doFields)
|
||||||
{
|
{
|
||||||
// If there are any FV fields, reconstruct them
|
// If there are any FV fields, reconstruct them
|
||||||
Info<< "Reconstructing FV fields" << nl << endl;
|
Info<< "Reconstructing FV fields" << nl << endl;
|
||||||
|
|
||||||
fvFieldReconstructor fvReconstructor
|
fvFieldReconstructor reconstructor
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
procMeshes.meshes(),
|
procMeshes.meshes(),
|
||||||
@ -381,92 +375,91 @@ int main(int argc, char *argv[])
|
|||||||
procMeshes.boundaryProcAddressing()
|
procMeshes.boundaryProcAddressing()
|
||||||
);
|
);
|
||||||
|
|
||||||
fvReconstructor.reconstructFvVolumeInternalFields<scalar>
|
reconstructor.reconstructFvVolumeInternalFields<scalar>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
fvReconstructor.reconstructFvVolumeInternalFields<vector>
|
reconstructor.reconstructFvVolumeInternalFields<vector>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
fvReconstructor.reconstructFvVolumeInternalFields
|
reconstructor.reconstructFvVolumeInternalFields<sphericalTensor>
|
||||||
<sphericalTensor>
|
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
fvReconstructor.reconstructFvVolumeInternalFields<symmTensor>
|
reconstructor.reconstructFvVolumeInternalFields<symmTensor>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
fvReconstructor.reconstructFvVolumeInternalFields<tensor>
|
reconstructor.reconstructFvVolumeInternalFields<tensor>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
|
|
||||||
fvReconstructor.reconstructFvVolumeFields<scalar>
|
reconstructor.reconstructFvVolumeFields<scalar>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
fvReconstructor.reconstructFvVolumeFields<vector>
|
reconstructor.reconstructFvVolumeFields<vector>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
fvReconstructor.reconstructFvVolumeFields<sphericalTensor>
|
reconstructor.reconstructFvVolumeFields<sphericalTensor>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
fvReconstructor.reconstructFvVolumeFields<symmTensor>
|
reconstructor.reconstructFvVolumeFields<symmTensor>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
fvReconstructor.reconstructFvVolumeFields<tensor>
|
reconstructor.reconstructFvVolumeFields<tensor>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
|
|
||||||
fvReconstructor.reconstructFvSurfaceFields<scalar>
|
reconstructor.reconstructFvSurfaceFields<scalar>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
fvReconstructor.reconstructFvSurfaceFields<vector>
|
reconstructor.reconstructFvSurfaceFields<vector>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
fvReconstructor.reconstructFvSurfaceFields<sphericalTensor>
|
reconstructor.reconstructFvSurfaceFields<sphericalTensor>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
fvReconstructor.reconstructFvSurfaceFields<symmTensor>
|
reconstructor.reconstructFvSurfaceFields<symmTensor>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
fvReconstructor.reconstructFvSurfaceFields<tensor>
|
reconstructor.reconstructFvSurfaceFields<tensor>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
|
|
||||||
if (fvReconstructor.nReconstructed() == 0)
|
if (reconstructor.nReconstructed() == 0)
|
||||||
{
|
{
|
||||||
Info<< "No FV fields" << nl << endl;
|
Info<< "No FV fields" << nl << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!noFields)
|
if (doFields)
|
||||||
{
|
{
|
||||||
Info<< "Reconstructing point fields" << nl << endl;
|
Info<< "Reconstructing point fields" << nl << endl;
|
||||||
|
|
||||||
@ -482,7 +475,7 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pointFieldReconstructor pointReconstructor
|
pointFieldReconstructor reconstructor
|
||||||
(
|
(
|
||||||
pMesh,
|
pMesh,
|
||||||
pMeshes,
|
pMeshes,
|
||||||
@ -490,33 +483,33 @@ int main(int argc, char *argv[])
|
|||||||
procMeshes.boundaryProcAddressing()
|
procMeshes.boundaryProcAddressing()
|
||||||
);
|
);
|
||||||
|
|
||||||
pointReconstructor.reconstructFields<scalar>
|
reconstructor.reconstructFields<scalar>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
pointReconstructor.reconstructFields<vector>
|
reconstructor.reconstructFields<vector>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
pointReconstructor.reconstructFields<sphericalTensor>
|
reconstructor.reconstructFields<sphericalTensor>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
pointReconstructor.reconstructFields<symmTensor>
|
reconstructor.reconstructFields<symmTensor>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
pointReconstructor.reconstructFields<tensor>
|
reconstructor.reconstructFields<tensor>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
);
|
);
|
||||||
|
|
||||||
if (pointReconstructor.nReconstructed() == 0)
|
if (reconstructor.nReconstructed() == 0)
|
||||||
{
|
{
|
||||||
Info<< "No point fields" << nl << endl;
|
Info<< "No point fields" << nl << endl;
|
||||||
}
|
}
|
||||||
@ -530,7 +523,7 @@ int main(int argc, char *argv[])
|
|||||||
// the first processor that has them. They are in pass2 only used
|
// the first processor that has them. They are in pass2 only used
|
||||||
// for name and type (scalar, vector etc).
|
// for name and type (scalar, vector etc).
|
||||||
|
|
||||||
if (!noLagrangian)
|
if (doLagrangian)
|
||||||
{
|
{
|
||||||
HashTable<IOobjectList> allCloudObjects;
|
HashTable<IOobjectList> allCloudObjects;
|
||||||
|
|
||||||
@ -585,6 +578,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (allCloudObjects.size())
|
if (allCloudObjects.size())
|
||||||
{
|
{
|
||||||
|
lagrangianReconstructor reconstructor
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
procMeshes.meshes(),
|
||||||
|
procMeshes.faceProcAddressing(),
|
||||||
|
procMeshes.cellProcAddressing()
|
||||||
|
);
|
||||||
|
|
||||||
// Pass2: reconstruct the cloud
|
// Pass2: reconstruct the cloud
|
||||||
forAllConstIters(allCloudObjects, iter)
|
forAllConstIters(allCloudObjects, iter)
|
||||||
{
|
{
|
||||||
@ -596,107 +597,82 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Reconstructing lagrangian fields for cloud "
|
Info<< "Reconstructing lagrangian fields for cloud "
|
||||||
<< cloudName << nl << endl;
|
<< cloudName << nl << endl;
|
||||||
|
|
||||||
reconstructLagrangianPositions
|
reconstructor.reconstructPositions(cloudName);
|
||||||
(
|
|
||||||
mesh,
|
reconstructor.reconstructFields<label>
|
||||||
cloudName,
|
|
||||||
procMeshes.meshes(),
|
|
||||||
procMeshes.faceProcAddressing(),
|
|
||||||
procMeshes.cellProcAddressing()
|
|
||||||
);
|
|
||||||
reconstructLagrangianFields<label>
|
|
||||||
(
|
(
|
||||||
cloudName,
|
cloudName,
|
||||||
mesh,
|
|
||||||
procMeshes.meshes(),
|
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
reconstructLagrangianFieldFields<label>
|
reconstructor.reconstructFieldFields<label>
|
||||||
(
|
(
|
||||||
cloudName,
|
cloudName,
|
||||||
mesh,
|
|
||||||
procMeshes.meshes(),
|
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
reconstructLagrangianFields<scalar>
|
|
||||||
|
reconstructor.reconstructFields<scalar>
|
||||||
(
|
(
|
||||||
cloudName,
|
cloudName,
|
||||||
mesh,
|
|
||||||
procMeshes.meshes(),
|
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
reconstructLagrangianFieldFields<scalar>
|
reconstructor.reconstructFieldFields<scalar>
|
||||||
(
|
(
|
||||||
cloudName,
|
cloudName,
|
||||||
mesh,
|
|
||||||
procMeshes.meshes(),
|
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
reconstructLagrangianFields<vector>
|
|
||||||
|
reconstructor.reconstructFields<vector>
|
||||||
(
|
(
|
||||||
cloudName,
|
cloudName,
|
||||||
mesh,
|
|
||||||
procMeshes.meshes(),
|
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
reconstructLagrangianFieldFields<vector>
|
reconstructor.reconstructFieldFields<vector>
|
||||||
(
|
(
|
||||||
cloudName,
|
cloudName,
|
||||||
mesh,
|
|
||||||
procMeshes.meshes(),
|
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
reconstructLagrangianFields<sphericalTensor>
|
|
||||||
|
reconstructor.reconstructFields<sphericalTensor>
|
||||||
(
|
(
|
||||||
cloudName,
|
cloudName,
|
||||||
mesh,
|
|
||||||
procMeshes.meshes(),
|
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
reconstructLagrangianFieldFields<sphericalTensor>
|
reconstructor.reconstructFieldFields<sphericalTensor>
|
||||||
(
|
(
|
||||||
cloudName,
|
cloudName,
|
||||||
mesh,
|
|
||||||
procMeshes.meshes(),
|
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
reconstructLagrangianFields<symmTensor>
|
|
||||||
|
reconstructor.reconstructFields<symmTensor>
|
||||||
(
|
(
|
||||||
cloudName,
|
cloudName,
|
||||||
mesh,
|
|
||||||
procMeshes.meshes(),
|
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
reconstructLagrangianFieldFields<symmTensor>
|
reconstructor.reconstructFieldFields<symmTensor>
|
||||||
(
|
(
|
||||||
cloudName,
|
cloudName,
|
||||||
mesh,
|
|
||||||
procMeshes.meshes(),
|
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
reconstructLagrangianFields<tensor>
|
|
||||||
|
reconstructor.reconstructFields<tensor>
|
||||||
(
|
(
|
||||||
cloudName,
|
cloudName,
|
||||||
mesh,
|
|
||||||
procMeshes.meshes(),
|
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
reconstructLagrangianFieldFields<tensor>
|
reconstructor.reconstructFieldFields<tensor>
|
||||||
(
|
(
|
||||||
cloudName,
|
cloudName,
|
||||||
mesh,
|
|
||||||
procMeshes.meshes(),
|
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
@ -727,7 +703,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
processorFaMeshes procFaMeshes(procMeshes.meshes());
|
processorFaMeshes procFaMeshes(procMeshes.meshes());
|
||||||
|
|
||||||
faFieldReconstructor faReconstructor
|
faFieldReconstructor reconstructor
|
||||||
(
|
(
|
||||||
aMesh,
|
aMesh,
|
||||||
procFaMeshes.meshes(),
|
procFaMeshes.meshes(),
|
||||||
@ -736,21 +712,20 @@ int main(int argc, char *argv[])
|
|||||||
procFaMeshes.boundaryProcAddressing()
|
procFaMeshes.boundaryProcAddressing()
|
||||||
);
|
);
|
||||||
|
|
||||||
faReconstructor.reconstructFaAreaFields<scalar>(objects);
|
reconstructor.reconstructFaAreaFields<scalar>(objects);
|
||||||
faReconstructor.reconstructFaAreaFields<vector>(objects);
|
reconstructor.reconstructFaAreaFields<vector>(objects);
|
||||||
faReconstructor
|
reconstructor.reconstructFaAreaFields<sphericalTensor>(objects);
|
||||||
.reconstructFaAreaFields<sphericalTensor>(objects);
|
reconstructor.reconstructFaAreaFields<symmTensor>(objects);
|
||||||
faReconstructor.reconstructFaAreaFields<symmTensor>(objects);
|
reconstructor.reconstructFaAreaFields<tensor>(objects);
|
||||||
faReconstructor.reconstructFaAreaFields<tensor>(objects);
|
|
||||||
|
|
||||||
faReconstructor.reconstructFaEdgeFields<scalar>(objects);
|
reconstructor.reconstructFaEdgeFields<scalar>(objects);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info << "No FA fields" << nl << endl;
|
Info << "No FA fields" << nl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!noReconstructSets)
|
if (doReconstructSets)
|
||||||
{
|
{
|
||||||
// Scan to find all sets
|
// Scan to find all sets
|
||||||
HashTable<label> cSetNames;
|
HashTable<label> cSetNames;
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -32,7 +32,7 @@ Description
|
|||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
parFvFieldReconstructor.C
|
parFvFieldReconstructor.C
|
||||||
parFvFieldReconstructorReconstructFields.C
|
parFvFieldReconstructorFields.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -47,6 +47,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Forward declarations
|
||||||
class mapDistributePolyMesh;
|
class mapDistributePolyMesh;
|
||||||
class mapDistributeBase;
|
class mapDistributeBase;
|
||||||
class IOobjectList;
|
class IOobjectList;
|
||||||
@ -149,26 +150,26 @@ public:
|
|||||||
|
|
||||||
//- Read, reconstruct and write all/selected volume internal fields
|
//- Read, reconstruct and write all/selected volume internal fields
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void reconstructFvVolumeInternalFields
|
label reconstructFvVolumeInternalFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields = wordRes()
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Read, reconstruct and write all/selected volume fields
|
//- Read, reconstruct and write all/selected volume fields
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void reconstructFvVolumeFields
|
label reconstructFvVolumeFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields = wordRes()
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Read, reconstruct and write all/selected surface fields
|
//- Read, reconstruct and write all/selected surface fields
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void reconstructFvSurfaceFields
|
label reconstructFvSurfaceFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields = wordRes()
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Helper: reconstruct and write mesh points
|
//- Helper: reconstruct and write mesh points
|
||||||
@ -184,7 +185,7 @@ public:
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#ifdef NoRepository
|
#ifdef NoRepository
|
||||||
# include "parFvFieldReconstructorReconstructFields.C"
|
# include "parFvFieldReconstructorFields.C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -408,33 +408,34 @@ Foam::parFvFieldReconstructor::reconstructFvSurfaceField
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::parFvFieldReconstructor::reconstructFvVolumeInternalFields
|
Foam::label Foam::parFvFieldReconstructor::reconstructFvVolumeInternalFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
typedef DimensionedField<Type, volMesh> FieldType;
|
typedef DimensionedField<Type, volMesh> fieldType;
|
||||||
const word& clsName = FieldType::typeName;
|
|
||||||
|
|
||||||
// Available fields, sorted order
|
// Available fields, sorted order
|
||||||
const wordList fieldNames =
|
const wordList fieldNames =
|
||||||
(
|
(
|
||||||
selectedFields.empty()
|
selectedFields.empty()
|
||||||
? objects.sortedNames(clsName)
|
? objects.sortedNames<fieldType>()
|
||||||
: objects.sortedNames(clsName, selectedFields)
|
: objects.sortedNames<fieldType>(selectedFields)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (fieldNames.size())
|
label nFields = 0;
|
||||||
{
|
|
||||||
Info<< " Reconstructing " << clsName << "s\n" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const word& fieldName : fieldNames)
|
for (const word& fieldName : fieldNames)
|
||||||
{
|
{
|
||||||
Info<< " " << fieldName << endl;
|
if (!nFields++)
|
||||||
|
{
|
||||||
|
Info<< " Reconstructing "
|
||||||
|
<< fieldType::typeName << "s\n" << nl;
|
||||||
|
}
|
||||||
|
|
||||||
tmp<FieldType> tfld
|
Info<< " " << fieldName << nl;
|
||||||
|
|
||||||
|
tmp<fieldType> tfld
|
||||||
(
|
(
|
||||||
reconstructFvVolumeInternalField<Type>(*(objects[fieldName]))
|
reconstructFvVolumeInternalField<Type>(*(objects[fieldName]))
|
||||||
);
|
);
|
||||||
@ -444,42 +445,43 @@ void Foam::parFvFieldReconstructor::reconstructFvVolumeInternalFields
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldNames.size()) Info<< endl;
|
if (nFields) Info<< endl;
|
||||||
|
return nFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::parFvFieldReconstructor::reconstructFvVolumeFields
|
Foam::label Foam::parFvFieldReconstructor::reconstructFvVolumeFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
typedef GeometricField<Type, fvPatchField, volMesh> FieldType;
|
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
||||||
const word& clsName = FieldType::typeName;
|
|
||||||
|
|
||||||
// Available fields, sorted order
|
// Available fields, sorted order
|
||||||
const wordList fieldNames =
|
const wordList fieldNames =
|
||||||
(
|
(
|
||||||
selectedFields.empty()
|
selectedFields.empty()
|
||||||
? objects.sortedNames(clsName)
|
? objects.sortedNames<fieldType>()
|
||||||
: objects.sortedNames(clsName, selectedFields)
|
: objects.sortedNames<fieldType>(selectedFields)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (fieldNames.size())
|
label nFields = 0;
|
||||||
{
|
|
||||||
Info<< " Reconstructing " << clsName << "s\n" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const word& fieldName : fieldNames)
|
for (const word& fieldName : fieldNames)
|
||||||
{
|
{
|
||||||
if ("cellDist" == fieldName)
|
if ("cellDist" == fieldName)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Info<< " " << fieldName << endl;
|
if (!nFields++)
|
||||||
|
{
|
||||||
|
Info<< " Reconstructing "
|
||||||
|
<< fieldType::typeName << "s\n" << nl;
|
||||||
|
}
|
||||||
|
Info<< " " << fieldName << nl;
|
||||||
|
|
||||||
tmp<FieldType> tfld
|
tmp<fieldType> tfld
|
||||||
(
|
(
|
||||||
reconstructFvVolumeField<Type>(*(objects[fieldName]))
|
reconstructFvVolumeField<Type>(*(objects[fieldName]))
|
||||||
);
|
);
|
||||||
@ -489,38 +491,39 @@ void Foam::parFvFieldReconstructor::reconstructFvVolumeFields
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldNames.size()) Info<< endl;
|
if (nFields) Info<< endl;
|
||||||
|
return nFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::parFvFieldReconstructor::reconstructFvSurfaceFields
|
Foam::label Foam::parFvFieldReconstructor::reconstructFvSurfaceFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
typedef GeometricField<Type, fvsPatchField, surfaceMesh> FieldType;
|
typedef GeometricField<Type, fvsPatchField, surfaceMesh> fieldType;
|
||||||
const word& clsName = FieldType::typeName;
|
|
||||||
|
|
||||||
// Available fields, sorted order
|
// Available fields, sorted order
|
||||||
const wordList fieldNames =
|
const wordList fieldNames =
|
||||||
(
|
(
|
||||||
selectedFields.empty()
|
selectedFields.empty()
|
||||||
? objects.sortedNames(clsName)
|
? objects.sortedNames<fieldType>()
|
||||||
: objects.sortedNames(clsName, selectedFields)
|
: objects.sortedNames<fieldType>(selectedFields)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (fieldNames.size())
|
label nFields = 0;
|
||||||
{
|
|
||||||
Info<< " Reconstructing " << clsName << "s\n" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const word& fieldName : fieldNames)
|
for (const word& fieldName : fieldNames)
|
||||||
{
|
{
|
||||||
Info<< " " << fieldName << endl;
|
if (!nFields++)
|
||||||
|
{
|
||||||
|
Info<< " Reconstructing "
|
||||||
|
<< fieldType::typeName << "s\n" << nl;
|
||||||
|
}
|
||||||
|
Info<< " " << fieldName << nl;
|
||||||
|
|
||||||
tmp<FieldType> tfld
|
tmp<fieldType> tfld
|
||||||
(
|
(
|
||||||
reconstructFvSurfaceField<Type>(*(objects[fieldName]))
|
reconstructFvSurfaceField<Type>(*(objects[fieldName]))
|
||||||
);
|
);
|
||||||
@ -530,7 +533,8 @@ void Foam::parFvFieldReconstructor::reconstructFvSurfaceFields
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldNames.size()) Info<< endl;
|
if (nFields) Info<< endl;
|
||||||
|
return nFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -31,7 +31,7 @@ Description
|
|||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
parLagrangianRedistributor.C
|
parLagrangianRedistributor.C
|
||||||
parLagrangianRedistributorRedistributeFields.C
|
parLagrangianRedistributorFields.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -46,6 +46,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Forward declarations
|
||||||
class mapDistributePolyMesh;
|
class mapDistributePolyMesh;
|
||||||
class mapDistributeBase;
|
class mapDistributeBase;
|
||||||
class IOobjectList;
|
class IOobjectList;
|
||||||
@ -126,41 +127,41 @@ public:
|
|||||||
static wordList filterObjects
|
static wordList filterObjects
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields = wordRes()
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Read, redistribute and write all/selected lagrangian fields
|
//- Read, redistribute and write all/selected lagrangian fields
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void redistributeLagrangianFields
|
label redistributeFields
|
||||||
(
|
(
|
||||||
const mapDistributeBase& map,
|
const mapDistributeBase& map,
|
||||||
const word& cloudName,
|
const word& cloudName,
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields = wordRes()
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Read, redistribute and write all/selected lagrangian fieldFields
|
//- Read, redistribute and write all/selected lagrangian fieldFields
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void redistributeLagrangianFieldFields
|
label redistributeFieldFields
|
||||||
(
|
(
|
||||||
const mapDistributeBase& map,
|
const mapDistributeBase& map,
|
||||||
const word& cloudName,
|
const word& cloudName,
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields = wordRes()
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Read and store all fields of a cloud
|
//- Read and store all fields of a cloud
|
||||||
template<class Container>
|
template<class Container>
|
||||||
static void readLagrangianFields
|
static label readFields
|
||||||
(
|
(
|
||||||
const passivePositionParticleCloud& cloud,
|
const passivePositionParticleCloud& cloud,
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields = wordRes()
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Redistribute and write stored lagrangian fields
|
//- Redistribute and write stored lagrangian fields
|
||||||
template<class Container>
|
template<class Container>
|
||||||
void redistributeStoredLagrangianFields
|
label redistributeStoredFields
|
||||||
(
|
(
|
||||||
const mapDistributeBase& map,
|
const mapDistributeBase& map,
|
||||||
passivePositionParticleCloud& cloud
|
passivePositionParticleCloud& cloud
|
||||||
@ -176,7 +177,7 @@ public:
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#ifdef NoRepository
|
#ifdef NoRepository
|
||||||
# include "parLagrangianRedistributorRedistributeFields.C"
|
# include "parLagrangianRedistributorFields.C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -37,21 +37,23 @@ template<class Container>
|
|||||||
Foam::wordList Foam::parLagrangianRedistributor::filterObjects
|
Foam::wordList Foam::parLagrangianRedistributor::filterObjects
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Parallel synchronise
|
|
||||||
wordList fieldNames =
|
wordList fieldNames =
|
||||||
(
|
(
|
||||||
selectedFields.empty()
|
selectedFields.empty()
|
||||||
? objects.names(Container::typeName)
|
? objects.names<Container>()
|
||||||
: objects.names(Container::typeName, selectedFields)
|
: objects.names<Container>(selectedFields)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Parallel synchronise
|
||||||
|
// - Combine names from all processors
|
||||||
|
|
||||||
Pstream::combineGather(fieldNames, ListOps::uniqueEqOp<word>());
|
Pstream::combineGather(fieldNames, ListOps::uniqueEqOp<word>());
|
||||||
Pstream::combineScatter(fieldNames);
|
Pstream::combineScatter(fieldNames);
|
||||||
|
|
||||||
// Ensure order is consistent
|
// Sort for consistent order on all processors
|
||||||
Foam::sort(fieldNames);
|
Foam::sort(fieldNames);
|
||||||
|
|
||||||
return fieldNames;
|
return fieldNames;
|
||||||
@ -59,17 +61,17 @@ Foam::wordList Foam::parLagrangianRedistributor::filterObjects
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::parLagrangianRedistributor::redistributeLagrangianFields
|
Foam::label Foam::parLagrangianRedistributor::redistributeFields
|
||||||
(
|
(
|
||||||
const mapDistributeBase& map,
|
const mapDistributeBase& map,
|
||||||
const word& cloudName,
|
const word& cloudName,
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const word fieldClassName(IOField<Type>::typeName);
|
typedef IOField<Type> fieldType;
|
||||||
|
|
||||||
const wordList objectNames
|
const wordList fieldNames
|
||||||
(
|
(
|
||||||
filterObjects<IOField<Type>>
|
filterObjects<IOField<Type>>
|
||||||
(
|
(
|
||||||
@ -78,14 +80,14 @@ void Foam::parLagrangianRedistributor::redistributeLagrangianFields
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (objectNames.size())
|
label nFields = 0;
|
||||||
{
|
for (const word& objectName : fieldNames)
|
||||||
Info<< " Redistributing lagrangian "
|
|
||||||
<< fieldClassName << "s\n" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const word& objectName : objectNames)
|
|
||||||
{
|
{
|
||||||
|
if (!nFields)
|
||||||
|
{
|
||||||
|
Info<< " Redistributing lagrangian "
|
||||||
|
<< fieldType::typeName << "s\n" << endl;
|
||||||
|
}
|
||||||
Info<< " " << objectName << endl;
|
Info<< " " << objectName << endl;
|
||||||
|
|
||||||
// Read if present
|
// Read if present
|
||||||
@ -126,24 +128,24 @@ void Foam::parLagrangianRedistributor::redistributeLagrangianFields
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (objectNames.size()) Info<< endl;
|
return nFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::parLagrangianRedistributor::redistributeLagrangianFieldFields
|
Foam::label Foam::parLagrangianRedistributor::redistributeFieldFields
|
||||||
(
|
(
|
||||||
const mapDistributeBase& map,
|
const mapDistributeBase& map,
|
||||||
const word& cloudName,
|
const word& cloudName,
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const word fieldClassName(CompactIOField<Field<Type>, Type>::typeName);
|
typedef CompactIOField<Field<Type>, Type> fieldType;
|
||||||
|
|
||||||
wordList objectNames
|
wordList fieldNames
|
||||||
(
|
(
|
||||||
filterObjects<CompactIOField<Field<Type>, Type>>
|
filterObjects<fieldType>
|
||||||
(
|
(
|
||||||
objects,
|
objects,
|
||||||
selectedFields
|
selectedFields
|
||||||
@ -160,19 +162,18 @@ void Foam::parLagrangianRedistributor::redistributeLagrangianFieldFields
|
|||||||
selectedFields
|
selectedFields
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
objectNames.append(ioFieldNames);
|
fieldNames.append(ioFieldNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
label nFields = 0;
|
||||||
if (objectNames.size())
|
for (const word& objectName : fieldNames)
|
||||||
{
|
{
|
||||||
Info<< " Redistributing lagrangian "
|
if (!nFields++)
|
||||||
<< fieldClassName << "s\n" << endl;
|
{
|
||||||
}
|
Info<< " Redistributing lagrangian "
|
||||||
|
<< fieldType::typeName << "s\n" << nl;
|
||||||
for (const word& objectName : objectNames)
|
}
|
||||||
{
|
Info<< " " << objectName << nl;
|
||||||
Info<< " " << objectName << endl;
|
|
||||||
|
|
||||||
// Read if present
|
// Read if present
|
||||||
CompactIOField<Field<Type>, Type> field
|
CompactIOField<Field<Type>, Type> field
|
||||||
@ -212,20 +213,23 @@ void Foam::parLagrangianRedistributor::redistributeLagrangianFieldFields
|
|||||||
).write();
|
).write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nFields) Info<< endl;
|
||||||
|
return nFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Container>
|
template<class Container>
|
||||||
void Foam::parLagrangianRedistributor::readLagrangianFields
|
Foam::label Foam::parLagrangianRedistributor::readFields
|
||||||
(
|
(
|
||||||
const passivePositionParticleCloud& cloud,
|
const passivePositionParticleCloud& cloud,
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word fieldClassName(Container::typeName);
|
const word fieldClassName(Container::typeName);
|
||||||
|
|
||||||
const wordList objectNames
|
const wordList fieldNames
|
||||||
(
|
(
|
||||||
filterObjects<Container>
|
filterObjects<Container>
|
||||||
(
|
(
|
||||||
@ -234,15 +238,15 @@ void Foam::parLagrangianRedistributor::readLagrangianFields
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (objectNames.size())
|
label nFields = 0;
|
||||||
|
for (const word& objectName : fieldNames)
|
||||||
{
|
{
|
||||||
Info<< " Reading lagrangian "
|
if (!nFields++)
|
||||||
<< fieldClassName << "s\n" << endl;
|
{
|
||||||
}
|
Info<< " Reading lagrangian "
|
||||||
|
<< Container::typeName << "s\n" << nl;
|
||||||
for (const word& objectName : objectNames)
|
}
|
||||||
{
|
Info<< " " << objectName << nl;
|
||||||
Info<< " " << objectName << endl;
|
|
||||||
|
|
||||||
// Read if present
|
// Read if present
|
||||||
Container* fieldPtr = new Container
|
Container* fieldPtr = new Container
|
||||||
@ -260,33 +264,33 @@ void Foam::parLagrangianRedistributor::readLagrangianFields
|
|||||||
|
|
||||||
fieldPtr->store();
|
fieldPtr->store();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return nFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Container>
|
template<class Container>
|
||||||
void Foam::parLagrangianRedistributor::redistributeStoredLagrangianFields
|
Foam::label Foam::parLagrangianRedistributor::redistributeStoredFields
|
||||||
(
|
(
|
||||||
const mapDistributeBase& map,
|
const mapDistributeBase& map,
|
||||||
passivePositionParticleCloud& cloud
|
passivePositionParticleCloud& cloud
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const word fieldClassName(Container::typeName);
|
|
||||||
|
|
||||||
HashTable<Container*> fields
|
HashTable<Container*> fields
|
||||||
(
|
(
|
||||||
cloud.lookupClass<Container>()
|
cloud.lookupClass<Container>()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (fields.size())
|
label nFields = 0;
|
||||||
{
|
|
||||||
Info<< " Redistributing lagrangian "
|
|
||||||
<< fieldClassName << "s\n" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
forAllIters(fields, iter)
|
forAllIters(fields, iter)
|
||||||
{
|
{
|
||||||
Container& field = *(*iter);
|
Container& field = *(iter.object());
|
||||||
|
|
||||||
|
if (!nFields++)
|
||||||
|
{
|
||||||
|
Info<< " Redistributing lagrangian "
|
||||||
|
<< Container::typeName << "s\n" << endl;
|
||||||
|
}
|
||||||
Info<< " " << field.name() << endl;
|
Info<< " " << field.name() << endl;
|
||||||
|
|
||||||
map.distribute(field);
|
map.distribute(field);
|
||||||
@ -309,6 +313,8 @@ void Foam::parLagrangianRedistributor::redistributeStoredLagrangianFields
|
|||||||
).write();
|
).write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return nFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1687,7 +1687,7 @@ void reconstructMeshFields
|
|||||||
(
|
(
|
||||||
const parFvFieldReconstructor& fvReconstructor,
|
const parFvFieldReconstructor& fvReconstructor,
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Dimensioned fields
|
// Dimensioned fields
|
||||||
@ -1784,7 +1784,7 @@ void reconstructLagrangian
|
|||||||
const fvMesh& baseMesh,
|
const fvMesh& baseMesh,
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const mapDistributePolyMesh& distMap,
|
const mapDistributePolyMesh& distMap,
|
||||||
const wordHashSet& selectedLagrangianFields
|
const wordRes& selectedLagrangianFields
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Clouds (note: might not be present on all processors)
|
// Clouds (note: might not be present on all processors)
|
||||||
@ -1832,49 +1832,49 @@ void reconstructLagrangian
|
|||||||
cloud::prefix/cloudName
|
cloud::prefix/cloudName
|
||||||
);
|
);
|
||||||
|
|
||||||
lagrangianReconstructor.redistributeLagrangianFields<label>
|
lagrangianReconstructor.redistributeFields<label>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
cloudName,
|
cloudName,
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
lagrangianReconstructor.redistributeLagrangianFieldFields<label>
|
lagrangianReconstructor.redistributeFieldFields<label>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
cloudName,
|
cloudName,
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
lagrangianReconstructor.redistributeLagrangianFields<scalar>
|
lagrangianReconstructor.redistributeFields<scalar>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
cloudName,
|
cloudName,
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
lagrangianReconstructor.redistributeLagrangianFieldFields<scalar>
|
lagrangianReconstructor.redistributeFieldFields<scalar>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
cloudName,
|
cloudName,
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
lagrangianReconstructor.redistributeLagrangianFields<vector>
|
lagrangianReconstructor.redistributeFields<vector>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
cloudName,
|
cloudName,
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
lagrangianReconstructor.redistributeLagrangianFieldFields<vector>
|
lagrangianReconstructor.redistributeFieldFields<vector>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
cloudName,
|
cloudName,
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
lagrangianReconstructor.redistributeLagrangianFields
|
lagrangianReconstructor.redistributeFields
|
||||||
<sphericalTensor>
|
<sphericalTensor>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
@ -1882,7 +1882,7 @@ void reconstructLagrangian
|
|||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
lagrangianReconstructor.redistributeLagrangianFieldFields
|
lagrangianReconstructor.redistributeFieldFields
|
||||||
<sphericalTensor>
|
<sphericalTensor>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
@ -1890,14 +1890,14 @@ void reconstructLagrangian
|
|||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
lagrangianReconstructor.redistributeLagrangianFields<symmTensor>
|
lagrangianReconstructor.redistributeFields<symmTensor>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
cloudName,
|
cloudName,
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
lagrangianReconstructor.redistributeLagrangianFieldFields
|
lagrangianReconstructor.redistributeFieldFields
|
||||||
<symmTensor>
|
<symmTensor>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
@ -1905,14 +1905,14 @@ void reconstructLagrangian
|
|||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
lagrangianReconstructor.redistributeLagrangianFields<tensor>
|
lagrangianReconstructor.redistributeFields<tensor>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
cloudName,
|
cloudName,
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
lagrangianReconstructor.redistributeLagrangianFieldFields<tensor>
|
lagrangianReconstructor.redistributeFieldFields<tensor>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
cloudName,
|
cloudName,
|
||||||
@ -1929,7 +1929,7 @@ void readLagrangian
|
|||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const wordList& cloudNames,
|
const wordList& cloudNames,
|
||||||
const wordHashSet& selectedLagrangianFields,
|
const wordRes& selectedLagrangianFields,
|
||||||
PtrList<unmappedPassivePositionParticleCloud>& clouds
|
PtrList<unmappedPassivePositionParticleCloud>& clouds
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -1963,21 +1963,21 @@ void readLagrangian
|
|||||||
|
|
||||||
//Pout<< "Found clould objects:" << cloudObjs.names() << endl;
|
//Pout<< "Found clould objects:" << cloudObjs.names() << endl;
|
||||||
|
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<IOField<label>>
|
<IOField<label>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<IOField<Field<label>>>
|
<IOField<Field<label>>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<CompactIOField<Field<label>, label>>
|
<CompactIOField<Field<label>, label>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
@ -1986,21 +1986,21 @@ void readLagrangian
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<IOField<scalar>>
|
<IOField<scalar>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<IOField<Field<scalar>>>
|
<IOField<Field<scalar>>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<CompactIOField<Field<scalar>, scalar>>
|
<CompactIOField<Field<scalar>, scalar>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
@ -2009,21 +2009,21 @@ void readLagrangian
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<IOField<vector>>
|
<IOField<vector>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<IOField<Field<vector>>>
|
<IOField<Field<vector>>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<CompactIOField<Field<vector>, vector>>
|
<CompactIOField<Field<vector>, vector>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
@ -2032,21 +2032,21 @@ void readLagrangian
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<IOField<sphericalTensor>>
|
<IOField<sphericalTensor>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<IOField<Field<sphericalTensor>>>
|
<IOField<Field<sphericalTensor>>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<CompactIOField<Field<sphericalTensor>, sphericalTensor>>
|
<CompactIOField<Field<sphericalTensor>, sphericalTensor>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
@ -2055,21 +2055,21 @@ void readLagrangian
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<IOField<symmTensor>>
|
<IOField<symmTensor>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<IOField<Field<symmTensor>>>
|
<IOField<Field<symmTensor>>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<CompactIOField<Field<symmTensor>, symmTensor>>
|
<CompactIOField<Field<symmTensor>, symmTensor>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
@ -2078,21 +2078,21 @@ void readLagrangian
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<IOField<tensor>>
|
<IOField<tensor>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<IOField<Field<tensor>>>
|
<IOField<Field<tensor>>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
cloudObjs,
|
cloudObjs,
|
||||||
selectedLagrangianFields
|
selectedLagrangianFields
|
||||||
);
|
);
|
||||||
parLagrangianRedistributor::readLagrangianFields
|
parLagrangianRedistributor::readFields
|
||||||
<CompactIOField<Field<tensor>, tensor>>
|
<CompactIOField<Field<tensor>, tensor>>
|
||||||
(
|
(
|
||||||
clouds[i],
|
clouds[i],
|
||||||
@ -2136,19 +2136,19 @@ void redistributeLagrangian
|
|||||||
distributor.redistributeLagrangianPositions(clouds[i]);
|
distributor.redistributeLagrangianPositions(clouds[i]);
|
||||||
const mapDistributeBase& lagrangianMap = *lagrangianMapPtr;
|
const mapDistributeBase& lagrangianMap = *lagrangianMapPtr;
|
||||||
|
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<IOField<label>>
|
<IOField<label>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
clouds[i]
|
clouds[i]
|
||||||
);
|
);
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<IOField<Field<label>>>
|
<IOField<Field<label>>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
clouds[i]
|
clouds[i]
|
||||||
);
|
);
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<CompactIOField<Field<label>, label>>
|
<CompactIOField<Field<label>, label>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
@ -2156,19 +2156,19 @@ void redistributeLagrangian
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<IOField<scalar>>
|
<IOField<scalar>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
clouds[i]
|
clouds[i]
|
||||||
);
|
);
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<IOField<Field<scalar>>>
|
<IOField<Field<scalar>>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
clouds[i]
|
clouds[i]
|
||||||
);
|
);
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<CompactIOField<Field<scalar>, scalar>>
|
<CompactIOField<Field<scalar>, scalar>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
@ -2176,19 +2176,19 @@ void redistributeLagrangian
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<IOField<vector>>
|
<IOField<vector>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
clouds[i]
|
clouds[i]
|
||||||
);
|
);
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<IOField<Field<vector>>>
|
<IOField<Field<vector>>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
clouds[i]
|
clouds[i]
|
||||||
);
|
);
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<CompactIOField<Field<vector>, vector>>
|
<CompactIOField<Field<vector>, vector>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
@ -2196,19 +2196,19 @@ void redistributeLagrangian
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<IOField<sphericalTensor>>
|
<IOField<sphericalTensor>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
clouds[i]
|
clouds[i]
|
||||||
);
|
);
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<IOField<Field<sphericalTensor>>>
|
<IOField<Field<sphericalTensor>>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
clouds[i]
|
clouds[i]
|
||||||
);
|
);
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<CompactIOField<Field<sphericalTensor>, sphericalTensor>>
|
<CompactIOField<Field<sphericalTensor>, sphericalTensor>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
@ -2216,19 +2216,19 @@ void redistributeLagrangian
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<IOField<symmTensor>>
|
<IOField<symmTensor>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
clouds[i]
|
clouds[i]
|
||||||
);
|
);
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<IOField<Field<symmTensor>>>
|
<IOField<Field<symmTensor>>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
clouds[i]
|
clouds[i]
|
||||||
);
|
);
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<CompactIOField<Field<symmTensor>, symmTensor>>
|
<CompactIOField<Field<symmTensor>, symmTensor>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
@ -2236,19 +2236,19 @@ void redistributeLagrangian
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<IOField<tensor>>
|
<IOField<tensor>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
clouds[i]
|
clouds[i]
|
||||||
);
|
);
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<IOField<Field<tensor>>>
|
<IOField<Field<tensor>>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
clouds[i]
|
clouds[i]
|
||||||
);
|
);
|
||||||
distributor.redistributeStoredLagrangianFields
|
distributor.redistributeStoredFields
|
||||||
<CompactIOField<Field<tensor>, tensor>>
|
<CompactIOField<Field<tensor>, tensor>>
|
||||||
(
|
(
|
||||||
lagrangianMap,
|
lagrangianMap,
|
||||||
@ -2323,8 +2323,8 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const wordHashSet selectedFields(0);
|
const wordRes selectedFields;
|
||||||
const wordHashSet selectedLagrangianFields(0);
|
const wordRes selectedLagrangianFields;
|
||||||
|
|
||||||
|
|
||||||
if (decompose)
|
if (decompose)
|
||||||
|
|||||||
@ -40,7 +40,7 @@ template<template<class> class CombineOp>
|
|||||||
void MapMesh
|
void MapMesh
|
||||||
(
|
(
|
||||||
const meshToMesh& interp,
|
const meshToMesh& interp,
|
||||||
const wordHashSet& selectedFields,
|
const wordRes& selectedFields,
|
||||||
const bool noLagrangian
|
const bool noLagrangian
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -121,7 +121,7 @@ template<class Type, class CombineOp>
|
|||||||
void MapVolFields
|
void MapVolFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields,
|
const wordRes& selectedFields,
|
||||||
const meshToMesh& interp,
|
const meshToMesh& interp,
|
||||||
const CombineOp& cop
|
const CombineOp& cop
|
||||||
)
|
)
|
||||||
@ -135,8 +135,8 @@ void MapVolFields
|
|||||||
const wordList fieldNames =
|
const wordList fieldNames =
|
||||||
(
|
(
|
||||||
selectedFields.empty()
|
selectedFields.empty()
|
||||||
? objects.sortedNames(fieldType::typeName)
|
? objects.sortedNames<fieldType>()
|
||||||
: objects.sortedNames(fieldType::typeName, selectedFields)
|
: objects.sortedNames<fieldType>(selectedFields)
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const word& fieldName : fieldNames)
|
for (const word& fieldName : fieldNames)
|
||||||
|
|||||||
@ -48,7 +48,7 @@ void mapConsistentMesh
|
|||||||
const word& AMIMapMethod,
|
const word& AMIMapMethod,
|
||||||
const word& procMapMethod,
|
const word& procMapMethod,
|
||||||
const bool subtract,
|
const bool subtract,
|
||||||
const wordHashSet& selectedFields,
|
const wordRes& selectedFields,
|
||||||
const bool noLagrangian
|
const bool noLagrangian
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -95,7 +95,7 @@ void mapSubMesh
|
|||||||
const word& AMIMapMethod,
|
const word& AMIMapMethod,
|
||||||
const word& procMapMethod,
|
const word& procMapMethod,
|
||||||
const bool subtract,
|
const bool subtract,
|
||||||
const wordHashSet& selectedFields,
|
const wordRes& selectedFields,
|
||||||
const bool noLagrangian
|
const bool noLagrangian
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -195,9 +195,9 @@ int main(int argc, char *argv[])
|
|||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"fields",
|
"fields",
|
||||||
"list",
|
"wordRes",
|
||||||
"Specify a list of fields to be mapped. Eg, '(U T p)' - "
|
"Specify single or multiple fields to reconstruct (all by default)."
|
||||||
"regular expressions not currently supported"
|
" Eg, 'T' or '(p T U \"alpha.*\")'"
|
||||||
);
|
);
|
||||||
argList::addBoolOption
|
argList::addBoolOption
|
||||||
(
|
(
|
||||||
@ -288,8 +288,8 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Subtracting mapped source field from target" << endl;
|
Info<< "Subtracting mapped source field from target" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
wordHashSet selectedFields;
|
wordRes selectedFields;
|
||||||
args.readIfPresent("fields", selectedFields);
|
args.readListIfPresent<wordRe>("fields", selectedFields);
|
||||||
|
|
||||||
const bool noLagrangian = args.found("noLagrangian");
|
const bool noLagrangian = args.found("noLagrangian");
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
processorMeshes.C
|
processorMeshes.C
|
||||||
fvFieldReconstructor.C
|
fvFieldReconstructor.C
|
||||||
pointFieldReconstructor.C
|
pointFieldReconstructor.C
|
||||||
reconstructLagrangianPositions.C
|
lagrangianReconstructor.C
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libreconstruct
|
LIB = $(FOAM_LIBBIN)/libreconstruct
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -29,7 +29,7 @@ Description
|
|||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
fvFieldReconstructor.C
|
fvFieldReconstructor.C
|
||||||
fvFieldReconstructorReconstructFields.C
|
fvFieldReconstructorFields.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -47,7 +47,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class fvFieldReconstructor Declaration
|
Class fvFieldReconstructor Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -193,25 +192,83 @@ public:
|
|||||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
|
||||||
reconstructFvSurfaceField(const IOobject& fieldIoObject) const;
|
reconstructFvSurfaceField(const IOobject& fieldIoObject) const;
|
||||||
|
|
||||||
//- Read, reconstruct and write all/selected volume internal fields
|
//- Read, reconstruct and write specified volume internal fields
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void reconstructFvVolumeInternalFields
|
label reconstructFvVolumeInternalFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const UList<word>& fieldNames
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Read, reconstruct and write specified volume fields
|
||||||
|
template<class Type>
|
||||||
|
label reconstructFvVolumeFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const UList<word>& fieldNames
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Read, reconstruct and write specified surface fields
|
||||||
|
template<class Type>
|
||||||
|
label reconstructFvSurfaceFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const UList<word>& fieldNames
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Read, reconstruct and write all/selected volume internal fields
|
||||||
|
// An empty wordRes corresponds to select ALL.
|
||||||
|
template<class Type>
|
||||||
|
label reconstructFvVolumeInternalFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const wordRes& selectedFields = wordRes()
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Read, reconstruct and write all/selected volume fields
|
||||||
|
// An empty wordRes corresponds to select ALL.
|
||||||
|
template<class Type>
|
||||||
|
label reconstructFvVolumeFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const wordRes& selectedFields = wordRes()
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Read, reconstruct and write all/selected surface fields
|
||||||
|
// An empty wordRes corresponds to select ALL.
|
||||||
|
template<class Type>
|
||||||
|
label reconstructFvSurfaceFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const wordRes& selectedFields = wordRes()
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Read, reconstruct and write all/selected volume internal fields
|
||||||
|
// An empty wordHashSet corresponds to select ALL.
|
||||||
|
// \note this may be removed in the future (2018-11)
|
||||||
|
template<class Type>
|
||||||
|
label reconstructFvVolumeInternalFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordHashSet& selectedFields
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Read, reconstruct and write all/selected volume fields
|
//- Read, reconstruct and write all/selected volume fields
|
||||||
|
// An empty wordHashSet corresponds to select ALL.
|
||||||
|
// \note this may be removed in the future (2018-11)
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void reconstructFvVolumeFields
|
label reconstructFvVolumeFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordHashSet& selectedFields
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Read, reconstruct and write all/selected surface fields
|
//- Read, reconstruct and write all/selected surface fields
|
||||||
|
// An empty wordHashSet corresponds to select ALL.
|
||||||
|
// \note this may be removed in the future (2018-11)
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void reconstructFvSurfaceFields
|
label reconstructFvSurfaceFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordHashSet& selectedFields
|
||||||
@ -226,7 +283,7 @@ public:
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#ifdef NoRepository
|
#ifdef NoRepository
|
||||||
#include "fvFieldReconstructorReconstructFields.C"
|
#include "fvFieldReconstructorFields.C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -588,106 +588,218 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::fvFieldReconstructor::reconstructFvVolumeInternalFields
|
Foam::label Foam::fvFieldReconstructor::reconstructFvVolumeInternalFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const UList<word>& fieldNames
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word& clsName = DimensionedField<Type, volMesh>::typeName;
|
typedef DimensionedField<Type, volMesh> fieldType;
|
||||||
|
|
||||||
const wordList fieldNames =
|
|
||||||
(
|
|
||||||
selectedFields.empty()
|
|
||||||
? objects.sortedNames(clsName)
|
|
||||||
: objects.sortedNames(clsName, selectedFields)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (fieldNames.size())
|
|
||||||
{
|
|
||||||
Info<< " Reconstructing " << clsName << "s\n" << nl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
label nFields = 0;
|
||||||
for (const word& fieldName : fieldNames)
|
for (const word& fieldName : fieldNames)
|
||||||
{
|
{
|
||||||
Info<< " " << fieldName << endl;
|
const IOobject* io = objects.cfindObject<fieldType>(fieldName);
|
||||||
|
if (io)
|
||||||
|
{
|
||||||
|
if (!nFields++)
|
||||||
|
{
|
||||||
|
Info<< " Reconstructing "
|
||||||
|
<< fieldType::typeName << "s\n" << nl;
|
||||||
|
}
|
||||||
|
Info<< " " << fieldName << endl;
|
||||||
|
|
||||||
reconstructFvVolumeInternalField<Type>(*(objects[fieldName]))().write();
|
reconstructFvVolumeInternalField<Type>(*io)().write();
|
||||||
|
++nReconstructed_;
|
||||||
++nReconstructed_;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldNames.size()) Info<< endl;
|
if (nFields) Info<< endl;
|
||||||
|
return nFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::fvFieldReconstructor::reconstructFvVolumeFields
|
Foam::label Foam::fvFieldReconstructor::reconstructFvVolumeFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const UList<word>& fieldNames
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word& clsName =
|
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
||||||
GeometricField<Type, fvPatchField, volMesh>::typeName;
|
|
||||||
|
|
||||||
const wordList fieldNames =
|
|
||||||
(
|
|
||||||
selectedFields.empty()
|
|
||||||
? objects.sortedNames(clsName)
|
|
||||||
: objects.sortedNames(clsName, selectedFields)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (fieldNames.size())
|
|
||||||
{
|
|
||||||
Info<< " Reconstructing " << clsName << "s\n" << nl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
label nFields = 0;
|
||||||
for (const word& fieldName : fieldNames)
|
for (const word& fieldName : fieldNames)
|
||||||
{
|
{
|
||||||
Info<< " " << fieldName << endl;
|
const IOobject* io = objects.cfindObject<fieldType>(fieldName);
|
||||||
|
if (io)
|
||||||
|
{
|
||||||
|
if (!nFields++)
|
||||||
|
{
|
||||||
|
Info<< " Reconstructing "
|
||||||
|
<< fieldType::typeName << "s\n" << nl;
|
||||||
|
}
|
||||||
|
Info<< " " << fieldName << endl;
|
||||||
|
|
||||||
reconstructFvVolumeField<Type>(*(objects[fieldName]))().write();
|
reconstructFvVolumeField<Type>(*io)().write();
|
||||||
|
++nReconstructed_;
|
||||||
++nReconstructed_;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldNames.size()) Info<< endl;
|
if (nFields) Info<< endl;
|
||||||
|
return nFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::fvFieldReconstructor::reconstructFvSurfaceFields
|
Foam::label Foam::fvFieldReconstructor::reconstructFvSurfaceFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const UList<word>& fieldNames
|
||||||
|
)
|
||||||
|
{
|
||||||
|
typedef GeometricField<Type, fvsPatchField, surfaceMesh> fieldType;
|
||||||
|
|
||||||
|
label nFields = 0;
|
||||||
|
for (const word& fieldName : fieldNames)
|
||||||
|
{
|
||||||
|
const IOobject* io = objects.cfindObject<fieldType>(fieldName);
|
||||||
|
if (io)
|
||||||
|
{
|
||||||
|
if (!nFields++)
|
||||||
|
{
|
||||||
|
Info<< " Reconstructing "
|
||||||
|
<< fieldType::typeName << "s\n" << nl;
|
||||||
|
}
|
||||||
|
Info<< " " << fieldName << endl;
|
||||||
|
|
||||||
|
reconstructFvSurfaceField<Type>(*io)().write();
|
||||||
|
++nReconstructed_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nFields) Info<< endl;
|
||||||
|
return nFields;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::label Foam::fvFieldReconstructor::reconstructFvVolumeInternalFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const wordRes& selectedFields
|
||||||
|
)
|
||||||
|
{
|
||||||
|
typedef DimensionedField<Type, volMesh> fieldType;
|
||||||
|
|
||||||
|
const wordList fieldNames =
|
||||||
|
(
|
||||||
|
selectedFields.empty()
|
||||||
|
? objects.sortedNames<fieldType>()
|
||||||
|
: objects.sortedNames<fieldType>(selectedFields)
|
||||||
|
);
|
||||||
|
|
||||||
|
return reconstructFvVolumeInternalFields<Type>(objects, fieldNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::label Foam::fvFieldReconstructor::reconstructFvVolumeFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const wordRes& selectedFields
|
||||||
|
)
|
||||||
|
{
|
||||||
|
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
||||||
|
|
||||||
|
const wordList fieldNames =
|
||||||
|
(
|
||||||
|
selectedFields.empty()
|
||||||
|
? objects.sortedNames<fieldType>()
|
||||||
|
: objects.sortedNames<fieldType>(selectedFields)
|
||||||
|
);
|
||||||
|
|
||||||
|
return reconstructFvVolumeFields<Type>(objects, fieldNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::label Foam::fvFieldReconstructor::reconstructFvSurfaceFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const wordRes& selectedFields
|
||||||
|
)
|
||||||
|
{
|
||||||
|
typedef GeometricField<Type, fvsPatchField, surfaceMesh> fieldType;
|
||||||
|
|
||||||
|
const wordList fieldNames =
|
||||||
|
(
|
||||||
|
selectedFields.empty()
|
||||||
|
? objects.sortedNames<fieldType>()
|
||||||
|
: objects.sortedNames<fieldType>(selectedFields)
|
||||||
|
);
|
||||||
|
|
||||||
|
return reconstructFvSurfaceFields<Type>(objects, fieldNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::label Foam::fvFieldReconstructor::reconstructFvVolumeInternalFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordHashSet& selectedFields
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word& clsName =
|
typedef DimensionedField<Type, volMesh> fieldType;
|
||||||
GeometricField<Type, fvsPatchField, surfaceMesh>::typeName;
|
|
||||||
|
|
||||||
const wordList fieldNames =
|
const wordList fieldNames =
|
||||||
(
|
(
|
||||||
selectedFields.empty()
|
selectedFields.empty()
|
||||||
? objects.sortedNames(clsName)
|
? objects.sortedNames<fieldType>()
|
||||||
: objects.sortedNames(clsName, selectedFields)
|
: objects.sortedNames<fieldType>(selectedFields)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (fieldNames.size())
|
return reconstructFvVolumeInternalFields<Type>(objects, fieldNames);
|
||||||
{
|
}
|
||||||
Info<< " Reconstructing " << clsName << "s\n" << nl;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const word& fieldName : fieldNames)
|
|
||||||
{
|
|
||||||
Info<< " " << fieldName << endl;
|
|
||||||
|
|
||||||
reconstructFvSurfaceField<Type>(*(objects[fieldName]))().write();
|
template<class Type>
|
||||||
|
Foam::label Foam::fvFieldReconstructor::reconstructFvVolumeFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const wordHashSet& selectedFields
|
||||||
|
)
|
||||||
|
{
|
||||||
|
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
||||||
|
|
||||||
++nReconstructed_;
|
const wordList fieldNames =
|
||||||
}
|
(
|
||||||
|
selectedFields.empty()
|
||||||
|
? objects.sortedNames<fieldType>()
|
||||||
|
: objects.sortedNames<fieldType>(selectedFields)
|
||||||
|
);
|
||||||
|
|
||||||
if (fieldNames.size()) Info<< endl;
|
return reconstructFvVolumeField<Type>(objects, fieldNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::label Foam::fvFieldReconstructor::reconstructFvSurfaceFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const wordHashSet& selectedFields
|
||||||
|
)
|
||||||
|
{
|
||||||
|
typedef GeometricField<Type, fvsPatchField, surfaceMesh> fieldType;
|
||||||
|
|
||||||
|
const wordList fieldNames =
|
||||||
|
(
|
||||||
|
selectedFields.empty()
|
||||||
|
? objects.sortedNames<fieldType>()
|
||||||
|
: objects.sortedNames<fieldType>(selectedFields)
|
||||||
|
);
|
||||||
|
|
||||||
|
return reconstructFvSurfaceFields<Type>(objects, fieldNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -23,38 +23,51 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "reconstructLagrangian.H"
|
#include "lagrangianReconstructor.H"
|
||||||
#include "labelIOList.H"
|
#include "labelIOList.H"
|
||||||
#include "passiveParticleCloud.H"
|
#include "passiveParticleCloud.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::reconstructLagrangianPositions
|
Foam::lagrangianReconstructor::lagrangianReconstructor
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const word& cloudName,
|
const PtrList<fvMesh>& procMeshes,
|
||||||
const PtrList<fvMesh>& meshes,
|
|
||||||
const PtrList<labelIOList>& faceProcAddressing,
|
const PtrList<labelIOList>& faceProcAddressing,
|
||||||
const PtrList<labelIOList>& cellProcAddressing
|
const PtrList<labelIOList>& cellProcAddressing
|
||||||
)
|
)
|
||||||
|
:
|
||||||
|
mesh_(mesh),
|
||||||
|
procMeshes_(procMeshes),
|
||||||
|
faceProcAddressing_(faceProcAddressing),
|
||||||
|
cellProcAddressing_(cellProcAddressing)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::label Foam::lagrangianReconstructor::reconstructPositions
|
||||||
|
(
|
||||||
|
const word& cloudName
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
passiveParticleCloud lagrangianPositions
|
passiveParticleCloud lagrangianPositions
|
||||||
(
|
(
|
||||||
mesh,
|
mesh_,
|
||||||
cloudName,
|
cloudName,
|
||||||
IDLList<passiveParticle>()
|
IDLList<passiveParticle>()
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(meshes, meshi)
|
forAll(procMeshes_, meshi)
|
||||||
{
|
{
|
||||||
const labelList& cellMap = cellProcAddressing[meshi];
|
const labelList& cellMap = cellProcAddressing_[meshi];
|
||||||
const labelList& faceMap = faceProcAddressing[meshi];
|
const labelList& faceMap = faceProcAddressing_[meshi];
|
||||||
|
|
||||||
Cloud<passiveParticle> lpi(meshes[meshi], cloudName, false);
|
Cloud<passiveParticle> lpi(procMeshes_[meshi], cloudName, false);
|
||||||
|
|
||||||
forAllConstIter(Cloud<passiveParticle>, lpi, iter)
|
forAllConstIters(lpi, iter)
|
||||||
{
|
{
|
||||||
const passiveParticle& ppi = iter();
|
const passiveParticle& ppi = *iter;
|
||||||
|
|
||||||
const label mappedCell = cellMap[ppi.cell()];
|
const label mappedCell = cellMap[ppi.cell()];
|
||||||
|
|
||||||
@ -66,11 +79,11 @@ void Foam::reconstructLagrangianPositions
|
|||||||
(
|
(
|
||||||
new passiveParticle
|
new passiveParticle
|
||||||
(
|
(
|
||||||
mesh,
|
mesh_,
|
||||||
ppi.coordinates(),
|
ppi.coordinates(),
|
||||||
mappedCell,
|
mappedCell,
|
||||||
mappedTetFace,
|
mappedTetFace,
|
||||||
ppi.procTetPt(mesh, mappedCell, mappedTetFace)
|
ppi.procTetPt(mesh_, mappedCell, mappedTetFace)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -87,6 +100,8 @@ void Foam::reconstructLagrangianPositions
|
|||||||
cloud::geometryType::POSITIONS
|
cloud::geometryType::POSITIONS
|
||||||
).write();
|
).write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return lagrangianPositions.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
158
src/parallel/reconstruct/reconstruct/lagrangianReconstructor.H
Normal file
158
src/parallel/reconstruct/reconstruct/lagrangianReconstructor.H
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::lagrangianReconstructor
|
||||||
|
|
||||||
|
Description
|
||||||
|
Reconstructor for lagrangian positions and fields
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
lagrangianReconstructor.C
|
||||||
|
lagrangianReconstructorFields.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef lagrangianReconstructor_H
|
||||||
|
#define lagrangianReconstructor_H
|
||||||
|
|
||||||
|
#include "cloud.H"
|
||||||
|
#include "polyMesh.H"
|
||||||
|
#include "IOobjectList.H"
|
||||||
|
#include "CompactIOField.H"
|
||||||
|
#include "fvMesh.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class lagrangianReconstructor Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class lagrangianReconstructor
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Mesh reference
|
||||||
|
const fvMesh& mesh_;
|
||||||
|
|
||||||
|
//- List of processor meshes
|
||||||
|
const PtrList<fvMesh>& procMeshes_;
|
||||||
|
|
||||||
|
//- List of processor face addressing lists
|
||||||
|
const PtrList<labelIOList>& faceProcAddressing_;
|
||||||
|
|
||||||
|
//- List of processor cell addressing lists
|
||||||
|
const PtrList<labelIOList>& cellProcAddressing_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- No copy construct
|
||||||
|
lagrangianReconstructor(const lagrangianReconstructor&) = delete;
|
||||||
|
|
||||||
|
//- No copy assignment
|
||||||
|
void operator=(const lagrangianReconstructor&) = delete;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
lagrangianReconstructor
|
||||||
|
(
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const PtrList<fvMesh>& procMeshes,
|
||||||
|
const PtrList<labelIOList>& faceProcAddressing,
|
||||||
|
const PtrList<labelIOList>& cellProcAddressing
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Reconstruct positions for given cloud
|
||||||
|
label reconstructPositions(const word& cloudName) const;
|
||||||
|
|
||||||
|
//- Reconstruct a single field for given cloud
|
||||||
|
template<class Type>
|
||||||
|
tmp<IOField<Type>> reconstructField
|
||||||
|
(
|
||||||
|
const word& cloudName,
|
||||||
|
const word& fieldName
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Reconstruct a single field-field for given cloud
|
||||||
|
template<class Type>
|
||||||
|
tmp<CompactIOField<Field<Type>, Type>> reconstructFieldField
|
||||||
|
(
|
||||||
|
const word& cloudName,
|
||||||
|
const word& fieldName
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Reconstruct multiple fields for given cloud
|
||||||
|
template<class Type>
|
||||||
|
label reconstructFields
|
||||||
|
(
|
||||||
|
const word& cloudName,
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const UList<word>& fieldNames
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Reconstruct multiple fields for given cloud
|
||||||
|
template<class Type>
|
||||||
|
label reconstructFields
|
||||||
|
(
|
||||||
|
const word& cloudName,
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const wordRes& selectedFields = wordRes()
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Reconstruct multiple field-field for given cloud
|
||||||
|
template<class Type>
|
||||||
|
label reconstructFieldFields
|
||||||
|
(
|
||||||
|
const word& cloudName,
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const wordRes& selectedFields = wordRes()
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
#include "lagrangianReconstructorFields.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -27,14 +27,13 @@ License
|
|||||||
#include "CompactIOField.H"
|
#include "CompactIOField.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::tmp<Foam::IOField<Type>> Foam::reconstructLagrangianField
|
Foam::tmp<Foam::IOField<Type>>
|
||||||
|
Foam::lagrangianReconstructor::reconstructField
|
||||||
(
|
(
|
||||||
const word& cloudName,
|
const word& cloudName,
|
||||||
const polyMesh& mesh,
|
|
||||||
const PtrList<fvMesh>& meshes,
|
|
||||||
const word& fieldName
|
const word& fieldName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -44,17 +43,17 @@ Foam::tmp<Foam::IOField<Type>> Foam::reconstructLagrangianField
|
|||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
fieldName,
|
fieldName,
|
||||||
mesh.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
cloud::prefix/cloudName,
|
cloud::prefix/cloudName,
|
||||||
mesh,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
Field<Type>(0)
|
Field<Type>()
|
||||||
);
|
);
|
||||||
auto& field = tfield.ref();
|
auto& field = tfield.ref();
|
||||||
|
|
||||||
for (const fvMesh& localMesh : meshes)
|
for (const fvMesh& localMesh : procMeshes_)
|
||||||
{
|
{
|
||||||
// Check object on local mesh
|
// Check object on local mesh
|
||||||
IOobject localIOobject
|
IOobject localIOobject
|
||||||
@ -87,11 +86,9 @@ Foam::tmp<Foam::IOField<Type>> Foam::reconstructLagrangianField
|
|||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::tmp<Foam::CompactIOField<Foam::Field<Type>, Type>>
|
Foam::tmp<Foam::CompactIOField<Foam::Field<Type>, Type>>
|
||||||
Foam::reconstructLagrangianFieldField
|
Foam::lagrangianReconstructor::reconstructFieldField
|
||||||
(
|
(
|
||||||
const word& cloudName,
|
const word& cloudName,
|
||||||
const polyMesh& mesh,
|
|
||||||
const PtrList<fvMesh>& meshes,
|
|
||||||
const word& fieldName
|
const word& fieldName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -101,17 +98,17 @@ Foam::reconstructLagrangianFieldField
|
|||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
fieldName,
|
fieldName,
|
||||||
mesh.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
cloud::prefix/cloudName,
|
cloud::prefix/cloudName,
|
||||||
mesh,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
Field<Field<Type>>(0)
|
Field<Field<Type>>()
|
||||||
);
|
);
|
||||||
auto& field = tfield.ref();
|
auto& field = tfield.ref();
|
||||||
|
|
||||||
for (const fvMesh& localMesh : meshes)
|
for (const fvMesh& localMesh : procMeshes_)
|
||||||
{
|
{
|
||||||
// Check object on local mesh
|
// Check object on local mesh
|
||||||
IOobject localIOobject
|
IOobject localIOobject
|
||||||
@ -150,117 +147,100 @@ Foam::reconstructLagrangianFieldField
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::reconstructLagrangianFields
|
Foam::label Foam::lagrangianReconstructor::reconstructFields
|
||||||
(
|
(
|
||||||
const word& cloudName,
|
const word& cloudName,
|
||||||
const polyMesh& mesh,
|
|
||||||
const PtrList<fvMesh>& meshes,
|
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const UList<word>& fieldNames
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word& clsName = IOField<Type>::typeName;
|
typedef IOField<Type> fieldType;
|
||||||
|
|
||||||
const wordList fieldNames =
|
|
||||||
(
|
|
||||||
selectedFields.empty()
|
|
||||||
? objects.sortedNames(clsName)
|
|
||||||
: objects.sortedNames(clsName, selectedFields)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (fieldNames.size())
|
|
||||||
{
|
|
||||||
Info<< " Reconstructing lagrangian " << clsName << "s\n" << nl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
label nFields = 0;
|
||||||
for (const word& fieldName : fieldNames)
|
for (const word& fieldName : fieldNames)
|
||||||
{
|
{
|
||||||
Info<< " " << fieldName << endl;
|
const IOobject* io = objects.cfindObject<fieldType>(fieldName);
|
||||||
|
if (io)
|
||||||
|
{
|
||||||
|
if (nFields++)
|
||||||
|
{
|
||||||
|
Info<< " Reconstructing lagrangian "
|
||||||
|
<< fieldType::typeName << "s\n" << nl;
|
||||||
|
}
|
||||||
|
Info<< " " << fieldName << endl;
|
||||||
|
|
||||||
reconstructLagrangianField<Type>
|
reconstructField<Type>(cloudName, fieldName)().write();
|
||||||
(
|
}
|
||||||
cloudName,
|
|
||||||
mesh,
|
|
||||||
meshes,
|
|
||||||
fieldName
|
|
||||||
)().write();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldNames.size()) Info<< endl;
|
if (nFields) Info<< endl;
|
||||||
|
return nFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::reconstructLagrangianFieldFields
|
Foam::label Foam::lagrangianReconstructor::reconstructFields
|
||||||
(
|
(
|
||||||
const word& cloudName,
|
const word& cloudName,
|
||||||
const polyMesh& mesh,
|
|
||||||
const PtrList<fvMesh>& meshes,
|
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordRes& selectedFields
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
typedef IOField<Type> fieldType;
|
||||||
|
|
||||||
|
const wordList fieldNames =
|
||||||
|
(
|
||||||
|
selectedFields.empty()
|
||||||
|
? objects.sortedNames<fieldType>()
|
||||||
|
: objects.sortedNames<fieldType>(selectedFields)
|
||||||
|
);
|
||||||
|
|
||||||
|
return reconstructFields<Type>(cloudName, objects, fieldNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::label Foam::lagrangianReconstructor::reconstructFieldFields
|
||||||
|
(
|
||||||
|
const word& cloudName,
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const wordRes& selectedFields
|
||||||
|
)
|
||||||
|
{
|
||||||
|
typedef CompactIOField<Field<Type>, Type> fieldType;
|
||||||
|
|
||||||
|
wordList fieldNames =
|
||||||
|
(
|
||||||
|
selectedFields.empty()
|
||||||
|
? objects.names<fieldType>()
|
||||||
|
: objects.names<fieldType>(selectedFields)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Append IOField Field names
|
||||||
|
fieldNames.append
|
||||||
|
(
|
||||||
|
objects.empty()
|
||||||
|
? objects.names<IOField<Field<Type>>>()
|
||||||
|
: objects.names<IOField<Field<Type>>>(selectedFields)
|
||||||
|
);
|
||||||
|
|
||||||
|
Foam::sort(fieldNames);
|
||||||
|
|
||||||
|
label nFields = 0;
|
||||||
|
for (const word& fieldName : fieldNames)
|
||||||
{
|
{
|
||||||
const word& clsName = CompactIOField<Field<Type>,Type>::typeName;
|
if (!nFields++)
|
||||||
|
|
||||||
const wordList fieldNames =
|
|
||||||
(
|
|
||||||
selectedFields.empty()
|
|
||||||
? objects.sortedNames(clsName)
|
|
||||||
: objects.sortedNames(clsName, selectedFields)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (fieldNames.size())
|
|
||||||
{
|
{
|
||||||
Info<< " Reconstructing lagrangian " << clsName << "s\n" << nl;
|
Info<< " Reconstructing lagrangian "
|
||||||
|
<< fieldType::typeName << "s\n" << nl;
|
||||||
}
|
}
|
||||||
|
Info<< " " << fieldName << endl;
|
||||||
|
|
||||||
for (const word& fieldName : fieldNames)
|
reconstructFieldField<Type>(cloudName, fieldName)().write();
|
||||||
{
|
|
||||||
Info<< " " << fieldName << endl;
|
|
||||||
|
|
||||||
reconstructLagrangianFieldField<Type>
|
|
||||||
(
|
|
||||||
cloudName,
|
|
||||||
mesh,
|
|
||||||
meshes,
|
|
||||||
fieldName
|
|
||||||
)().write();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fieldNames.size()) Info<< endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if (nFields) Info<< endl;
|
||||||
const word& clsName = IOField<Field<Type>>::typeName;
|
return nFields;
|
||||||
|
|
||||||
const wordList fieldNames =
|
|
||||||
(
|
|
||||||
selectedFields.empty()
|
|
||||||
? objects.sortedNames(clsName)
|
|
||||||
: objects.sortedNames(clsName, selectedFields)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (fieldNames.size())
|
|
||||||
{
|
|
||||||
Info<< " Reconstructing lagrangian " << clsName << "s\n" << nl;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const word& fieldName : fieldNames)
|
|
||||||
{
|
|
||||||
Info<< " " << fieldName << endl;
|
|
||||||
|
|
||||||
reconstructLagrangianFieldField<Type>
|
|
||||||
(
|
|
||||||
cloudName,
|
|
||||||
mesh,
|
|
||||||
meshes,
|
|
||||||
fieldName
|
|
||||||
)().write();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fieldNames.size()) Info<< endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -29,6 +29,7 @@ Description
|
|||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
pointFieldReconstructor.C
|
pointFieldReconstructor.C
|
||||||
|
pointFieldReconstructorFields.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -149,9 +150,28 @@ public:
|
|||||||
tmp<GeometricField<Type, pointPatchField, pointMesh>>
|
tmp<GeometricField<Type, pointPatchField, pointMesh>>
|
||||||
reconstructField(const IOobject& fieldIoObject);
|
reconstructField(const IOobject& fieldIoObject);
|
||||||
|
|
||||||
//- Reconstruct and write all fields
|
//- Reconstruct and write specified fields
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void reconstructFields
|
label reconstructFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const UList<word>& fieldNames
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Reconstruct and write all or selected fields
|
||||||
|
// An empty wordRes corresponds to select ALL.
|
||||||
|
template<class Type>
|
||||||
|
label reconstructFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const wordRes& selectedFields = wordRes()
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Reconstruct and write all or selected fields
|
||||||
|
// An empty wordHashSet corresponds to select ALL.
|
||||||
|
// \note this may be removed in the future (2018-11)
|
||||||
|
template<class Type>
|
||||||
|
label reconstructFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordHashSet& selectedFields
|
||||||
@ -166,7 +186,7 @@ public:
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#ifdef NoRepository
|
#ifdef NoRepository
|
||||||
#include "pointFieldReconstructorReconstructFields.C"
|
#include "pointFieldReconstructorFields.C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -135,37 +135,75 @@ Foam::pointFieldReconstructor::reconstructField(const IOobject& fieldIoObject)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Reconstruct and write all point fields
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::pointFieldReconstructor::reconstructFields
|
Foam::label Foam::pointFieldReconstructor::reconstructFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const UList<word>& fieldNames
|
||||||
|
)
|
||||||
|
{
|
||||||
|
typedef GeometricField<Type, pointPatchField, pointMesh> fieldType;
|
||||||
|
|
||||||
|
label nFields = 0;
|
||||||
|
for (const word& fieldName : fieldNames)
|
||||||
|
{
|
||||||
|
const IOobject* io = objects.cfindObject<fieldType>(fieldName);
|
||||||
|
if (io)
|
||||||
|
{
|
||||||
|
if (!nFields++)
|
||||||
|
{
|
||||||
|
Info<< " Reconstructing "
|
||||||
|
<< fieldType::typeName << "s\n" << nl;
|
||||||
|
}
|
||||||
|
Info<< " " << fieldName << endl;
|
||||||
|
|
||||||
|
reconstructField<Type>(*io)().write();
|
||||||
|
++nReconstructed_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nFields) Info<< endl;
|
||||||
|
return nFields;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::label Foam::pointFieldReconstructor::reconstructFields
|
||||||
|
(
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const wordRes& selectedFields
|
||||||
|
)
|
||||||
|
{
|
||||||
|
typedef GeometricField<Type, pointPatchField, pointMesh> fieldType;
|
||||||
|
|
||||||
|
const wordList fieldNames =
|
||||||
|
(
|
||||||
|
selectedFields.empty()
|
||||||
|
? objects.sortedNames<fieldType>()
|
||||||
|
: objects.sortedNames<fieldType>(selectedFields)
|
||||||
|
);
|
||||||
|
|
||||||
|
return reconstructFields<Type>(objects, fieldNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
Foam::label Foam::pointFieldReconstructor::reconstructFields
|
||||||
(
|
(
|
||||||
const IOobjectList& objects,
|
const IOobjectList& objects,
|
||||||
const wordHashSet& selectedFields
|
const wordHashSet& selectedFields
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word& clsName =
|
typedef GeometricField<Type, pointPatchField, pointMesh> fieldType;
|
||||||
GeometricField<Type, pointPatchField, pointMesh>::typeName;
|
|
||||||
|
|
||||||
const wordList fieldNames =
|
const wordList fieldNames =
|
||||||
(
|
(
|
||||||
selectedFields.empty()
|
selectedFields.empty()
|
||||||
? objects.sortedNames(clsName)
|
? objects.sortedNames<fieldType>()
|
||||||
: objects.sortedNames(clsName, selectedFields)
|
: objects.sortedNames<fieldType>(selectedFields)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (fieldNames.size())
|
return reconstructFields<Type>(objects, fieldNames);
|
||||||
{
|
|
||||||
Info<< " Reconstructing " << clsName << "s\n" << nl;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const word& fieldName : fieldNames)
|
|
||||||
{
|
|
||||||
Info<< " " << fieldName << endl;
|
|
||||||
|
|
||||||
reconstructField<Type>(*(objects[fieldName]))().write();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fieldNames.size()) Info<< endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -45,7 +45,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class processorMeshes Declaration
|
Class processorMeshes Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|||||||
@ -1,117 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
InClass
|
|
||||||
Foam::reconstructLagrangian
|
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
reconstructLagrangianFields.C
|
|
||||||
reconstructLagrangianPositions.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef reconstructLagrangian_H
|
|
||||||
#define reconstructLagrangian_H
|
|
||||||
|
|
||||||
#include "cloud.H"
|
|
||||||
#include "polyMesh.H"
|
|
||||||
#include "IOobjectList.H"
|
|
||||||
#include "CompactIOField.H"
|
|
||||||
#include "fvMesh.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void reconstructLagrangianPositions
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const word& cloudName,
|
|
||||||
const PtrList<fvMesh>& meshes,
|
|
||||||
const PtrList<labelIOList>& faceProcAddressing,
|
|
||||||
const PtrList<labelIOList>& cellProcAddressing
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
tmp<IOField<Type>> reconstructLagrangianField
|
|
||||||
(
|
|
||||||
const word& cloudName,
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const PtrList<fvMesh>& meshes,
|
|
||||||
const word& fieldName
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
tmp<CompactIOField<Field<Type>, Type>> reconstructLagrangianFieldField
|
|
||||||
(
|
|
||||||
const word& cloudName,
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const PtrList<fvMesh>& meshes,
|
|
||||||
const word& fieldName
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void reconstructLagrangianFields
|
|
||||||
(
|
|
||||||
const word& cloudName,
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const PtrList<fvMesh>& meshes,
|
|
||||||
const IOobjectList& objects,
|
|
||||||
const wordHashSet& selectedFields
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void reconstructLagrangianFieldFields
|
|
||||||
(
|
|
||||||
const word& cloudName,
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const PtrList<fvMesh>& meshes,
|
|
||||||
const IOobjectList& objects,
|
|
||||||
const wordHashSet& selectedFields
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#ifdef NoRepository
|
|
||||||
#include "reconstructLagrangianFields.C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
Reference in New Issue
Block a user