Loading...
Searching...
No Matches
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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2016 OpenFOAM Foundation
9 Copyright (C) 2016-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::functionObjects::magSqr
29
30Group
31 grpFieldFunctionObjects
32
33Description
34 Computes the magnitude of the square of an input field.
35
36 Operands:
37 \table
38 Operand | Type | Location
39 input | {vol,surface}<Type>Field | <time>/inputField
40 output file | - | -
41 output field | {vol,surface}ScalarField | <time>/outputField
42 \endtable
43
44 where \c Type can be one of:
45 \c Scalar, \c Vector, \c SphericalTensor, \c SymmTensor, or \c Tensor.
46
47 With the \c subRegion option, also supports fields on functionObject
48 surface output (e.g. sampledSurfaces).
49
50Usage
51 Minimal example by using \c system/controlDict.functions:
52 \verbatim
53 magSqrFO
54 {
55 // Mandatory entries
56 type magSqr;
57 libs (fieldFunctionObjects);
58 field <word>;
59
60 // Inherited entries
61 ...
62 }
63 \endverbatim
64
65 where the entries mean:
66 \table
67 Property | Description | Type | Reqd | Deflt
68 type | Type name: magSqr | word | yes | -
69 libs | Library name: fieldFunctionObjects | word | yes | -
70 field | Name of the operand field | word | yes | -
71 \endtable
72
73 The inherited entries are elaborated in:
74 - \link fieldExpression.H \endlink
75
76SourceFiles
77 magSqr.C
78 magSqrTemplates.C
79
80\*---------------------------------------------------------------------------*/
81
82#ifndef Foam_functionObjects_magSqr_H
83#define Foam_functionObjects_magSqr_H
84
85#include "fieldExpression.H"
86
87// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88
89namespace Foam
90{
91namespace functionObjects
92{
93
94/*---------------------------------------------------------------------------*\
95 Class magSqr Declaration
96\*---------------------------------------------------------------------------*/
97
98class magSqr
99:
100 public fieldExpression
101{
102 // Private Member Functions
103
104 //- Calculate the magnitude of the sqr of the field
105 //- and register the result
106 template<class Type>
107 bool calcMagSqr();
108
109 //- Calculate the magnitude of the sqr of the field
110 //- and return true if successful
111 virtual bool calc();
112
113
114public:
115
116 //- Runtime type information
117 TypeName("magSqr");
118
119
120 // Constructors
121
122 //- Construct from name, Time and dictionary
123 magSqr
124 (
125 const word& name,
126 const Time& runTime,
127 const dictionary& dict
128 );
129
130 //- No copy construct
131 magSqr(const magSqr&) = delete;
132
133 //- No copy assignment
134 void operator=(const magSqr&) = delete;
135
136
137 //- Destructor
138 virtual ~magSqr() = default;
139};
140
141
142// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143
144} // End namespace functionObjects
145} // End namespace Foam
146
147// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148
149#ifdef NoRepository
150 #include "magSqrTemplates.C"
151#endif
152
153// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154
155#endif
156
157// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const word & name() const noexcept
Return the name of this functionObject.
Intermediate class for handling field expression function objects (e.g. blendingFactor etc....
fieldExpression(const word &name, const Time &runTime, const dictionary &dict, const word &fieldName=word::null, const word &resultName=word::null)
Construct from name, Time and dictionary.
virtual bool calc()=0
Calculate the components of the field and return true if successful.
Computes the magnitude of the square of an input field.
Definition magSqr.H:136
magSqr(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
Definition magSqr.C:56
TypeName("magSqr")
Runtime type information.
virtual ~magSqr()=default
Destructor.
void operator=(const magSqr &)=delete
No copy assignment.
magSqr(const magSqr &)=delete
No copy construct.
A class for handling words, derived from Foam::string.
Definition word.H:66
engineTime & runTime
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68