48 const labelPair& patchAndFace = patchFaces[i];
50 if (patchAndFace.
first() >= 0)
52 result[i] = bfld[patchAndFace];
61 const GeometricBoundaryField<Type, fvPatchField, volMesh>& bfld
64 auto tresult = tmp<Field<Type>>
::New(mesh_.nFaces(),
Zero);
65 mapToSurface(bfld, tresult.ref());
88 mapToSurface(tvf().boundaryField(), result);
122 const auto& bfld =
fld.boundaryField();
132 const labelPair& patchAndFace = patchFaces[i];
134 if (patchAndFace.
first() >= 0)
137 result[i] = bfld[patchAndFace];
139 else if (patchAndFace.
second() >= 0)
151 const GeometricField<Type, fvsPatchField, surfaceMesh>&
fld 154 auto tresult = tmp<Field<Type>>
::New(mesh_.nFaces(),
Zero);
155 mapToSurface(
fld, tresult.ref());
167 mapToSurface(tsf(), result);
199 const label patchi = patchFaces[i].
first();
200 const label facei = patchFaces[i].second();
202 const auto* pfld = patchFields.
get(patchi);
206 result[i] = (*pfld)[facei];
215 const PtrMap<Field<Type>>& patchFields,
220 const List<labelPair>& patchFaces = mesh_.whichPatchFaces();
227 const label patchi = patchFaces[i].first();
228 const label facei = patchFaces[i].second();
230 const auto* pfld = patchFields.get(patchi);
234 result[i] = (*pfld)[facei];
243 const UPtrList<Field<Type>>& patchFields
246 auto tresult = tmp<Field<Type>>
::New(mesh_.nFaces(),
Zero);
247 mapToSurface(patchFields, tresult.ref());
259 mapToSurface(patchFields, tresult.ref());
283 for (
const label patchi :
patches)
285 patchFields.
set(patchi, bfld[patchi].patchInternalField());
288 mapToSurface(patchFields, result);
300 mapInternalToSurface(bfld, tresult.ref());
324 mapInternalToSurface(tvf().boundaryField(), result);
356 const label destPatchi
364 const labelPair& patchAndFace = patchFaces[i];
368 patchAndFace.
first() >= 0
369 && (patchAndFace.
first() == destPatchi || destPatchi < 0)
372 dest[patchAndFace] = af[i];
381 const tmp<DimensionedField<Type, areaMesh>>& taf,
382 GeometricBoundaryField<Type, fvPatchField, volMesh>& dest,
383 const label destPatchi
396 const label destPatchi
408 const label destPatchi
420 const label destPatchi
433 const label destPatchi
446 const label destPatchi
454 const label patchi = patchFaces[i].
first();
455 const label facei = patchFaces[i].second();
457 if (patchi >= 0 && patchi == destPatchi)
468 const tmp<DimensionedField<Type, areaMesh>>& taf,
470 const label destPatchi
473 mapToVolumePatch(taf(), dest, destPatchi);
483 const label destPatchi
486 mapToVolumePatch(taf().internalField(), dest, destPatchi);
void mapToSurface(const GeometricBoundaryField< Type, fvPatchField, volMesh > &, Field< Type > &result) const
Map volume boundary fields as area field.
const T & first() const noexcept
Access the first element.
T & last()
Return reference to the last element of the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
T & first()
Access first element of the list, position [0].
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type get(const label i) const
Return bool value at specified position, always false for out-of-range access.
A HashTable of pointers to objects of type <T> with a label key.
Generic GeometricField class.
#define forAll(list, i)
Loop across all elements in list.
Generic templated field type.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
vsm mapToVolume(Cs, Cvf.boundaryFieldRef())
void resize(const label newLen)
Adjust size of PtrList.
Generic GeometricBoundaryField class.
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))
bool empty() const noexcept
True if the list is empty (ie, size() is zero)
void mapToVolume(const DimensionedField< Type, areaMesh > &, GeometricBoundaryField< Type, fvPatchField, volMesh > &dest, const label destPatchi=-1) const
Map area field to volume boundary field, optionally restricted to a single destination patch...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
void mapInternalToSurface(const GeometricBoundaryField< Type, fvPatchField, volMesh > &, Field< Type > &result) const
Map patch internal field to area field.
void mapToVolumePatch(const DimensionedField< Type, areaMesh > &af, Field< Type > &dest, const label destPatchi) const
Map area field to a volume boundary patch.
const polyBoundaryMesh & patches
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const List< labelPair > & whichPatchFaces() const
The polyPatch/local-face for each faceLabels()
A class for managing temporary objects.
const T & second() const noexcept
Access the second element.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
static constexpr const zero Zero
Global zero (0)