Download data/src/OpenFOAM/fields/Field/SubField.C from introvoyz042/OpenFOAM-dev: direct link, hf CLI and curl.
- Browser
- Download file 6.3 kB
-
https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/src/OpenFOAM/fields/Field/SubField.C
- Command line
-
hf download hf://datasets/introvoyz042/OpenFOAM-dev/data/src/OpenFOAM/fields/Field/SubField.C
-
curl -L -o SubField.C https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/src/OpenFOAM/fields/Field/SubField.C
6.3 kB
| /*---------------------------------------------------------------------------*\ | |
| ========= | | |
| \\ / 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 <http://www.gnu.org/licenses/>. | |
| \*---------------------------------------------------------------------------*/ | |
| // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // | |
| template<class Type> | |
| inline Foam::SubField<Type>::SubField | |
| ( | |
| const SubList<Type>& list | |
| ) | |
| : | |
| SubList<Type>(list) | |
| {} | |
| template<class Type> | |
| inline Foam::SubField<Type>::SubField | |
| ( | |
| const UList<Type>& list | |
| ) | |
| : | |
| SubList<Type>(list, list.size()) | |
| {} | |
| template<class Type> | |
| inline Foam::SubField<Type>::SubField | |
| ( | |
| const UList<Type>& list, | |
| const label subSize | |
| ) | |
| : | |
| SubList<Type>(list, subSize) | |
| {} | |
| template<class Type> | |
| inline Foam::SubField<Type>::SubField | |
| ( | |
| const UList<Type>& list, | |
| const label subSize, | |
| const label startIndex | |
| ) | |
| : | |
| SubList<Type>(list, subSize, startIndex) | |
| {} | |
| template<class Type> | |
| inline Foam::SubField<Type>::SubField | |
| ( | |
| const SubField<Type>& sfield | |
| ) | |
| : | |
| tmp<SubField<Type>>::refCount(), | |
| SubList<Type>(sfield) | |
| {} | |
| template<class Type> | |
| inline Foam::SubField<Type>::SubField | |
| ( | |
| SubField<Type>& sfield, | |
| bool reuse | |
| ) | |
| : | |
| tmp<SubField<Type>>::refCount(), | |
| SubList<Type>(sfield) | |
| {} | |
| // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // | |
| template<class Type> | |
| inline Foam::tmp<Foam::Field<typename Foam::SubField<Type>::cmptType>> | |
| Foam::SubField<Type>::component | |
| ( | |
| const direction d | |
| ) const | |
| { | |
| return (reinterpret_cast<const Field<Type>&>(*this)).component(d); | |
| } | |
| template<class Type> | |
| inline Foam::tmp<Foam::Field<Type>> Foam::SubField<Type>::T() const | |
| { | |
| return (reinterpret_cast<const Field<Type>&>(*this)).T(); | |
| } | |
| // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // | |
| template<class Type> | |
| inline void Foam::SubField<Type>::operator=(const SubField<Type>& rhs) | |
| { | |
| SubList<Type>::operator=(rhs); | |
| } | |
| template<class Type> | |
| inline void Foam::SubField<Type>::operator=(const UList<Type>& rhs) | |
| { | |
| SubList<Type>::operator=(rhs); | |
| } | |
| template<class Type> | |
| inline void Foam::SubField<Type>::operator=(const tmp<Field<Type>>& rhs) | |
| { | |
| SubList<Type>::operator=(rhs()); | |
| } | |
| template<class Type> | |
| inline void Foam::SubField<Type>::operator=(const Type& rhs) | |
| { | |
| SubList<Type>::operator=(rhs); | |
| } | |
| template<class Type> | |
| inline void Foam::SubField<Type>::operator=(const zero) | |
| { | |
| SubList<Type>::operator=(Zero); | |
| } | |
| template<class Type> | |
| template<class Expression, class> | |
| void Foam::SubField<Type>::operator=(const Expression& e) | |
| { | |
| expression::assertSameAllContainerProperty<expression::Size> | |
| ( | |
| *this, | |
| e | |
| ); | |
| std::copy(expression::begin(e), expression::end(e), this->begin()); | |
| } | |
| COMPUTED_ASSIGNMENT(Type, +=) | |
| COMPUTED_ASSIGNMENT(Type, -=) | |
| COMPUTED_ASSIGNMENT(scalar, *=) | |
| COMPUTED_ASSIGNMENT(scalar, /=) | |
| template<class Type> | |
| template<class Form, Foam::direction Ncmpts> | |
| inline void Foam::SubField<Type>::operator= | |
| ( | |
| const VectorSpace<Form, Type, Ncmpts>& rhs | |
| ) | |
| { | |
| forAll(rhs, i) | |
| { | |
| this->operator[](i) = rhs[i]; | |
| } | |
| } | |
| // ************************************************************************* // | |