33 const fvMesh& completeMesh,
40 completeMesh_(completeMesh),
41 procMeshes_(procMeshes),
42 particleProcAddressing_(procMeshes_.size()),
43 procClouds_(procMeshes.size()),
48 forAll(cellProcAddressing, proci)
50 forAll(cellProcAddressing[proci], procCelli)
52 cellProcCell[cellProcAddressing[proci][procCelli]] =
60 forAll(faceProcAddressing, proci)
62 forAll(faceProcAddressing[proci], procFacei)
64 const bool owner = faceProcAddressing[proci][procFacei] > 0;
65 const label facei =
mag(faceProcAddressing[proci][procFacei]) - 1;
67 (owner ? faceOwnerProcFace : faceNeighbourProcFace)[facei] =
96 labelList procNParticles(procMeshes_.size(), 0);
100 const label proci = cellProcCell[
p.cell()].proci;
102 procNParticles[proci] ++;
106 forAll(procMeshes_, proci)
108 particleProcAddressing_[proci].
resize(procNParticles[proci], -1);
112 label completeParticlei = 0;
113 labelList procParticlei(procMeshes_.size(), 0);
117 const label proci = cellProcCell[
p.cell()].proci;
118 const label procCelli = cellProcCell[
p.cell()].elementi;
119 const label procFacei =
120 faceOwnerProcFace[
p.tetFace()].proci == proci
121 ? faceOwnerProcFace[
p.tetFace()].elementi
122 : faceNeighbourProcFace[
p.tetFace()].elementi;
124 particleProcAddressing_[proci][procParticlei[proci]] =
127 procClouds_[proci].append
145 completeParticlei ++;
146 procParticlei[proci] ++;
163 #define DO_LAGRANGIAN_FIELDS_TYPE(Type, nullArg) \
165 || !objects.lookupClass(IOField<Type>::typeName).empty() \
166 || !objects.lookupClass(IOField<Field<Type>>::typeName).empty() \
167 || !objects.lookupClass(CompactIOField<Field<Type>>::typeName).empty();
170 #undef DO_LAGRANGIAN_FIELDS_TYPE
185 forAll(procClouds_, proci)
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Template class for intrusive linked lists.
Helper IO class to read and write particle positions.
virtual bool write(const bool write=true) const
Write using setting from DB.
List of IOobjects with searching and retrieving facilities.
void resize(const label)
Alias for setSize(const label)
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Mesh data needed to do the Finite Volume discretisation.
void decomposePositions() const
Write the decomposed positions.
static bool decomposes(const IOobjectList &objects)
Return whether anything in the object list gets decomposed.
~lagrangianFieldDecomposer()
Destructor.
const PtrList< passiveParticleCloud > & procClouds() const
Access the decomposed clouds.
lagrangianFieldDecomposer(const fvMesh &completeMesh, const PtrList< fvMesh > &procMeshes, const labelListList &faceProcAddressing, const labelListList &cellProcAddressing, const word &cloudName)
Construct from components.
A Cloud of passive particles.
Struct for keeping processor, element (cell, face, point) index.
A class for handling words, derived from string.
#define DO_LAGRANGIAN_FIELDS_TYPE(Type, nullArg)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
const word cloudName(propsDict.lookup("cloudName"))