33 const fvMesh& completeMesh,
34 const PtrList<fvMesh>& procMeshes,
40 completeMesh_(completeMesh),
41 procMeshes_(procMeshes),
42 particleProcAddressing_(procMeshes_.size()),
46 List<remote> cellProcCell(completeMesh_.nCells());
47 forAll(cellProcAddressing, proci)
49 forAll(cellProcAddressing[proci], procCelli)
51 cellProcCell[cellProcAddressing[proci][procCelli]] =
52 remote(proci, procCelli);
57 List<remote> faceOwnerProcFace(completeMesh_.nFaces());
58 List<remote> faceNeighbourProcFace(completeMesh_.nFaces());
59 forAll(faceProcAddressing, proci)
61 forAll(faceProcAddressing[proci], procFacei)
63 const bool owner = faceProcAddressing[proci][procFacei] > 0;
64 const label facei =
mag(faceProcAddressing[proci][procFacei]) - 1;
66 (owner ? faceOwnerProcFace : faceNeighbourProcFace)[facei] =
67 remote(proci, procFacei);
72 const passiveParticleCloud completePositions
80 PtrList<passiveParticleCloud> procPositions(procMeshes_.size());
86 new passiveParticleCloud
90 IDLList<passiveParticle>()
96 labelList procNParticles(procMeshes_.size(), 0);
99 const passiveParticle&
p = iter();
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);
116 const passiveParticle&
p = iter();
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 procPositions[proci].append
145 completeParticlei ++;
146 procParticlei[proci] ++;
150 forAll(procPositions, proci)
152 IOPosition<passiveParticleCloud>(procPositions[proci]).write();
169 #define DO_LAGRANGIAN_FIELDS_TYPE(Type, nullArg) \
171 || !objects.lookupClass(IOField<Type>::typeName).empty() \
172 || !objects.lookupClass(IOField<Field<Type>>::typeName).empty() \
173 || !objects.lookupClass(CompactIOField<Field<Type>>::typeName).empty();
174 DO_LAGRANGIAN_FIELDS_TYPE(
label, )
176 #undef DO_LAGRANGIAN_FIELDS_TYPE
#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.
~lagrangianFieldDecomposer()
Destructor.
static bool decomposes(const IOobjectList &objects)
Return whether anything in the object list gets decomposed.
lagrangianFieldDecomposer(const fvMesh &completeMesh, const PtrList< fvMesh > &procMeshes, const labelListList &faceProcAddressing, const labelListList &cellProcAddressing, const word &cloudName)
Construct from components.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
List< labelList > labelListList
A List of labelList.
dimensioned< scalar > mag(const dimensioned< Type > &)
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
const word cloudName(propsDict.lookup("cloudName"))