solver.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_SOLVER_H
21 #define LIBMESH_SOLVER_H
22 
23 // Local includes
24 #include "libmesh/libmesh_common.h"
27 
28 // C++ includes
29 
30 namespace libMesh
31 {
32 
33 // Forward Declarations
34 class MeshBase;
35 class Solver;
36 
45 // ------------------------------------------------------------
46 // Solver class definition
47 class Solver : public ReferenceCountedObject<Solver>
48 {
49 protected:
50 
56  explicit
57  Solver (EquationSystems& es);
58 
64  const std::string& name,
65  const unsigned int number);
66 
67 
68 public:
69 
73  ~Solver ();
74 
79 
84  virtual void init ();
85 
90  virtual void pre_process ();
91 
97  virtual void solve ();
98 
103  virtual void post_process ();
104 
108  const sys_type & system () const { return _system; }
109 
113  const MeshBase & mesh () const { return _mesh; }
114 
115 
116 protected:
117 
121  sys_type & system () { return _system; }
122 
126  MeshBase & mesh () { return _mesh; }
127 
132 
138 };
139 
140 
141 
142 // ------------------------------------------------------------
143 // Solver inline members
144 inline
146  _system (es),
147  _mesh (es.get_mesh())
148 {
149 libmesh_deprecated();
150 }
151 
152 
153 
154 inline
156 {
157 }
158 
159 
160 
161 inline
163 {
164  // Initialize the system.
165  this->system().init ();
166 }
167 
168 
169 
170 inline
172 {
173 // libMesh::out << "Pre-processing"
174 // << std::endl;
175 }
176 
177 
178 
179 inline
181 {
182  // Perform any necessary pre-processing
184 
185  // Solve the system
186  this->system().solve ();
187 
188  // Perform any necessary post-processing
190 }
191 
192 
193 
194 inline
196 {
197 // libMesh::out << "Post-processing"
198 // << std::endl;
199 }
200 
201 } // namespace libMesh
202 
203 
204 #endif // LIBMESH_SOLVER_H

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

Hosted By:
SourceForge.net Logo