/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . Class Foam::SubField Description SubField is a Field obtained as a section of another Field. Thus it is itself unallocated so that no storage is allocated or deallocated during its use. To achieve this behaviour, SubField is derived from a SubList rather than a List. SourceFiles SubFieldI.H \*---------------------------------------------------------------------------*/ #ifndef SubField_H #define SubField_H #include "SubList.H" #include "Field.H" #include "VectorSpace.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { //- Pre-declare SubField and related Field type template class Field; template class SubField; /*---------------------------------------------------------------------------*\ Class SubField Declaration \*---------------------------------------------------------------------------*/ template class SubField : public tmp>::refCount, public SubList { public: //- Component type typedef typename pTraits::cmptType cmptType; // Constructors //- Construct from a SubList SubField(const SubList&); //- Construct from a UList\, using the entire size explicit SubField(const UList&); //- Construct from a UList\ with a given size SubField(const UList& list, const label subSize); //- Construct from a UList\ with a given size and start index SubField ( const UList& list, const label subSize, const label startIndex ); //- Copy constructor SubField(const SubField&); //- Copy constructor or reuse as specified SubField(SubField&, bool reuse); // Static Member Functions //- Return a null SubField static inline const SubField& null() { return NullObjectRef>(); } // Member Functions //- Return a component field of the field tmp> component(const direction) const; //- Return the field transpose (only defined for second rank tensors) tmp> T() const; // Member Operators void operator=(const SubField&); void operator=(const UList&); void operator=(const tmp>&); void operator=(const Type&); void operator=(const zero); template void operator=(const VectorSpace&); //- Assign to an expression template> void operator=(const Expression& e); void operator+=(const UList&); void operator+=(const tmp>&); void operator-=(const UList&); void operator-=(const tmp>&); void operator*=(const UList&); void operator*=(const tmp>&); void operator/=(const UList&); void operator/=(const tmp>&); void operator+=(const Type&); void operator-=(const Type&); void operator*=(const scalar&); void operator/=(const scalar&); //- Allow cast to a const Field\& inline operator const Field&() const { return *reinterpret_cast*>(this); } }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "SubFieldExpression.H" #ifdef NoRepository #include "SubField.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //