mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: improve handling of finiteArea mesh with distributed roots
- in makeFaMesh, the serial fields are now only read on the master process and broadcast to the other ranks. The read+distribute is almost identical to that used in redistributePar, except that in this case entire fields are sent and not a zero-sized subset. - improved internal faMesh checking for files so that the TryNew method works with distributed roots.
This commit is contained in:
@ -45,6 +45,7 @@ SourceFiles
|
||||
#define Foam_faFieldDecomposer_H
|
||||
|
||||
#include "faMesh.H"
|
||||
#include "faMeshSubset.H"
|
||||
#include "faPatchFieldMapper.H"
|
||||
#include "edgeFields.H"
|
||||
|
||||
@ -446,6 +447,26 @@ public:
|
||||
const IOobjectList& objects
|
||||
);
|
||||
|
||||
//- Read all fields given mesh and objects.
|
||||
//- Supports reading/sending fields
|
||||
void readAllFields
|
||||
(
|
||||
const bitSet& haveMeshOnProc,
|
||||
const faMeshSubset* subsetter,
|
||||
const faMesh& mesh,
|
||||
IOobjectList& objects
|
||||
);
|
||||
|
||||
//- Read all fields given mesh and objects.
|
||||
//- Supports reading/sending fields
|
||||
void readAllFields
|
||||
(
|
||||
const boolList& haveMeshOnProc,
|
||||
const faMeshSubset* subsetter,
|
||||
const faMesh& mesh,
|
||||
IOobjectList& objects
|
||||
);
|
||||
|
||||
//- Decompose and write all fields
|
||||
void decomposeAllFields
|
||||
(
|
||||
|
||||
@ -77,7 +77,11 @@ public:
|
||||
|
||||
bool empty() const noexcept { return !size(); }
|
||||
|
||||
void readAll(const faMesh& mesh, const IOobjectList& objects)
|
||||
void readAll
|
||||
(
|
||||
const faMesh& mesh,
|
||||
const IOobjectList& objects
|
||||
)
|
||||
{
|
||||
#undef doLocalCode
|
||||
#define doLocalCode(Type) \
|
||||
@ -113,6 +117,45 @@ public:
|
||||
#undef doLocalCode
|
||||
}
|
||||
|
||||
template<class BoolListType>
|
||||
void readAll
|
||||
(
|
||||
const BoolListType& haveMeshOnProc,
|
||||
const faMeshSubset*& subsetter,
|
||||
const faMesh& mesh,
|
||||
IOobjectList& objects
|
||||
)
|
||||
{
|
||||
#undef doLocalCode
|
||||
#define doLocalCode(Type) \
|
||||
{ \
|
||||
fieldsDistributor::readFields \
|
||||
( \
|
||||
haveMeshOnProc, \
|
||||
subsetter, \
|
||||
mesh, \
|
||||
objects, \
|
||||
Type##AreaFields_ \
|
||||
); \
|
||||
fieldsDistributor::readFields \
|
||||
( \
|
||||
haveMeshOnProc, \
|
||||
subsetter, \
|
||||
mesh, \
|
||||
objects, \
|
||||
Type##EdgeFields_ \
|
||||
); \
|
||||
}
|
||||
|
||||
doLocalCode(scalar);
|
||||
doLocalCode(vector);
|
||||
doLocalCode(sphericalTensor);
|
||||
doLocalCode(symmTensor);
|
||||
doLocalCode(tensor);
|
||||
|
||||
#undef doLocalCode
|
||||
}
|
||||
|
||||
template<class GeoField>
|
||||
static void decompose
|
||||
(
|
||||
@ -205,6 +248,36 @@ void Foam::faFieldDecomposer::fieldsCache::readAllFields
|
||||
}
|
||||
|
||||
|
||||
void Foam::faFieldDecomposer::fieldsCache::readAllFields
|
||||
(
|
||||
const bitSet& haveMeshOnProc,
|
||||
const faMeshSubset* subsetter,
|
||||
const faMesh& mesh,
|
||||
IOobjectList& objects
|
||||
)
|
||||
{
|
||||
if (cache_)
|
||||
{
|
||||
cache_->readAll(haveMeshOnProc, subsetter, mesh, objects);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::faFieldDecomposer::fieldsCache::readAllFields
|
||||
(
|
||||
const boolList& haveMeshOnProc,
|
||||
const faMeshSubset* subsetter,
|
||||
const faMesh& mesh,
|
||||
IOobjectList& objects
|
||||
)
|
||||
{
|
||||
if (cache_)
|
||||
{
|
||||
cache_->readAll(haveMeshOnProc, subsetter, mesh, objects);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::faFieldDecomposer::fieldsCache::decomposeAllFields
|
||||
(
|
||||
const faFieldDecomposer& decomposer,
|
||||
|
||||
Reference in New Issue
Block a user