31 GeometricField<Type, fvPatchField, volMesh>&
fld,
32 const List<List<Type>>& values
37 auto& vfbf =
fld.boundaryFieldRef();
42 const auto& finalAgglom = coarseMesh.patchFaceAgglomeration();
46 const labelList& agglom = finalAgglom[patchi];
48 if (agglom.empty())
continue;
50 label nAgglom =
max(agglom) + 1;
53 coarseMesh.patchFaceMap()[patchi];
57 const label coarseFacei = coarsePatchFace[i];
58 const labelList& fineFaces = coarseToFine[coarseFacei];
59 const Type sumValues =
sum(values[compacti]);
61 for (
const label fineFacei : fineFaces)
63 vfbf[patchi][fineFacei] = sumValues;
75 auto& vfp = vfbf[patchi];
79 vfi =
sum(values[compacti++]);
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))
autoPtr< singleCellFvMesh > agglomMeshPtr_
Agglomerated mesh representation.
void interpolate(GeometricField< Type, fvPatchField, volMesh > &fld, const List< List< Type > > &values) const
Interpolate field.
labelList patchIDs_
List of participating patch IDs.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
#define forAll(list, i)
Loop across all elements in list.