memory_solution_history.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_MEMORY_SOLUTION_HISTORY_H
21 #define LIBMESH_MEMORY_SOLUTION_HISTORY_H
22 
23 // Local includes
24 #include "libmesh/numeric_vector.h"
26 #include <list>
27 
28 namespace libMesh
29 {
35  {
36  public:
37 
38  // Constructor, reference to system to be passed by user, set the
39  // stored_sols iterator to some initial value
41  { libmesh_experimental(); }
42 
43  // Destructor
45 
46  // Virtual function store which we will be overriding to store timesteps
47  virtual void store();
48 
49  // Virtual function retrieve which we will be overriding to retrieve timesteps
50  virtual void retrieve();
51 
52  // Typedef for Stored Solutions iterator, a list of pairs of the current
53  // system time, map of strings and saved vectors
54  typedef std::list<std::pair<Real, std::map<std::string, NumericVector<Number>*> > >::iterator stored_solutions_iterator;
55 
56  // Definition of the clone function needed for the setter function
57  virtual AutoPtr<SolutionHistory > clone() const {
60 
61  private:
62 
63  // This list of pairs will hold the current time and stored vectors
64  // from each timestep
65  std::list<std::pair<Real, std::map<std::string, NumericVector<Number>*> > > stored_solutions;
66 
67  // The stored solutions iterator
69 
70  // A helper function to locate entries at a given time
71  void find_stored_entry();
72 
73  // A system reference
75 
76  };
77 
78 } // end namespace libMesh
79 
80 #endif // LIBMESH_MEMORY_SOLUTION_HISTORY_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:06 UTC

Hosted By:
SourceForge.net Logo