30 template<
class Container,
class Type>
40 n += bfld[patchi].size();
44 auto& result = tresult.ref();
49 const auto& pfld = bfld[patchi];
58 template<
class VolField>
61 const Field<typename VolField::value_type>& wallFld,
66 const label nUntrafoCells =
68 untransformedPatchStarts_.size()
69 ? untransformedPatchStarts_[0]
70 : untransformedItems_.size()
72 for (label i = 0; i < nUntrafoCells; i++)
74 const label celli = untransformedItems_[i];
75 const label sloti = untransformedSlots_[i];
76 fld[celli] = wallFld[sloti];
80 const label nTrafoCells =
82 transformedPatchStarts_.size()
83 ? transformedPatchStarts_[0]
84 : transformedItems_.size()
86 for (label i = 0; i < nTrafoCells; i++)
88 const label celli = transformedItems_[i];
89 const label sloti = transformedSlots_[i];
90 fld[celli] = wallFld[sloti];
96 const auto& pfld =
fld.boundaryField()[patchi];
97 Field<typename VolField::value_type> patchField(pfld.size());
100 const label start = untransformedPatchStarts_[patchi];
101 const label
end = untransformedPatchStarts_[patchi+1];
103 for (label i = start; i <
end; i++)
105 const label facei = untransformedItems_[i];
106 const label sloti = untransformedSlots_[i];
107 patchField[facei-pfld.patch().start()] = wallFld[sloti];
112 const label start = transformedPatchStarts_[patchi];
113 const label
end = transformedPatchStarts_[patchi+1];
115 for (label i = start; i <
end; i++)
117 const label facei = transformedItems_[i];
118 const label sloti = transformedSlots_[i];
119 patchField[facei-pfld.patch().start()] = wallFld[sloti];
123 fld.boundaryFieldRef()[patchi] = patchField;
125 fld.correctBoundaryConditions();
129 template<
class VolField,
class TransformOp>
133 const TransformOp& top
140 typename VolField::Boundary,
141 typename VolField::value_type
151 mesh_.globalData().globalTransforms(),
const labelList patchIDs_
Set of patch IDs.
static const wallDistAddressing & New(const fvMesh &mesh, Args &&... args)
Get existing or create MeshObject registered with typeName.
static List< T > extract(const word &key, const UPtrList< entry > &entries, const T &initValue)
#define forAll(list, i)
Loop across all elements in list.
void extract(const Field< typename VolField::value_type > &patchFld, VolField &fld) const
Take collected/distributed patch field and fill volField.
tmp< Field< Type > > collectPatchFields(const Container &bfld) const
Collect patchFields from patchIDs into straight list.
Generic templated field type.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
const VolField & map(VolField &fld, const TransformOp &top=mapDistribute::transform()) const
Map nearest-patch information. Take wall patch values.
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))
A class for managing temporary objects.