Download data/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C from introvoyz042/OpenFOAM-dev: direct link, hf CLI and curl.
- Browser
- Download file 4.45 kB
-
https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C
- Command line
-
hf download hf://datasets/introvoyz042/OpenFOAM-dev/data/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C
-
curl -L -o timeControlFunctionObject.C https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C
4.45 kB
| /*---------------------------------------------------------------------------*\ | |
| ========= | | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | |
| \\ / O peration | Website: https://openfoam.org | |
| \\ / A nd | Copyright (C) 2016-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 * * * * * * * * * * * * * // | |
| namespace Foam | |
| { | |
| namespace functionObjects | |
| { | |
| defineTypeNameAndDebug(timeControl, 0); | |
| } | |
| } | |
| // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // | |
| bool Foam::functionObjects::timeControl::active() const | |
| { | |
| return executeControl_.active() || writeControl_.active(); | |
| } | |
| // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // | |
| Foam::functionObjects::timeControl::timeControl | |
| ( | |
| const word& name, | |
| const Time& t, | |
| const dictionary& dict | |
| ) | |
| : | |
| functionObject(name, t), | |
| time_(t), | |
| executeControl_(t, dict, "execute"), | |
| writeControl_(t, dict, "write"), | |
| foPtr_(functionObject::New(name, t, dict)) | |
| { | |
| writeControl_.read(dict); | |
| executeControl_.read(dict); | |
| // If we are *not* executing at the start then we need to explicitly call | |
| // the controls' execute methods to ensure that internal state is correctly | |
| // advanced past the initial time instant. If we *are* executing at the | |
| // start then we don't need to do this as it will happen naturally as part | |
| // of the function object's execute and write hooks. | |
| if (!foPtr_->executeAtStart()) | |
| { | |
| executeControl_.execute(); | |
| writeControl_.execute(); | |
| } | |
| } | |
| // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // | |
| Foam::wordList Foam::functionObjects::timeControl::fields() const | |
| { | |
| return foPtr_->fields(); | |
| } | |
| bool Foam::functionObjects::timeControl::executeAtStart() const | |
| { | |
| return foPtr_->executeAtStart(); | |
| } | |
| bool Foam::functionObjects::timeControl::execute() | |
| { | |
| if (executeControl_.active() && (postProcess || executeControl_.execute())) | |
| { | |
| foPtr_->execute(); | |
| } | |
| return true; | |
| } | |
| bool Foam::functionObjects::timeControl::write() | |
| { | |
| if (writeControl_.active() && (postProcess || writeControl_.execute())) | |
| { | |
| foPtr_->write(); | |
| } | |
| return true; | |
| } | |
| bool Foam::functionObjects::timeControl::end() | |
| { | |
| if (executeControl_.execute() || writeControl_.execute()) | |
| { | |
| foPtr_->end(); | |
| } | |
| return true; | |
| } | |
| Foam::scalar Foam::functionObjects::timeControl::timeToNextAction() | |
| { | |
| return min | |
| ( | |
| executeControl_.timeToNextAction(), | |
| writeControl_.timeToNextAction() | |
| ); | |
| } | |
| bool Foam::functionObjects::timeControl::read(const dictionary& dict) | |
| { | |
| writeControl_.read(dict); | |
| executeControl_.read(dict); | |
| if (active()) | |
| { | |
| foPtr_->read(dict); | |
| } | |
| return true; | |
| } | |
| void Foam::functionObjects::timeControl::movePoints(const polyMesh& mesh) | |
| { | |
| foPtr_->movePoints(mesh); | |
| } | |
| void Foam::functionObjects::timeControl::topoChange | |
| ( | |
| const polyTopoChangeMap& map | |
| ) | |
| { | |
| foPtr_->topoChange(map); | |
| } | |
| void Foam::functionObjects::timeControl::mapMesh | |
| ( | |
| const polyMeshMap& map | |
| ) | |
| { | |
| foPtr_->mapMesh(map); | |
| } | |
| void Foam::functionObjects::timeControl::distribute | |
| ( | |
| const polyDistributionMap& map | |
| ) | |
| { | |
| foPtr_->distribute(map); | |
| } | |
| // ************************************************************************* // | |