GRINS-0.7.0
strategies_parsing.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2016 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 // These functions
27 
28 // libMesh
29 #include "libmesh/getpot.h"
30 #include "libmesh/system_norm.h"
31 
32 namespace GRINS
33 {
34 
35  int StrategiesParsing::extra_quadrature_order( const GetPot& input )
36  {
37  int extra_order = input("Strategies/Assembly/extra_quadrature_order", 0);
38 
39  if( extra_order < 0 )
40  libmesh_error_msg("ERROR: extra_quadrature_order must be non-negative!");
41 
42  return extra_order;
43  }
44 
45  bool StrategiesParsing::do_adjoint_solve( const GetPot& input )
46  {
47  bool do_adjoint_solve = false;
48  std::string old_option = "linear-nonlinear-solver/do_adjoint_solve";
49  std::string new_option = "Strategies/Adjoint/do_adjoint_solve";
50 
51  bool have_old_option = input.have_variable(old_option);
52  bool have_new_option = input.have_variable(new_option);
53  if( have_old_option && have_new_option )
54  libmesh_error_msg("ERROR: Cannot specify both "+old_option+" and "+new_option+"!");
55 
56  if( have_old_option )
57  do_adjoint_solve = input( old_option, false );
58 
59  if( have_new_option )
60  do_adjoint_solve = input( new_option, false );
61 
62  return do_adjoint_solve;
63  }
64 } // end namespace GRINS
static bool do_adjoint_solve(const GetPot &input)
Option to let user manually trigger adjoint solve.
GRINS namespace.
static int extra_quadrature_order(const GetPot &input)

Generated on Thu Jun 2 2016 21:52:28 for GRINS-0.7.0 by  doxygen 1.8.10