steady_solver.C
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 #include "libmesh/diff_solver.h"
20 #include "libmesh/diff_system.h"
21 #include "libmesh/steady_solver.h"
22 
23 namespace libMesh
24 {
25 
26 
27 
29 {
30 }
31 
32 
33 
34 bool SteadySolver::element_residual(bool request_jacobian,
35  DiffContext& context)
36 {
37  // If a fixed solution is requested, it will just be the current
38  // solution
40  {
41  context.get_elem_fixed_solution() = context.get_elem_solution();
42  context.fixed_solution_derivative = 1.0;
43  }
44 
45  bool jacobian_computed =
46  _system.element_time_derivative(request_jacobian, context);
47 
48  // The user shouldn't compute a jacobian unless requested
49  libmesh_assert(request_jacobian || !jacobian_computed);
50 
51  bool jacobian_computed2 =
52  _system.element_constraint(jacobian_computed, context);
53 
54  // The user shouldn't compute a jacobian unless requested
55  libmesh_assert (jacobian_computed || !jacobian_computed2);
56 
57  return jacobian_computed2;
58 }
59 
60 
61 
62 bool SteadySolver::side_residual(bool request_jacobian,
63  DiffContext& context)
64 {
65  // If a fixed solution is requested, it will just be the current
66  // solution
68  {
69  context.get_elem_fixed_solution() = context.get_elem_solution();
70  context.fixed_solution_derivative = 1.0;
71  }
72 
73  bool jacobian_computed =
74  _system.side_time_derivative(request_jacobian, context);
75 
76  // The user shouldn't compute a jacobian unless requested
77  libmesh_assert (request_jacobian || !jacobian_computed);
78 
79  bool jacobian_computed2 =
80  _system.side_constraint(jacobian_computed, context);
81 
82  // The user shouldn't compute a jacobian unless requested
83  libmesh_assert (jacobian_computed || !jacobian_computed2);
84 
85  return jacobian_computed2;
86 }
87 
88 } // namespace libMesh

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

Hosted By:
SourceForge.net Logo