libMesh
memory_solution_history.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2024 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"
25 #include "libmesh/solution_history.h"
26 #include "libmesh/diff_system.h"
27 
28 // C++ includes
29 #include <list>
30 #include <memory>
31 
32 namespace libMesh
33 {
34 
44 {
45 public:
46 
52  { libmesh_experimental(); }
53 
58 
62  virtual void store(bool is_adjoint_solve, Real time) override;
63 
67  virtual void retrieve(bool is_adjoint_solve, Real time) override;
68 
69  typedef std::map<std::string, std::unique_ptr<NumericVector<Number>>> map_type;
70 
74  virtual std::unique_ptr<SolutionHistory > clone() const override
75  {
76  return std::make_unique<MemorySolutionHistory>(_system);
77  }
78 
79 private:
80 
81  // A system reference
83 };
84 
85 } // end namespace libMesh
86 
87 #endif // LIBMESH_MEMORY_SOLUTION_HISTORY_H
Subclass of Solution History that stores the solutions and other important vectors in memory...
The libMesh namespace provides an interface to certain functionality in the library.
A SolutionHistory class that enables the storage and retrieval of timesteps and (in the future) adapt...
This class provides a specific system class.
Definition: diff_system.h:54
MemorySolutionHistory(DifferentiableSystem &system_)
Constructor, reference to system to be passed by user, set the stored_sols iterator to some initial v...
std::map< std::string, std::unique_ptr< NumericVector< Number > > > map_type
virtual void store(bool is_adjoint_solve, Real time) override
Virtual function store which we will be overriding to store timesteps.
virtual void retrieve(bool is_adjoint_solve, Real time) override
Virtual function retrieve which we will be overriding to retrieve timesteps.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::unique_ptr< SolutionHistory > clone() const override
Definition of the clone function needed for the setter function.