1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 Foam::timeActivatedFileUpdate
28 Performs a file copy/replacement once a specified time has been reached.
30 Example usage to update the fvSolution dictionary at various times
31 throughout the calculation:
35 type timeActivatedFileUpdate;
36 functionObjectLibs ("libutilityFunctionObjects.so");
37 outputControl timeStep;
39 fileToUpdate "$FOAM_CASE/system/fvSolution";
42 (-1 "$FOAM_CASE/system/fvSolution.0")
43 (0.10 "$FOAM_CASE/system/fvSolution.10")
44 (0.20 "$FOAM_CASE/system/fvSolution.20")
45 (0.35 "$FOAM_CASE/system/fvSolution.35")
51 timeActivatedFileUpdate.C
52 IOtimeActivatedFileUpdate.H
54 \*---------------------------------------------------------------------------*/
56 #ifndef timeActivatedFileUpdate_H
57 #define timeActivatedFileUpdate_H
59 #include "pointFieldFwd.H"
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 // Forward declaration of classes
72 /*---------------------------------------------------------------------------*\
73 Class timeActivatedFileUpdate Declaration
74 \*---------------------------------------------------------------------------*/
76 class timeActivatedFileUpdate
80 //- Name of this set of timeActivatedFileUpdate objects
84 const objectRegistry& obr_;
89 //- Name of file to update
90 fileName fileToUpdate_;
92 //- List of times vs filenames
93 List<Tuple2<scalar, fileName> > timeVsFile_;
95 //- Index of last file copied
99 // Private Member Functions
104 //- Disallow default bitwise copy construct
105 timeActivatedFileUpdate(const timeActivatedFileUpdate&);
107 //- Disallow default bitwise assignment
108 void operator=(const timeActivatedFileUpdate&);
113 //- Runtime type information
114 TypeName("timeActivatedFileUpdate");
119 //- Construct for given objectRegistry and dictionary.
120 // Allow the possibility to load fields from files
121 timeActivatedFileUpdate
124 const objectRegistry&,
126 const bool loadFromFiles = false
131 virtual ~timeActivatedFileUpdate();
136 //- Return name of the set of timeActivatedFileUpdate
137 virtual const word& name() const
142 //- Read the timeActivatedFileUpdate data
143 virtual void read(const dictionary&);
145 //- Execute, currently does nothing
146 virtual void execute();
148 //- Execute at the final time-loop, currently does nothing
151 //- Calculate the timeActivatedFileUpdate and write
152 virtual void write();
154 //- Update for changes of mesh
155 virtual void updateMesh(const mapPolyMesh&)
158 //- Update for changes of mesh
159 virtual void movePoints(const pointField&)
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 } // End namespace Foam
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 // ************************************************************************* //