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 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  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 Type value(const scalar x) const;
79 
80  //- Generates an error
81  virtual Type integral(const scalar x1, const scalar x2) const;
82 
83  //- Write in dictionary format
84  virtual void write(Ostream& os) const;
85 
86 
87  // Member Operators
88 
89  //- Disallow default bitwise assignment
90  void operator=(const None<Type>&) = delete;
91 };
92 
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 } // End namespace Function1s
97 } // End namespace Foam
98 
99 #ifdef NoRepository
100  #include "None.C"
101 #endif
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 #endif
106 
107 // ************************************************************************* //
const word & name() const
Return the name of the entry.
Definition: Function1.C:82
Undefined Function1 which returns an error when called.
Definition: None.H:51
virtual ~None()
Destructor.
Definition: None.C:45
virtual Type integral(const scalar x1, const scalar x2) const
Generates an error.
Definition: None.C:65
TypeName("none")
Runtime type information.
virtual void write(Ostream &os) const
Write in dictionary format.
Definition: None.C:78
None(const word &name, const dictionary &dict)
Construct from name and dictionary.
Definition: None.C:32
virtual Type value(const scalar x) const
Generates an error.
Definition: None.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