OpenFOAM-dev / data /src /generic /genericFvFields /genericPointPatchField /genericPointPatchField.C
Download data/src/generic/genericFvFields/genericPointPatchField/genericPointPatchField.C from introvoyz042/OpenFOAM-dev: direct link, hf CLI and curl.
- Browser
- Download file 11.7 kB
-
https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/src/generic/genericFvFields/genericPointPatchField/genericPointPatchField.C
- Command line
-
hf download hf://datasets/introvoyz042/OpenFOAM-dev/data/src/generic/genericFvFields/genericPointPatchField/genericPointPatchField.C
-
curl -L -o genericPointPatchField.C https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/src/generic/genericFvFields/genericPointPatchField/genericPointPatchField.C
11.7 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/>. | |
| \*---------------------------------------------------------------------------*/ | |
| // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // | |
| template<class Type> | |
| Foam::genericPointPatchField<Type>::genericPointPatchField | |
| ( | |
| const pointPatch& p, | |
| const DimensionedField<Type, pointMesh>& iF, | |
| const dictionary& dict | |
| ) | |
| : | |
| genericFieldBase(dict.lookup("type")), | |
| calculatedPointPatchField<Type>(p, iF, dict), | |
| dict_(dict) | |
| { | |
| forAllConstIter(dictionary, dict_, iter) | |
| { | |
| if (iter().keyword() != "type") | |
| { | |
| if | |
| ( | |
| iter().isStream() | |
| && iter().stream().size() | |
| ) | |
| { | |
| ITstream& is = iter().stream(); | |
| // Read first token | |
| token firstToken(is); | |
| if | |
| ( | |
| firstToken.isWord() | |
| && firstToken.wordToken() == "nonuniform" | |
| ) | |
| { | |
| token fieldToken(is); | |
| if (!fieldToken.isCompound()) | |
| { | |
| if | |
| ( | |
| fieldToken.isLabel() | |
| && fieldToken.labelToken() == 0 | |
| ) | |
| { | |
| scalarFields_.insert | |
| ( | |
| iter().keyword(), | |
| new scalarField(0) | |
| ); | |
| } | |
| else | |
| { | |
| FatalIOErrorInFunction(dict) | |
| << "\n token following 'nonuniform' " | |
| "is not a compound" | |
| << "\n on patch " << this->patch().name() | |
| << " of field " | |
| << this->internalField().name() | |
| << " in file " | |
| << this->internalField().objectPath() | |
| << exit(FatalIOError); | |
| } | |
| } | |
| FOR_ALL_FIELD_TYPES(ReadTypeField) | |
| } | |
| } | |
| } | |
| } | |
| } | |
| template<class Type> | |
| Foam::genericPointPatchField<Type>::genericPointPatchField | |
| ( | |
| const genericPointPatchField<Type>& ptf, | |
| const pointPatch& p, | |
| const DimensionedField<Type, pointMesh>& iF, | |
| const fieldMapper& mapper | |
| ) | |
| : | |
| genericFieldBase(ptf), | |
| calculatedPointPatchField<Type>(ptf, p, iF, mapper), | |
| dict_(ptf.dict_) | |
| { | |
| FOR_ALL_FIELD_TYPES(MapTypeFields); | |
| } | |
| template<class Type> | |
| Foam::genericPointPatchField<Type>::genericPointPatchField | |
| ( | |
| const genericPointPatchField<Type>& ptf, | |
| const DimensionedField<Type, pointMesh>& iF | |
| ) | |
| : | |
| genericFieldBase(ptf), | |
| calculatedPointPatchField<Type>(ptf, iF), | |
| dict_(ptf.dict_) | |
| FOR_ALL_FIELD_TYPES(CopyTypeFields) | |
| {} | |
| // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // | |
| template<class Type> | |
| void Foam::genericPointPatchField<Type>::map | |
| ( | |
| const pointPatchField<Type>& ptf, | |
| const fieldMapper& mapper | |
| ) | |
| { | |
| const genericPointPatchField<Type>& dptf = | |
| refCast<const genericPointPatchField<Type>>(ptf); | |
| FOR_ALL_FIELD_TYPES(MapTypeFields); | |
| } | |
| template<class Type> | |
| void Foam::genericPointPatchField<Type>::reset | |
| ( | |
| const pointPatchField<Type>& ptf | |
| ) | |
| { | |
| const genericPointPatchField<Type>& dptf = | |
| refCast<const genericPointPatchField<Type>>(ptf); | |
| FOR_ALL_FIELD_TYPES(ResetTypeFields); | |
| } | |
| template<class Type> | |
| void Foam::genericPointPatchField<Type>::write(Ostream& os) const | |
| { | |
| writeEntry(os, "type", actualTypeName()); | |
| forAllConstIter(dictionary, dict_, iter) | |
| { | |
| if (iter().keyword() != "type") | |
| { | |
| if | |
| ( | |
| iter().isStream() | |
| && iter().stream().size() | |
| && iter().stream()[0].isWord() | |
| && iter().stream()[0].wordToken() == "nonuniform" | |
| ) | |
| { | |
| if (false) {} FOR_ALL_FIELD_TYPES(WriteTypeFieldEntry) | |
| } | |
| else | |
| { | |
| iter().write(os); | |
| } | |
| } | |
| } | |
| } | |
| // ************************************************************************* // | |