40 #ifndef Foam_SubField_H 41 #define Foam_SubField_H 52 template<
class Type>
class SubField;
76 return NullObjectRef<SubField<Type>>();
97 const
UList<Type>& list,
104 const
UList<Type>& list,
114 const
UList<Type>& list,
123 const
UList<Type>& list
139 inline operator const
Foam::
Field<Type>&() const;
142 inline
void operator=(const
SubField<Type>&);
145 inline
void operator=(const
Field<Type>&);
148 inline
void operator=(const Type& val);
151 inline
void operator=(const
Foam::
zero);
155 inline
void operator=(const
VectorSpace<Form, Type, Ncmpts>& rhs);
158 inline
void operator+=(const Type& val);
161 inline
void operator-=(const Type& val);
164 inline
void operator*=(const scalar&
s);
167 inline
void operator/=(const scalar&
s);
177 #include "SubFieldI.H" 189 return SubField<Type>(*
this, len,
pos);
201 return SubField<Type>(*
this, len,
pos);
209 return SubField<Type>(*
this,
range);
217 return SubField<Type>(*
this,
range);
tmp< Field< cmptType > > component(const direction) const
Return a component field of the field.
tmp< Field< Type > > T() const
Return the field transpose (only defined for second rank tensors)
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.
SubField is a Field obtained as a section of another Field, without its own allocation. SubField is derived from a SubList rather than a List.
static const SubField< Type > & null() noexcept
Return a null SubField (reference to a nullObject). Behaves like an empty SubField.
SubField() noexcept=default
Default construct, zero-sized and nullptr.
dimensionedScalar pos(const dimensionedScalar &ds)
A List obtained as a section of another List.
Generic templated field type.
pTraits< Type >::cmptType cmptType
Component type.
SubField< Type > slice(const label pos, label len=-1)
Return SubField slice (non-const access) - no range checking.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const noexcept
The number of elements in the container.
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;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
A class for managing temporary objects.
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))