47 flatFld[celli] =
fld[celli];
58 flatFld[nCompact++] = pfld[i];
66 stencilFld.setSize(stencil.
size());
70 const labelList& compactCells = stencil[facei];
76 stencilFld[facei][i] = flatFld[compactCells[i]];
83Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>>
96 collectData(map, stencil,
fld, stencilFld);
117 const List<Type>& stField = stencilFld[celli];
122 sf[celli] += stField[i]*stWeight[i];
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 GeometricField class.
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(label n)
Alias for resize().
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
void size(const label n)
Older name for setAddressableSize.
Generic dimensioned Type class.
static void collectData(const mapDistribute &map, const labelListList &stencil, const GeometricField< T, fvsPatchField, surfaceMesh > &fld, List< List< T > > &stencilFld)
Use map to get the data into stencil order.
static tmp< GeometricField< Type, fvPatchField, volMesh > > weightedSum(const mapDistribute &map, const labelListList &stencil, const GeometricField< Type, fvsPatchField, surfaceMesh > &fld, const List< List< scalar > > &stencilWeights)
Sum surface field contributions to create cell values.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
label start() const noexcept
The patch start within the polyMesh face list.
const fvPatch & patch() const noexcept
Return the patch.
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
label constructSize() const noexcept
Constructed data size.
Class containing processor-to-processor mapping information.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute List data using default commsType, default flip/negate operator.
A class for managing temporary objects.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
static constexpr const zero Zero
Global zero (0).
#define forAll(list, i)
Loop across all elements in list.