Loading...
Searching...
No Matches
mag.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) 2012-2016 OpenFOAM Foundation
9 Copyright (C) 2019-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::mag
29
30Group
31 grpFieldFunctionObjects
32
33Description
34 Computes the magnitude 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 function object
48 surface output (e.g. sampledSurfaces).
49
50Usage
51 Minimal example by using \c system/controlDict.functions:
52 \verbatim
53 magFO
54 {
55 // Mandatory entries
56 type mag;
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: mag | 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 mag.C
78 magTemplates.C
79
80\*---------------------------------------------------------------------------*/
81
82#ifndef Foam_functionObjects_mag_H
83#define Foam_functionObjects_mag_H
84
85#include "fieldExpression.H"
86
87// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88
89namespace Foam
90{
91namespace functionObjects
92{
93
94/*---------------------------------------------------------------------------*\
95 Class mag Declaration
96\*---------------------------------------------------------------------------*/
97
98class mag
99:
100 public fieldExpression
101{
102 // Private Member Functions
103
104 //- Calculate the magnitude of the field and register the result
105 template<class Type>
106 bool calcMag();
107
108 //- Calculate the magnitude of the field and return true if successful
109 virtual bool calc();
110
111
112public:
113
114 //- Runtime type information
115 TypeName("mag");
116
117
118 // Constructors
119
120 //- Construct from name, Time and dictionary
121 mag
122 (
123 const word& name,
124 const Time& runTime,
125 const dictionary& dict
126 );
127
128 //- No copy construct
129 mag(const mag&) = delete;
130
131 //- No copy assignment
132 void operator=(const mag&) = delete;
134
135 //- Destructor
136 virtual ~mag() = default;
137};
138
139
140// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141
142} // End namespace functionObjects
143} // End namespace Foam
144
145// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146
147#ifdef NoRepository
148 #include "magTemplates.C"
149#endif
150
151// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152
153#endif
154
155// ************************************************************************* //
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 an input field.
Definition mag.H:136
mag(const mag &)=delete
No copy construct.
virtual ~mag()=default
Destructor.
void operator=(const mag &)=delete
No copy assignment.
TypeName("mag")
Runtime type information.
mag(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
Definition mag.C:55
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