mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: code modernization for decompose/reconstruct
- simplify procAddressing read/write - avoid accessing points in faMeshReconstructor. Can rely on the patch meshPoints (labelList), which does not need access to a pointField - report number of points on decomposed mesh. Can be useful additional information. Additional statistics for finite area decomposition - provide bundled reconstructAllFields for various reconstructors - remove reconstructPar checks for very old face addressing (from foam2.0 - ie, older than OpenFOAM itself) - bundle all reading into fieldsDistributor tools, where it can be reused by various utilities as required. - combine decomposition fields as respective fieldsCache which eliminates most of the clutter from decomposePar and similfies reuse in the future. STYLE: remove old wordHashSet selection (deprecated in 2018) BUG: incorrect face flip handling for faMeshReconstructor - a latent bug which is not yet triggered since the faMesh faces are currently only definable on boundary faces (which never flip)
This commit is contained in:
committed by
Andrew Heather
parent
eccc998ed2
commit
3b6761afed
@ -25,11 +25,7 @@ if (doDecompose && Pstream::parRun())
|
||||
// Handle area fields
|
||||
// ------------------
|
||||
|
||||
PtrList<areaScalarField> areaScalarFields;
|
||||
PtrList<areaVectorField> areaVectorFields;
|
||||
PtrList<areaSphericalTensorField> areaSphTensorFields;
|
||||
PtrList<areaSymmTensorField> areaSymmTensorFields;
|
||||
PtrList<areaTensorField> areaTensorFields;
|
||||
faFieldDecomposer::fieldsCache areaFieldsCache;
|
||||
|
||||
const faMesh& fullMesh = reconstructor.mesh();
|
||||
|
||||
@ -51,26 +47,7 @@ if (doDecompose && Pstream::parRun())
|
||||
|
||||
IOobjectList objects(fullMesh.time(), runTime.timeName());
|
||||
|
||||
faFieldDecomposer::readFields
|
||||
(
|
||||
fullMesh, objects, areaScalarFields
|
||||
);
|
||||
faFieldDecomposer::readFields
|
||||
(
|
||||
fullMesh, objects, areaVectorFields
|
||||
);
|
||||
faFieldDecomposer::readFields
|
||||
(
|
||||
fullMesh, objects, areaSphTensorFields
|
||||
);
|
||||
faFieldDecomposer::readFields
|
||||
(
|
||||
fullMesh, objects, areaSymmTensorFields
|
||||
);
|
||||
faFieldDecomposer::readFields
|
||||
(
|
||||
fullMesh, objects, areaTensorFields
|
||||
);
|
||||
areaFieldsCache.readAllFields(fullMesh, objects);
|
||||
|
||||
// Restore old settings
|
||||
if (oldHandler)
|
||||
@ -81,14 +58,7 @@ if (doDecompose && Pstream::parRun())
|
||||
}
|
||||
}
|
||||
|
||||
const label nAreaFields =
|
||||
(
|
||||
areaScalarFields.size()
|
||||
+ areaVectorFields.size()
|
||||
+ areaSphTensorFields.size()
|
||||
+ areaSymmTensorFields.size()
|
||||
+ areaTensorFields.size()
|
||||
);
|
||||
const label nAreaFields = areaFieldsCache.size();
|
||||
|
||||
if (nAreaFields)
|
||||
{
|
||||
@ -103,41 +73,8 @@ if (doDecompose && Pstream::parRun())
|
||||
reconstructor.boundaryProcAddressing()
|
||||
);
|
||||
|
||||
if (areaScalarFields.size())
|
||||
{
|
||||
Info<< " scalars: "
|
||||
<< flatOutput(PtrListOps::names(areaScalarFields)) << nl;
|
||||
fieldDecomposer.decomposeFields(areaScalarFields);
|
||||
}
|
||||
|
||||
if (areaVectorFields.size())
|
||||
{
|
||||
Info<< " vectors: "
|
||||
<< flatOutput(PtrListOps::names(areaVectorFields)) << nl;
|
||||
fieldDecomposer.decomposeFields(areaVectorFields);
|
||||
}
|
||||
|
||||
if (areaSphTensorFields.size())
|
||||
{
|
||||
Info<< " sphTensors: "
|
||||
<< flatOutput(PtrListOps::names(areaSphTensorFields)) << nl;
|
||||
fieldDecomposer.decomposeFields(areaSphTensorFields);
|
||||
}
|
||||
|
||||
if (areaSymmTensorFields.size())
|
||||
{
|
||||
Info<< " symmTensors: "
|
||||
<< flatOutput(PtrListOps::names(areaSymmTensorFields)) << nl;
|
||||
fieldDecomposer.decomposeFields(areaSymmTensorFields);
|
||||
}
|
||||
|
||||
if (areaTensorFields.size())
|
||||
{
|
||||
Info<< " tensors: "
|
||||
<< flatOutput(PtrListOps::names(areaTensorFields)) << nl;
|
||||
fieldDecomposer.decomposeFields(areaTensorFields);
|
||||
}
|
||||
|
||||
// Report
|
||||
areaFieldsCache.decomposeAllFields(fieldDecomposer, true);
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,6 +46,7 @@ Original Authors
|
||||
#include "IOobjectList.H"
|
||||
|
||||
#include "areaFields.H"
|
||||
#include "edgeFields.H"
|
||||
#include "faFieldDecomposer.H"
|
||||
#include "faMeshReconstructor.H"
|
||||
#include "PtrListOps.H"
|
||||
|
||||
Reference in New Issue
Block a user