38 template<
class Type,
class Stencil>
50 const GeometricField<Type, fvPatchField, volMesh>& vtf,
55 typedef GeometricField<GradType, fvPatchField, volMesh> GradFieldType;
57 const fvMesh&
mesh = vtf.mesh();
65 tmp<GradFieldType> tlsGrad
82 GradFieldType& lsGrad = tlsGrad.ref();
83 Field<GradType>& lsGradIf = lsGrad;
85 const extendedCentredCellToCellStencil& stencil = lsv.stencil();
86 const List<List<label>>& stencilAddr = stencil.stencil();
87 const List<List<vector>>& lsvs = lsv.vectors();
91 List<Type> flatVtf(stencil.map().constructSize(),
Zero);
96 flatVtf[celli] = vtf[celli];
100 forAll(vtf.boundaryField(), patchi)
102 const fvPatchField<Type>& ptf = vtf.boundaryField()[patchi];
106 -
mesh.nInternalFaces()
111 flatVtf[nCompact++] = ptf[i];
116 stencil.map().distribute(flatVtf);
120 forAll(stencilAddr, celli)
122 const labelList& compactCells = stencilAddr[celli];
123 const List<vector>& lsvc = lsvs[celli];
127 lsGradIf[celli] += lsvc[i]*flatVtf[compactCells[i]];
132 lsGrad.correctBoundaryConditions();
cellMask correctBoundaryConditions()
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.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
Generic GeometricField class.
#define forAll(list, i)
Loop across all elements in list.
Mesh data needed to do the Finite Volume discretisation.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
virtual tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > calcGrad(const GeometricField< Type, fvPatchField, volMesh > &vsf, const word &name) const
Return the gradient of the given field to the gradScheme::grad for optional caching.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
List< label > labelList
A List of labels.
A class for managing temporary objects.
const word extrapolatedCalculatedType
A combined zero-gradient and calculated patch field type.
static constexpr const zero Zero
Global zero (0)