All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2024 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  const fileName dictName_;
57 
58 
59 public:
60 
61  //- Runtime type information
62  TypeName("none");
63 
64 
65  // Constructors
66 
67  //- Construct from name
68  None(const word& name);
69 
70  //- Construct from name and dictionary
71  None
72  (
73  const word& name,
74  const unitConversions& units,
75  const dictionary& dict
76  );
77 
78 
79  //- Destructor
80  virtual ~None();
81 
82 
83  // Member Functions
84 
85  //- Generates an error
86  virtual inline Type value(const scalar x, const scalar y) const;
87 
88  //- Write in dictionary format
89  virtual void write(Ostream& os, const unitConversions& units) const;
90 
91 
92  // Member Operators
93 
94  //- Disallow default bitwise assignment
95  void operator=(const None<Type>&) = delete;
96 };
97 
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 } // End namespace Function2
102 } // End namespace Foam
103 
104 #ifdef NoRepository
105  #include "None2.C"
106 #endif
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 #endif
111 
112 // ************************************************************************* //
scalar y
const word & name() const
Return the name of the entry.
Definition: Function2.C:78
Undefined Function2 which returns an error when called.
Definition: None2.H:51
virtual ~None()
Destructor.
Definition: None2.C:54
TypeName("none")
Runtime type information.
virtual void write(Ostream &os, const unitConversions &units) const
Write in dictionary format.
Definition: None2.C:75
None(const word &name)
Construct from name.
Definition: None2.C:31
virtual Type value(const scalar x, const scalar y) const
Generates an error.
Definition: None2.C:61
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:162
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.
const HashTable< unitConversion > & units()
Get the table of unit conversions.
dictionary dict