None.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::Function1s::None
26 
27 Description
28  Undefined Function1 which returns an error when called.
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef None_H
33 #define None_H
34 
35 #include "Function1.H"
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 namespace Foam
40 {
41 namespace Function1s
42 {
43 
44 /*---------------------------------------------------------------------------*\
45  Class None Declaration
46 \*---------------------------------------------------------------------------*/
47 
48 template<class Type>
49 class None
50 :
51  public FieldFunction1<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 Type value(const scalar x) const;
87 
88  //- Generates an error
89  virtual Type integral(const scalar x1, const scalar x2) const;
90 
91  //- Write in dictionary format
92  virtual void write(Ostream& os, const unitConversions& units) const;
93 
94 
95  // Member Operators
96 
97  //- Disallow default bitwise assignment
98  void operator=(const None<Type>&) = delete;
99 };
100 
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 } // End namespace Function1s
105 } // End namespace Foam
106 
107 #ifdef NoRepository
108  #include "None.C"
109 #endif
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 #endif
114 
115 // ************************************************************************* //
const word & name() const
Return the name of the entry.
Definition: Function1.C:78
Undefined Function1 which returns an error when called.
Definition: None.H:51
virtual ~None()
Destructor.
Definition: None.C:54
virtual Type integral(const scalar x1, const scalar x2) const
Generates an error.
Definition: None.C:74
TypeName("none")
Runtime type information.
virtual void write(Ostream &os, const unitConversions &units) const
Write in dictionary format.
Definition: None.C:88
None(const word &name)
Construct from name.
Definition: None.C:31
virtual Type value(const scalar x) const
Generates an error.
Definition: None.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