OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
residual.h
Go to the documentation of this file.
1 // ------------------------------------------------------------------
2 // $Id: residual.h 1348 2013-08-16 00:45:07Z secanell $
3 //
4 // Copyright (C) 2006, 2007, 2008, 2009 by Guido Kanschat.
5 // Copyright (C) 2012 by Valentin N. Zingan, University of Alberta.
6 //
7 // This file is subject to QPL and may not be distributed
8 // without copyright and license information. Please refer
9 // to the file deal.II/doc/license.html for the text and
10 // further information on this license.
11 // ------------------------------------------------------------------
12 
13 #ifndef _DEALII_APPFRAME_RESIDUAL_H_
14 #define _DEALII_APPFRAME_RESIDUAL_H_
15 
16 #include <appframe/base.h>
17 
18 using namespace dealii;
19 
20 namespace AppFrame
21 {
22 
30 class Residual : public Subscriptor
31 {
32 public:
33 
34  virtual ~Residual() { }
35 
41  virtual double operator() (FEVector& dst,
42  const FEVectors& src) const = 0;
43 };
44 
53 {
54 public:
55 
63 
64  virtual double operator() (FEVector& dst,
65  const FEVectors& src) const;
66 
67 private:
68 
74  SmartPointer<ApplicationBase> app;
75 };
76 
77 inline
78 ApplicationResidual::ApplicationResidual(ApplicationBase& ex_app)
79 :
80 app(&ex_app)
81 { }
82 
83 inline
84 double
86  const FEVectors& src) const
87 {
88  return app->residual(dst, src);
89 }
90 
91 }
92 
93 #endif