37void Foam::mapDistribute::applyDummyTransforms(List<T>&
field)
const
39 forAll(transformElements_, trafoI)
41 const labelList& elems = transformElements_[trafoI];
43 label
n = transformStart_[trafoI];
54void Foam::mapDistribute::applyDummyInverseTransforms(List<T>&
field)
const
56 forAll(transformElements_, trafoI)
58 const labelList& elems = transformElements_[trafoI];
59 label
n = transformStart_[trafoI];
69template<
class T,
class TransformOp>
70void 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];
99template<
class T,
class TransformOp>
100void 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];
129template<
class T,
class NegateOp>
133 const NegateOp& negOp,
138 mapDistributeBase::distribute(
fld, negOp, tag);
143 applyDummyTransforms(
fld);
181 const label constructSize,
189 applyDummyInverseTransforms(
fld);
199 const label constructSize,
208 applyDummyInverseTransforms(
fld);
215template<
class T,
class TransformOp>
220 const TransformOp& top,
225 distribute(
fld,
false, tag);
228 applyTransforms(git,
fld, top);
232template<
class T,
class TransformOp>
236 const label constructSize,
238 const TransformOp& top,
245 applyInverseTransforms(git,
fld, top);
248 reverseDistribute(constructSize,
fld,
false, tag);
252template<
class T,
class TransformOp>
256 const label constructSize,
259 const TransformOp& top,
266 applyInverseTransforms(git,
fld, top);
269 reverseDistribute(constructSize, nullValue,
fld,
false, tag);
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label n)
Older name for setAddressableSize.
void reverseDistribute(const label constructSize, List< T > &values, const int tag=UPstream::msgType()) const
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 distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
List< label > labelList
A List of labels.
#define forAll(list, i)
Loop across all elements in list.
Functor to negate primitives. Dummy for most other types.