GRINS-0.6.0
parsed_viscosity.C
Go to the documentation of this file.
1 // Public License as published by the Free Software Foundation.
2 //
3 // This library is distributed in the hope that it will be useful,
4 // but WITHOUT ANY WARRANTY; without even the implied warranty of
5 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6 // Lesser General Public License for more details.
7 //
8 // You should have received a copy of the GNU Lesser General Public
9 // License along with this library; if not, write to the Free Software
10 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
11 // Boston, MA 02110-1301 USA
12 //
13 //-----------------------------------------------------------------------el-
14 
15 
16 // This class
17 #include "grins/parsed_viscosity.h"
18 
19 //GRINS
21 
22 // libMesh
23 #include "libmesh/getpot.h"
24 #include "libmesh/parsed_function.h"
25 
26 namespace GRINS
27 {
28 
29  ParsedViscosity::ParsedViscosity( const GetPot& input ) :
30  ParameterUser("ParsedViscosity")
31  {
32  if( !input.have_variable("Materials/Viscosity/mu") )
33  {
34  std::cerr<<"No viscosity has been specified."<<std::endl;
35 
36  libmesh_error();
37  }
38  else
39  {
40  std::string viscosity_function = input("Materials/Viscosity/mu",std::string("0"));
41 
42  mu.reset(new libMesh::ParsedFunction<libMesh::Number>(viscosity_function));
43 
44  if (viscosity_function == "0")
45  {
46  std::cerr << "Warning! Zero Viscosity specified!" << std::endl;
47 
48  libmesh_error();
49  }
50  }
51 
52  return;
53  }
54 
56  {
57  return;
58  }
59 
60 } // namespace GRINS
libMesh::AutoPtr< libMesh::FunctionBase< libMesh::Number > > mu
GRINS namespace.
ParameterUser base class. Utility methods for subclasses.

Generated on Mon Jun 22 2015 21:32:20 for GRINS-0.6.0 by  doxygen 1.8.9.1