Files
openfoam/src/functionObjects/graphics/runTimePostProcessing/functionObjectBase.H
Mark Olesen b30138595c ENH: adjustments to runTimePostProcessing
- support VTP input in functionObjectCloud scene element

- additional fallback lookup of cloud information from state properties
  instead of cloud OutputProperties
2018-06-15 23:01:27 +02:00

163 lines
4.6 KiB
C++

/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\/ 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::runTimePostPro::functionObjectBase
Description
Base class for function object visualisation
Dictionary controls
\table
Property | Description | Required | Default
functionObject | The data source | yes |
clearObjects | Remove file after use | no | no
\endtable
SourceFiles
functionObjectBase.C
\*---------------------------------------------------------------------------*/
#ifndef functionObjects_runTimePostPro_functionObjectBase_H
#define functionObjects_runTimePostPro_functionObjectBase_H
#include "fieldVisualisationBase.H"
#include "stateFunctionObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace functionObjects
{
namespace runTimePostPro
{
/*---------------------------------------------------------------------------*\
Class functionObjectBase Declaration
\*---------------------------------------------------------------------------*/
class functionObjectBase
:
public fieldVisualisationBase
{
private:
// Private Member Functions
//- No copy construct
functionObjectBase(const functionObjectBase&) = delete;
//- No copy assignment
void operator=(const functionObjectBase&) = delete;
protected:
// Protected data
//- Reference to the state
const stateFunctionObject& state_;
//- The function object name which provides the source data
word functionObjectName_;
//- Flag to indicate that source data should be cleared after use
bool clearObjects_;
// Protected Member Functions
//- Retrieve the filename used to create the scene object
//- using information stored via the stateFunctionObject.
//
// \param keyword is normally "file"
// \param subDictName is the sub-dictionary name, which is often
// the fieldName when one file is used per field.
//
// Eg,
// \verbatim
// T
// {
// file "path/T_object.vtk";
// }
// defaultCloud
// {
// file "path/cloud_0001.vtp";
// fields (T U);
// }
// \endverbatim
fileName getFileName
(
const word& keyword,
const word& subDictName
) const;
//- Remove file used to create the scene object.
// Same naming semantics as getFileName.
//
// \note does not change the stateFunctionObject
bool removeFile(const word& keyword, const word& subDictName);
public:
//- Run-time type information
TypeName("functionObjectBase");
// Constructors
//- Construct from dictionary
functionObjectBase
(
const stateFunctionObject& state,
const dictionary& dict,
const HashPtrTable<Function1<vector>, word>& colours
);
//- Destructor
virtual ~functionObjectBase();
// Member Functions
//- Clear files used to create the object(s)
virtual bool clear();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace runTimePostPro
} // End namespace functionObjects
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //