OpenFOAM-dev / data /src /OpenFOAM /db /functionObjects /objectRegistryFunctionObject /objectRegistryFunctionObject.H
Download data/src/OpenFOAM/db/functionObjects/objectRegistryFunctionObject/objectRegistryFunctionObject.H from introvoyz042/OpenFOAM-dev: direct link, hf CLI and curl.
- Browser
- Download file 5.58 kB
-
https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/src/OpenFOAM/db/functionObjects/objectRegistryFunctionObject/objectRegistryFunctionObject.H
- Command line
-
hf download hf://datasets/introvoyz042/OpenFOAM-dev/data/src/OpenFOAM/db/functionObjects/objectRegistryFunctionObject/objectRegistryFunctionObject.H
-
curl -L -o objectRegistryFunctionObject.H https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/src/OpenFOAM/db/functionObjects/objectRegistryFunctionObject/objectRegistryFunctionObject.H
5.58 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/>. | |
| Class | |
| Foam::functionObjects::objectRegistryFunctionObject | |
| Description | |
| Specialisation of Foam::functionObject which holds a reference to an object | |
| registry. Provides a number of functions for caching and accessing objects | |
| from the registry. | |
| See also | |
| Foam::functionObject | |
| SourceFiles | |
| objectRegistryFunctionObject.C | |
| \*---------------------------------------------------------------------------*/ | |
| // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | |
| namespace Foam | |
| { | |
| // Forward declaration of classes | |
| class objectRegistry; | |
| namespace functionObjects | |
| { | |
| /*---------------------------------------------------------------------------*\ | |
| Class objectRegistryFunctionObject Declaration | |
| \*---------------------------------------------------------------------------*/ | |
| class objectRegistryFunctionObject | |
| : | |
| public functionObject | |
| { | |
| protected: | |
| // Protected Data | |
| //- Reference to the objectRegistry | |
| const objectRegistry& obr_; | |
| // Protected Member Functions | |
| //- Find field in the objectRegistry | |
| template<class ObjectType> | |
| bool foundObject(const word& fieldName) const; | |
| //- Prints a warning message that fieldName cannot be found | |
| template<class ObjectType> | |
| void cannotFindObject(const word& fieldName); | |
| //- Prints a warning message that fieldName cannot be found | |
| void cannotFindObject(const word& fieldName); | |
| //- Prints a warning message that fieldNames cannot be found | |
| void cannotFindObjects(const wordList& fieldNames); | |
| //- Lookup object from the objectRegistry | |
| template<class ObjectType> | |
| const ObjectType& lookupObject(const word& fieldName) const; | |
| //- Lookup non-const object reference from the objectRegistry | |
| template<class ObjectType> | |
| ObjectType& lookupObjectRef(const word& fieldName); | |
| //- Store the given field in the objectRegistry | |
| template<class ObjectType> | |
| ObjectType& store(const tmp<ObjectType>& tfield); | |
| //- Store the given field in the objectRegistry under the given name | |
| template<class ObjectType> | |
| ObjectType& store | |
| ( | |
| const word& fieldName, | |
| const tmp<ObjectType>& tfield, | |
| bool cacheable = false | |
| ); | |
| template<class Expression, class = EnableIfExpression<Expression>> | |
| auto store | |
| ( | |
| const word& fieldName, | |
| const Expression& e, | |
| bool cacheable = false | |
| ) | |
| { | |
| return store(fieldName, eval(e), cacheable); | |
| } | |
| //- Write field if present in objectRegistry | |
| bool writeObject(const word& fieldName); | |
| //- Clear field from the objectRegistry if present | |
| bool clearObject(const word& fieldName); | |
| public: | |
| //- Runtime type information | |
| TypeName("objectRegistryFunctionObject"); | |
| // Constructors | |
| //- Construct from an objectRegistry and dictionary | |
| objectRegistryFunctionObject | |
| ( | |
| const word& name, | |
| const objectRegistry& obr, | |
| const dictionary& dict | |
| ); | |
| //- Construct from an objectRegistry | |
| objectRegistryFunctionObject | |
| ( | |
| const word& name, | |
| const objectRegistry& obr | |
| ); | |
| //- Disallow default bitwise copy construction | |
| objectRegistryFunctionObject | |
| ( | |
| const objectRegistryFunctionObject& | |
| ) = delete; | |
| //- Destructor | |
| virtual ~objectRegistryFunctionObject(); | |
| // Member Functions | |
| //- Read optional controls | |
| virtual bool read(const dictionary&); | |
| // Member Operators | |
| //- Disallow default bitwise assignment | |
| void operator=(const objectRegistryFunctionObject&) = delete; | |
| }; | |
| // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | |
| } // End namespace functionObjects | |
| } // End namespace Foam | |
| // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | |
| // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | |
| // ************************************************************************* // | |