/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2020-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 . \*---------------------------------------------------------------------------*/ #include "CodedFunction1.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template const Foam::wordList Foam::Function1s::Coded::codeKeys ( {"code", "codeInclude"} ); template const Foam::wordList Foam::Function1s::Coded::codeDictVars ( {word::null, word::null} ); template const Foam::word Foam::Function1s::Coded::codeOptions ( "codedFunction1Options" ); template const Foam::wordList Foam::Function1s::Coded::compileFiles { "codedFunction1Template.C" }; template const Foam::wordList Foam::Function1s::Coded::copyFiles { "codedFunction1Template.H" }; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template Foam::Function1s::Coded::Coded ( const word& name, const Function1s::unitSets& units, const dictionary& dict ) : Function1(name), codedBase ( dict.lookup("name"), dict, codeKeys, codeDictVars, codeOptions, compileFiles, copyFiles ), units_(units) { // Set variable substitutions varSubstitutions().set ( { {"TemplateType", pTraits::typeName}, {"verbose", Foam::name(bool(debug))} } ); this->updateLibrary(dict); dictionary redirectDict(dict); redirectDict.set(codeName(), codeName()); redirectFunction1Ptr_ = Function1::New(codeName(), units::any, units::any, redirectDict); } template Foam::Function1s::Coded::Coded(const Coded& cf1) : Function1(cf1), codedBase(cf1), units_(cf1.units_), redirectFunction1Ptr_(cf1.redirectFunction1Ptr_, false) {} template Foam::tmp> Foam::Function1s::Coded::clone() const { return tmp>(new Coded(*this)); } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template Foam::Function1s::Coded::~Coded() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template Foam::tmp> Foam::Function1s::Coded::value ( const scalarField& x ) const { return units_.value.toStandard ( redirectFunction1Ptr_->value ( units_.x.toUser(tmp(x)) ) ); } template inline Type Foam::Function1s::Coded::derivative ( const scalar x ) const { NotImplemented; return pTraits::zero; } template Foam::tmp> Foam::Function1s::Coded::derivative ( const scalarField& x ) const { NotImplemented; return tmp>(); } template inline Type Foam::Function1s::Coded::integral ( const scalar x1, const scalar x2 ) const { NotImplemented; return pTraits::zero; } template Foam::tmp> Foam::Function1s::Coded::integral ( const scalarField& x1, const scalarField& x2 ) const { NotImplemented; return tmp>(); } template void Foam::Function1s::Coded::write ( Ostream& os, const unitSets& units ) const { codedBase::write(os); } // ************************************************************************* //