libMesh
Functions
fparser_parse.C File Reference

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 28 of file fparser_parse.C.

References libMesh::out, and libMesh::Real.

29 {
30  using namespace libMesh;
31 
32  if (argc < 2)
33  libmesh_error_msg("Usage: " << argv[0] << " function_to_eval [x] [y] [z] [t]");
34 
35  std::string function_string = argv[1];
36 
37  ParsedFunction<> func(function_string);
38 
39  const Point p ( (argc > 2) ? std::atof(argv[2]) : 0.0,
40  (argc > 3) ? std::atof(argv[3]) : 0.0,
41  (argc > 4) ? std::atof(argv[4]) : 0.0 );
42 
43  const libMesh::Real t = (argc > 5) ? std::atof(argv[5]) : 0.0;
44 
45  const libMesh::Number out = func(p,t);
46 
47  libMesh::out << "out = " << out << std::endl;
48 
49  return 0;
50 }
A Function generated (via FParser) by parsing a mathematical expression.
The libMesh namespace provides an interface to certain functionality in the library.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
OStreamProxy out
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38