FreeFOAM The Cross-Platform CFD Toolkit
magSqr.H
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) 1991-2010 OpenCFD Ltd.
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 Class
25  Foam::calcTypes::magSqr
26 
27 Description
28  Calculates and writes the magnitude-sqaured of a field for each time
29 
30 SourceFiles
31  magSqr.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef magSqr_H
36 #define magSqr_H
37 
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 namespace calcTypes
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class magSqr Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class magSqr
53 :
54  public calcType
55 {
56  // Private Member Functions
57 
58  //- Disallow default bitwise copy construct
59  magSqr(const magSqr&);
60 
61  //- Disallow default bitwise assignment
62  void operator=(const magSqr&);
63 
64 
65 protected:
66 
67  // Member Functions
68 
69  // Calculation routines
70 
71  //- Initialise - typically setting static variables,
72  // e.g. command line arguments
73  virtual void init();
74 
75  //- Pre-time loop calculations
76  virtual void preCalc
77  (
78  const argList& args,
79  const Time& runTime,
80  const fvMesh& mesh
81  );
82 
83  //- Time loop calculations
84  virtual void calc
85  (
86  const argList& args,
87  const Time& runTime,
88  const fvMesh& mesh
89  );
90 
91 
92  // I-O
93 
94  //- Write component fields
95  template<class Type>
96  void writeMagSqrField
97  (
98  const IOobject& header,
99  const fvMesh& mesh,
100  bool& processed
101  );
102 
103 
104 public:
105 
106  //- Runtime type information
107  TypeName("magSqr");
108 
109 
110  // Constructors
111 
112  //- Construct null
113  magSqr();
114 
115 
116  // Destructor
117 
118  virtual ~magSqr();
119 };
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace calcTypes
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #ifdef NoRepository
131 #endif
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************ vim: set sw=4 sts=4 et: ************************ //