30template<
class Container,
class Type>
40 n += bfld[patchi].size();
44 auto& result = tresult.ref();
49 const auto& pfld = bfld[patchi];
58template<
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];
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();
129template<
class VolField,
class TransformOp>
133 const TransformOp& top
140 typename VolField::Boundary,
141 typename VolField::value_type
151 mesh_.globalData().globalTransforms(),
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))
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
static FOAM_NO_DANGLING_REFERENCE const wallDistAddressing & New(const fvMesh &mesh, Args &&... args)
A non-owning sub-view of a List (allocated or unallocated storage).
A class for managing temporary objects.
labelList transformedPatchStarts_
labelList untransformedPatchStarts_
Start of patches. Start of untransformedPatchStarts_[0] is end.
void extract(const Field< typename VolField::value_type > &patchFld, VolField &fld) const
Take collected/distributed patch field and fill volField.
const VolField & map(VolField &fld, const TransformOp &top=mapDistribute::transform()) const
Map nearest-patch information. Take wall patch values.
labelList untransformedSlots_
Corresponding slot in mapPtr distribution result.
autoPtr< mapDistribute > mapPtr_
Map to pull wall face info to cell or boundary face.
labelList transformedSlots_
labelList untransformedItems_
Indices of cells followed by boundary faces.
tmp< Field< Type > > collectPatchFields(const Container &bfld) const
Collect patchFields from patchIDs into straight list.
const labelList patchIDs_
Set of patch IDs.
labelList transformedItems_
static List< T > extract(const word &key, const UPtrList< entry > &entries, const T &initValue)
#define forAll(list, i)
Loop across all elements in list.