calcType.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "calcType.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
31 
33 
34 
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
36 
38 {}
39 
40 
41 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
42 
44 {}
45 
46 
47 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
48 
50 {
51  // Do nothing
52 }
53 
54 
56 (
57  const argList& args,
58  const Time& runTime,
59  const fvMesh& mesh
60 )
61 {
62  // Do nothing
63 }
64 
65 
67 (
68  const argList& args,
69  const Time& runTime,
70  const fvMesh& mesh
71 )
72 {
73  // Do nothing
74 }
75 
76 
78 (
79  const argList& args,
80  const Time& runTime,
81  const fvMesh& mesh
82 )
83 {
84  // Do nothing
85 }
86 
87 
88 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
89 
91 {
93 
94  try
95  {
96  init();
97  }
98  catch(IOerror& err)
99  {
100  Warning<< err << endl;
101  }
102 }
103 
104 
106 (
107  const argList& args,
108  const Time& runTime,
109  const fvMesh& mesh
110 )
111 {
113 
114  try
115  {
116  preCalc(args, runTime, mesh);
117  }
118  catch(IOerror& err)
119  {
120  Warning<< err << endl;
121  }
122 }
123 
124 
126 (
127  const argList& args,
128  const Time& runTime,
129  const fvMesh& mesh
130 )
131 {
133 
134  try
135  {
136  calc(args, runTime, mesh);
137  }
138  catch(IOerror& err)
139  {
140  Warning<< err << endl;
141  }
142 }
143 
144 
146 (
147  const argList& args,
148  const Time& runTime,
149  const fvMesh& mesh
150 )
151 {
153 
154  try
155  {
156  postCalc(args, runTime, mesh);
157  }
158  catch(IOerror& err)
159  {
160  Warning<< err << endl;
161  }
162 }
163 
164 
165 // ************************************************************************* //
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
Foam::calcType::tryInit
void tryInit()
Initialise - typically setting static variables,.
Definition: calcType.C:90
defineTypeNameAndDebug
defineTypeNameAndDebug(calcType, 0)
Foam::Warning
messageStream Warning
Foam::calcType::calc
virtual void calc(const argList &args, const Time &runTime, const fvMesh &mesh)
Time loop calculations.
Definition: calcType.C:67
Foam::calc
void calc(const argList &args, const Time &runTime, const fvMesh &mesh)
Definition: Lambda2.C:38
Foam::argList
Extract command arguments and options from the supplied argc and argv parameters.
Definition: argList.H:97
Foam::FatalIOError
IOerror FatalIOError
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
defineRunTimeSelectionTable
defineRunTimeSelectionTable(calcType, dictionary)
Foam::calcType::postCalc
virtual void postCalc(const argList &args, const Time &runTime, const fvMesh &mesh)
Post-time loop calculations.
Definition: calcType.C:78
Foam::calcType::calcType
calcType()
Construct null.
Definition: calcType.C:37
Foam::calcType::~calcType
virtual ~calcType()
Destructor.
Definition: calcType.C:43
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam::error::throwExceptions
void throwExceptions()
Definition: error.H:121
Foam::calcType::preCalc
virtual void preCalc(const argList &args, const Time &runTime, const fvMesh &mesh)
Pre-time loop calculations.
Definition: calcType.C:56
calcType.H
Foam::IOerror
Report an I/O error.
Definition: error.H:195
Foam::calcType::tryCalc
void tryCalc(const argList &args, const Time &runTime, const fvMesh &mesh)
Time loop calculations.
Definition: calcType.C:126
Foam::calcType::init
virtual void init()
Initialise - typically setting static variables,.
Definition: calcType.C:49
args
Foam::argList args(argc, argv)
Foam::calcType
Base class for post-processing calculation functions.
Definition: calcType.H:58
Foam::calcType::tryPostCalc
void tryPostCalc(const argList &args, const Time &runTime, const fvMesh &mesh)
Post-time loop calculations.
Definition: calcType.C:146
Foam::calcType::tryPreCalc
void tryPreCalc(const argList &args, const Time &runTime, const fvMesh &mesh)
Pre-time loop calculations.
Definition: calcType.C:106