steady_solver.C
Go to the documentation of this file.00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2012 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 00019 #include "libmesh/diff_solver.h" 00020 #include "libmesh/diff_system.h" 00021 #include "libmesh/steady_solver.h" 00022 00023 namespace libMesh 00024 { 00025 00026 00027 00028 SteadySolver::~SteadySolver () 00029 { 00030 } 00031 00032 00033 00034 bool SteadySolver::element_residual(bool request_jacobian, 00035 DiffContext& context) 00036 { 00037 // If a fixed solution is requested, it will just be the current 00038 // solution 00039 if (_system.use_fixed_solution) 00040 { 00041 context.elem_fixed_solution = context.elem_solution; 00042 context.fixed_solution_derivative = 1.0; 00043 } 00044 00045 bool jacobian_computed = 00046 _system.element_time_derivative(request_jacobian, context); 00047 00048 // The user shouldn't compute a jacobian unless requested 00049 libmesh_assert(request_jacobian || !jacobian_computed); 00050 00051 bool jacobian_computed2 = 00052 _system.element_constraint(jacobian_computed, context); 00053 00054 // The user shouldn't compute a jacobian unless requested 00055 libmesh_assert (jacobian_computed || !jacobian_computed2); 00056 00057 return jacobian_computed2; 00058 } 00059 00060 00061 00062 bool SteadySolver::side_residual(bool request_jacobian, 00063 DiffContext& context) 00064 { 00065 // If a fixed solution is requested, it will just be the current 00066 // solution 00067 if (_system.use_fixed_solution) 00068 { 00069 context.elem_fixed_solution = context.elem_solution; 00070 context.fixed_solution_derivative = 1.0; 00071 } 00072 00073 bool jacobian_computed = 00074 _system.side_time_derivative(request_jacobian, context); 00075 00076 // The user shouldn't compute a jacobian unless requested 00077 libmesh_assert (request_jacobian || !jacobian_computed); 00078 00079 bool jacobian_computed2 = 00080 _system.side_constraint(jacobian_computed, context); 00081 00082 // The user shouldn't compute a jacobian unless requested 00083 libmesh_assert (jacobian_computed || !jacobian_computed2); 00084 00085 return jacobian_computed2; 00086 } 00087 00088 } // namespace libMesh 00089
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:48 UTC
Hosted By: