48 const labelPair& patchAndFace = patchFaces[i];
50 if (patchAndFace.
first() >= 0)
52 result[i] = bfld[patchAndFace];
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)
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];
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];
283 for (
const label patchi :
patches)
285 patchFields.
set(patchi, bfld[patchi].patchInternalField());
288 mapToSurface(patchFields, result);
295 const GeometricBoundaryField<Type, fvPatchField, volMesh>& bfld
298 auto tresult = tmp<Field<Type>>
::New(mesh_.nFaces(),
Zero);
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];
383 const label destPatchi
396 const label destPatchi
408 const label destPatchi
420 const label destPatchi
423 mapToVolume(taf().internalField(), dest, 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)
470 const label destPatchi
483 const label destPatchi
486 mapToVolumePatch(taf().internalField(), dest, destPatchi);
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Generic GeometricBoundaryField class.
Generic GeometricField class.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const T & first() const noexcept
Access the first element.
const T & second() const noexcept
Access the second element.
A list of pointers to objects of type <T>, with 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,...
void resize(const label newLen)
Adjust size of PtrList.
A HashTable of pointers to objects of type <T> with a label key.
T & first()
Access first element of the list, position [0].
bool get(const label i) const
Return bool value at specified position, always false for out-of-range access.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
A class for managing temporary objects.
void mapInternalToSurface(const GeometricBoundaryField< Type, fvPatchField, volMesh > &, Field< Type > &result) const
Map patch internal field to area field.
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.
void mapToVolumePatch(const DimensionedField< Type, areaMesh > &af, Field< Type > &dest, const label destPatchi) const
Map area field to a volume boundary patch.
void mapToSurface(const GeometricBoundaryField< Type, fvPatchField, volMesh > &, Field< Type > &result) const
Map volume boundary fields as area field.
const polyBoundaryMesh & patches
Pair< label > labelPair
A pair of labels.
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.
List< label > labelList
A List of labels.
static constexpr const zero Zero
Global zero (0).
vsm mapToVolume(Cs, Cvf.boundaryFieldRef())
#define forAll(list, i)
Loop across all elements in list.