37 void Foam::mapDistribute::applyDummyTransforms(List<T>&
field)
const 39 forAll(transformElements_, trafoI)
41 const labelList& elems = transformElements_[trafoI];
43 label
n = transformStart_[trafoI];
54 void Foam::mapDistribute::applyDummyInverseTransforms(List<T>&
field)
const 56 forAll(transformElements_, trafoI)
58 const labelList& elems = transformElements_[trafoI];
59 label
n = transformStart_[trafoI];
69 template<
class T,
class TransformOp>
70 void Foam::mapDistribute::applyTransforms
72 const globalIndexAndTransform& globalTransforms,
74 const TransformOp& top
77 const List<vectorTensorTransform>& totalTransform =
78 globalTransforms.transformPermutations();
80 forAll(totalTransform, trafoI)
82 const vectorTensorTransform& vt = totalTransform[trafoI];
83 const labelList& elems = transformElements_[trafoI];
84 label
n = transformStart_[trafoI];
87 List<T> transformFld(UIndirectList<T>(
field, elems));
88 top(vt,
true, transformFld);
93 field[
n++] = transformFld[i];
99 template<
class T,
class TransformOp>
100 void Foam::mapDistribute::applyInverseTransforms
102 const globalIndexAndTransform& globalTransforms,
104 const TransformOp& top
107 const List<vectorTensorTransform>& totalTransform =
108 globalTransforms.transformPermutations();
110 forAll(totalTransform, trafoI)
112 const vectorTensorTransform& vt = totalTransform[trafoI];
113 const labelList& elems = transformElements_[trafoI];
114 label
n = transformStart_[trafoI];
117 List<T> transformFld(SubList<T>(
field, elems.size(),
n));
118 top(vt,
false, transformFld);
123 field[elems[i]] = transformFld[i];
129 template<
class T,
class NegateOp>
133 const NegateOp& negOp,
134 const bool dummyTransform,
143 applyDummyTransforms(
fld);
181 const label constructSize,
189 applyDummyInverseTransforms(
fld);
199 const label constructSize,
208 applyDummyInverseTransforms(
fld);
215 template<
class T,
class TransformOp>
220 const TransformOp& top,
225 distribute(
fld,
false, tag);
228 applyTransforms(git,
fld, top);
232 template<
class T,
class TransformOp>
236 const label constructSize,
238 const TransformOp& top,
245 applyInverseTransforms(git,
fld, top);
248 reverseDistribute(constructSize,
fld,
false, tag);
252 template<
class T,
class TransformOp>
256 const label constructSize,
259 const TransformOp& top,
266 applyInverseTransforms(git,
fld, top);
269 reverseDistribute(constructSize, nullValue,
fld,
false, tag);
void size(const label n)
Older name for setAddressableSize.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
void reverseDistribute(const label constructSize, List< T > &values, const int tag=UPstream::msgType()) const
Reverse distribute data using default commsType and the default flip/negate operator.
void reverseDistribute(const label constructSize, List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Reverse distribute data using default commsType.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
static void distribute(const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &field, const NegateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Distribute data with specified negate operator (for flips).
List< label > labelList
A List of labels.
Functor to negate primitives. Dummy for most other types.