33 const fvMesh& completeFvMesh,
37 const word& LagrangianName
40 completeMesh_(completeFvMesh, LagrangianName),
41 procMeshes_(procFvMeshes.size()),
42 particleProcAddressing_(procFvMeshes.size())
61 forAll(cellProcAddressing, proci)
63 forAll(cellProcAddressing[proci], procCelli)
65 completeCellProcCell[cellProcAddressing[proci][procCelli]] =
73 forAll(faceProcAddressing, proci)
75 forAll(faceProcAddressing[proci], procFacei)
77 const bool owner = faceProcAddressing[proci][procFacei] > 0;
78 const label completeFacei =
79 mag(faceProcAddressing[proci][procFacei]) - 1;
83 ? completeFaceOwnerProcFace
84 : completeFaceNeighbourProcFace
85 )[completeFacei] =
remote(proci, procFacei);
90 labelList procMeshSizes(procMeshes_.size(), 0);
94 completeCellProcCell[completeMesh_.
celli()[i]].proci;
96 procMeshSizes[proci] ++;
100 forAll(procMeshes_, proci)
102 particleProcAddressing_[proci].
resize(procMeshSizes[proci], -1);
110 forAll(procMeshes_, proci)
113 procCellIndices.
set(proci,
new labelField(procMeshSizes[proci]));
114 procFaceIndices.
set(proci,
new labelField(procMeshSizes[proci]));
115 procFaceTriIndices.
set(proci,
new labelField(procMeshSizes[proci]));
124 const label completeCelli = completeMesh_.
celli()[i];
125 const label completeFacei = completeMesh_.
facei()[i];
127 const label proci = completeCellProcCell[completeCelli].proci;
128 const label procCelli = completeCellProcCell[completeCelli].elementi;
129 const label procFacei =
130 completeFaceOwnerProcFace[completeFacei].proci == proci
131 ? completeFaceOwnerProcFace[completeFacei].elementi
132 : completeFaceNeighbourProcFace[completeFacei].elementi;
134 particleProcAddressing_[proci][procIs[proci]] = i;
136 procCoordinates[proci][procIs[proci]] = completeMesh_.
coordinates()[i];
137 procCellIndices[proci][procIs[proci]] = procCelli;
138 procFaceIndices[proci][procIs[proci]] = procFacei;
139 procFaceTriIndices[proci][procIs[proci]] = completeMesh_.
faceTrii()[i];
143 if (faceProcAddressing[proci][procFacei] < 0)
145 const label completeFaceSize = completeFaces[completeFacei].
size();
147 procFaceTriIndices[proci][procIs[proci]] =
148 completeFaceSize - 1 - procFaceTriIndices[proci][procIs[proci]];
155 forAll(procMeshes_, proci)
157 procMeshes_[proci].inject
159 procCoordinates[proci],
160 procCellIndices[proci],
161 procFaceIndices[proci],
162 procFaceTriIndices[proci]
185 forAll(procMeshes_, proci)
187 procMeshes_[proci].write();
192 bool Foam::LagrangianFieldDecomposer::decomposes
199 #define DECOMPOSES_LAGRANGIAN_FIELDS_TYPE(Type, nullArg) \
202 || decomposes<LagrangianField<Type>>(objects) \
203 || decomposes<LagrangianDynamicField<Type>>(objects) \
204 || decomposes<LagrangianInternalField<Type>>(objects) \
205 || decomposes<LagrangianInternalDynamicField<Type>>(objects);
208 #undef DECOMPOSES_LAGRANGIAN_FIELDS_TYPE
#define DECOMPOSES_LAGRANGIAN_FIELDS_TYPE(Type, nullArg)
#define forAll(list, i)
Loop across all elements in list.
List of IOobjects with searching and retrieving facilities.
void decomposePositions() const
Write the decomposed positions.
LagrangianFieldDecomposer(const fvMesh &completeFvMesh, const PtrList< fvMesh > &procFvMeshes, const labelListList &faceProcAddressing, const labelListList &cellProcAddressing, const word &LagrangianName)
Construct from components.
~LagrangianFieldDecomposer()
Destructor.
const PtrList< LagrangianMesh > & procMeshes() const
Access the decomposed meshes.
Class containing Lagrangian geometry and topology.
const labelIODynamicField & faceTrii() const
Access the face-tet indices.
const polyMesh & mesh() const
Access the mesh.
const labelIODynamicField & celli() const
Access the cell indices.
const barycentricIODynamicField & coordinates() const
Access the coordinates.
const labelIODynamicField & facei() const
Access the cell-face indices.
void resize(const label)
Alias for setSize(const label)
void size(const label)
Override size to be inconsistent with allocated storage.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
Mesh data needed to do the Finite Volume discretisation.
virtual const faceList & faces() const
Return raw faces.
Struct for keeping processor, element (cell, face, point) index.
A class for handling words, derived from string.
Field< barycentric > barycentricField
Barycentric field.
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)
Field< label > labelField
Specialisation of Field<T> for label.
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)