queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
FunctionBase.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-2017 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef QUESO_FUNCTION_BASE_H
26 #define QUESO_FUNCTION_BASE_H
27 
28 #include <string>
29 
30 #include <queso/SharedPtr.h>
31 
32 namespace QUESO {
33 
34 class FunctionOperatorBuilder;
35 
47 class FunctionBase {
48 public:
50 
51  FunctionBase();
53 
55  virtual ~FunctionBase();
57 
59  virtual void add(double scale, const FunctionBase & rhs) = 0;
60 
62  virtual void pointwise_mult(const FunctionBase & f1,
63  const FunctionBase & f2) = 0;
64 
66  virtual void scale(double scale) = 0;
67 
69  virtual void zero() = 0;
70 
72  virtual double L2_norm() const = 0;
73 
75 
80  virtual SharedPtr<FunctionBase>::Type zero_clone() const = 0;
81 
83  virtual void save_function(const std::string & filename, double time) const = 0;
84 };
85 
86 } // End namespace QUESO
87 
88 #endif // QUESO_FUNCTION_BASE_H
std::shared_ptr< T > Type
Definition: SharedPtr.h:69
virtual SharedPtr< FunctionBase >::Type zero_clone() const =0
Create a zero function copy of this and return pointer to it.
virtual void pointwise_mult(const FunctionBase &f1, const FunctionBase &f2)=0
Pointwise multiply f1 and f2 and store the result in *this.
virtual void add(double scale, const FunctionBase &rhs)=0
Execute this += scale * rhs.
virtual double L2_norm() const =0
Return the L2-norm of this.
virtual ~FunctionBase()
Destructor.
Definition: FunctionBase.C:34
virtual void zero()=0
Set this to zero everywhere.
virtual void save_function(const std::string &filename, double time) const =0
Save the current function to an Exodus file called filename. time is the time to attach to the functi...
virtual void scale(double scale)=0
Execute this *= scale.
Abstract base class for function objects.
Definition: FunctionBase.h:47
FunctionBase()
Constructor.
Definition: FunctionBase.C:30

Generated on Tue Jun 5 2018 19:48:54 for queso-0.57.1 by  doxygen 1.8.5