40#ifndef Foam_SubField_H
41#define Foam_SubField_H
97 const
UList<Type>& list,
104 const
UList<Type>& list,
114 const
UList<Type>& list,
123 const
UList<Type>& list
142 operator const
Foam::
Field<Type>&()
const
144 return *
reinterpret_cast<const Field<Type>*
>(
this);
160 template<
class Form, direction Ncmpts>
193 len = (this->size() - pos);
195 return SubField<Type>(*
this, len, pos);
205 len = (this->size() -
pos);
207 return SubField<Type>(*
this, len, pos);
215 return SubField<Type>(*
this,
range);
223 return SubField<Type>(*
this,
range);
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))
constexpr FieldBase() noexcept
Default construct.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
SubField< Type > slice(const label pos, label len=-1)
Return SubField slice (non-const access) - no range checking.
SubField is a Field obtained as a section of another Field, without its own allocation....
void operator*=(const scalar &s)
Multiply each entry by value.
void operator=(const SubField< Type > &)
Copy assign via UList operator. Takes linear time.
tmp< Field< Type > > T() const
Return the field transpose (only defined for second rank tensors).
SubField() noexcept=default
Default construct, zero-sized and nullptr.
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
pTraits< Type >::cmptType cmptType
Component type.
void operator-=(const Type &val)
Subtract value from each entry.
void operator+=(const Type &val)
Add value to each entry.
void operator/=(const scalar &s)
Divide each entry by value.
static const SubField< Type > & null() noexcept
Return a null SubField (reference to a nullObject). Behaves like an empty SubField.
SubList() noexcept=default
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A range or interval of labels defined by a start and a size.
A traits class, which is primarily used for primitives and vector-space.
A class for managing temporary objects.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
dimensionedScalar pos(const dimensionedScalar &ds)
const T & NullObjectRef() noexcept
Const reference (of type T) to the nullObject.
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
#define FOAM_DEPRECATED_STRICTER(since, replacement)