None2.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2020 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 Class
25  Foam::Function2s::None
26 
27 Description
28  Undefined Function2 which returns an error when called.
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef None2_H
33 #define None2_H
34 
35 #include "Function2.H"
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 namespace Foam
40 {
41 namespace Function2s
42 {
43 
44 /*---------------------------------------------------------------------------*\
45  Class None Declaration
46 \*---------------------------------------------------------------------------*/
47 
48 template<class Type>
49 class None
50 :
51  public FieldFunction2<Type, None<Type>>
52 {
53  // Private member data
54 
55  //- Name of dictionary from which this function is instantiated
56  fileName dictName_;
57 
58 
59 public:
60 
61  //- Runtime type information
62  TypeName("none");
63 
64 
65  // Constructors
66 
67  //- Construct from name and dictionary
68  None(const word& name, const dictionary& dict);
69 
70 
71  //- Destructor
72  virtual ~None();
73 
74 
75  // Member Functions
76 
77  //- Generates an error
78  virtual inline Type value(const scalar x, const scalar y) const;
79 
80  //- Write in dictionary format
81  virtual void write(Ostream& os) const;
82 
83 
84  // Member Operators
85 
86  //- Disallow default bitwise assignment
87  void operator=(const None<Type>&) = delete;
88 };
89 
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 } // End namespace Function2
94 } // End namespace Foam
95 
96 #ifdef NoRepository
97  #include "None2.C"
98 #endif
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 #endif
103 
104 // ************************************************************************* //
scalar y
const word & name() const
Return the name of the entry.
Definition: Function2.C:81
Undefined Function2 which returns an error when called.
Definition: None2.H:51
virtual ~None()
Destructor.
Definition: None2.C:45
TypeName("none")
Runtime type information.
virtual void write(Ostream &os) const
Write in dictionary format.
Definition: None2.C:65
None(const word &name, const dictionary &dict)
Construct from name and dictionary.
Definition: None2.C:32
virtual Type value(const scalar x, const scalar y) const
Generates an error.
Definition: None2.C:52
void operator=(const None< Type > &)=delete
Disallow default bitwise assignment.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
A class for handling file names.
Definition: fileName.H:82
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dictionary dict