OpenFOAM-dev / data /src /finiteVolume /fields /pointPatchFields /derived /codedFixedValue /codedFixedValuePointPatchField.C
Download data/src/finiteVolume/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.C from introvoyz042/OpenFOAM-dev: direct link, hf CLI and curl.
- Browser
- Download file 5.36 kB
-
https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/src/finiteVolume/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.C
- Command line
-
hf download hf://datasets/introvoyz042/OpenFOAM-dev/data/src/finiteVolume/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.C
-
curl -L -o codedFixedValuePointPatchField.C https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/src/finiteVolume/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.C
5.36 kB
| /*---------------------------------------------------------------------------*\ | |
| ========= | | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | |
| \\ / O peration | Website: https://openfoam.org | |
| \\ / A nd | Copyright (C) 2012-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/>. | |
| \*---------------------------------------------------------------------------*/ | |
| // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // | |
| template<class Type> | |
| const Foam::wordList Foam::codedFixedValuePointPatchField<Type>::codeKeys | |
| ( | |
| {"code", "codeInclude", "localCode"} | |
| ); | |
| template<class Type> | |
| const Foam::wordList Foam::codedFixedValuePointPatchField<Type>::codeDictVars | |
| ( | |
| {word::null, word::null, word::null} | |
| ); | |
| template<class Type> | |
| const Foam::word Foam::codedFixedValuePointPatchField<Type>::codeOptions | |
| ( | |
| "codedFixedValuePointPatchFieldOptions" | |
| ); | |
| template<class Type> | |
| const Foam::wordList Foam::codedFixedValuePointPatchField<Type>::compileFiles | |
| { | |
| "codedFixedValuePointPatchFieldTemplate.C" | |
| }; | |
| template<class Type> | |
| const Foam::wordList Foam::codedFixedValuePointPatchField<Type>::copyFiles | |
| { | |
| "codedFixedValuePointPatchFieldTemplate.H" | |
| }; | |
| // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // | |
| template<class Type> | |
| Foam::codedFixedValuePointPatchField<Type>::codedFixedValuePointPatchField | |
| ( | |
| const pointPatch& p, | |
| const DimensionedField<Type, pointMesh>& iF, | |
| const dictionary& dict | |
| ) | |
| : | |
| fixedValuePointPatchField<Type>(p, iF, dict), | |
| codedBase | |
| ( | |
| dict.lookup("name"), | |
| dict, | |
| codeKeys, | |
| codeDictVars, | |
| codeOptions, | |
| compileFiles, | |
| copyFiles | |
| ) | |
| { | |
| const word fieldType(pTraits<Type>::typeName); | |
| // Set variable substitutions | |
| varSubstitutions().set | |
| ( | |
| { | |
| {"TemplateType", fieldType}, | |
| {"FieldType", fieldType.capitalise() + "Field"}, | |
| {"verbose", Foam::name(bool(debug))} | |
| } | |
| ); | |
| // Compile the library containing user-defined pointPatchField | |
| updateLibrary(dict); | |
| } | |
| template<class Type> | |
| Foam::codedFixedValuePointPatchField<Type>::codedFixedValuePointPatchField | |
| ( | |
| const codedFixedValuePointPatchField<Type>& ptf, | |
| const pointPatch& p, | |
| const DimensionedField<Type, pointMesh>& iF, | |
| const fieldMapper& mapper | |
| ) | |
| : | |
| fixedValuePointPatchField<Type>(ptf, p, iF, mapper), | |
| codedBase(ptf) | |
| {} | |
| template<class Type> | |
| Foam::codedFixedValuePointPatchField<Type>::codedFixedValuePointPatchField | |
| ( | |
| const codedFixedValuePointPatchField<Type>& ptf, | |
| const DimensionedField<Type, pointMesh>& iF | |
| ) | |
| : | |
| fixedValuePointPatchField<Type>(ptf, iF), | |
| codedBase(ptf) | |
| {} | |
| // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // | |
| template<class Type> | |
| const Foam::pointPatchField<Type>& | |
| Foam::codedFixedValuePointPatchField<Type>::redirectPatchField() const | |
| { | |
| if (!redirectPatchFieldPtr_.valid()) | |
| { | |
| OStringStream os; | |
| writeEntry(os, "type", codeName()); | |
| writeEntry(os, "value", static_cast<const Field<Type>&>(*this)); | |
| IStringStream is(os.str()); | |
| dictionary dict(is); | |
| redirectPatchFieldPtr_.set | |
| ( | |
| pointPatchField<Type>::New | |
| ( | |
| this->patch(), | |
| this->internalField(), | |
| dict | |
| ).ptr() | |
| ); | |
| } | |
| return redirectPatchFieldPtr_(); | |
| } | |
| template<class Type> | |
| void Foam::codedFixedValuePointPatchField<Type>::updateCoeffs() | |
| { | |
| if (this->updated()) | |
| { | |
| return; | |
| } | |
| const pointPatchField<Type>& fvp = redirectPatchField(); | |
| const_cast<pointPatchField<Type>&>(fvp).updateCoeffs(); | |
| // Copy through value | |
| this->operator==(fvp); | |
| fixedValuePointPatchField<Type>::updateCoeffs(); | |
| } | |
| template<class Type> | |
| void Foam::codedFixedValuePointPatchField<Type>::evaluate | |
| ( | |
| const Pstream::commsTypes commsType | |
| ) | |
| { | |
| const pointPatchField<Type>& fvp = redirectPatchField(); | |
| const_cast<pointPatchField<Type>&>(fvp).evaluate(commsType); | |
| fixedValuePointPatchField<Type>::evaluate(commsType); | |
| } | |
| template<class Type> | |
| void Foam::codedFixedValuePointPatchField<Type>::write(Ostream& os) const | |
| { | |
| fixedValuePointPatchField<Type>::write(os); | |
| codedBase::write(os); | |
| } | |
| // ************************************************************************* // | |