OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
application_copy.h
Go to the documentation of this file.
1 // ------------------------------------------------------------------
2 // $Id: application_copy.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_APPLICATION_COPY_H_
14 #define _DEALII_APPFRAME_APPLICATION_COPY_H_
15 
17 
18 using namespace dealii;
19 
20 namespace AppFrame
21 {
22 
30 {
31 public:
32 
43 
45 
46  virtual void declare_parameters(ParameterHandler& param) { app->declare_parameters(param); }
47 
48  virtual void initialize(ParameterHandler& param) { app->initialize(param); }
49 
50  virtual void remesh() { app->remesh(); }
51 
52  virtual void init_vector(FEVector& dst) const { app->init_vector(dst); }
53 
54  virtual void start_vector(FEVector& dst,
55  std::string caller) const { app->start_vector(dst, caller); }
56 
57  virtual double residual(FEVector& dst,
58  const FEVectors& src) { return app->residual(dst, src); }
59 
60  virtual void solve(FEVector& start,
61  const FEVectors& rhs) { app->solve(start, rhs); }
62 
63  virtual void Tsolve(FEVector& start,
64  const FEVectors& rhs) { app->Tsolve(start, rhs); }
65 
66  virtual double estimate(const FEVectors& src) { return app->estimate(src); }
67 
68  virtual double evaluate(const FEVectors& src) { return app->evaluate(src); }
69 
70  virtual void grid_out(const std::string& filename) const { app->grid_out(filename); }
71 
72  virtual void data_out(const std::string& filename,
73  const FEVectors& src) { app->data_out(filename, src); }
74 
75  virtual std::string id() const { return std::string( typeid(*this).name() ); }
76 
77  virtual void notify(const Event& reason) {
78  ApplicationBase::notify(reason);
79  app->notify(reason);
80  }
81 
82 protected:
83 
88  SmartPointer<ApplicationBase> app;
89 };
90 
91 inline
92 ApplicationCopy::ApplicationCopy(ApplicationBase& ex_app)
93 :
94 ApplicationBase(ex_app.get_data()),
95 app(&ex_app)
96 {
97  deallog << "->Copy";
98 }
99 
100 }
101 
102 #endif