COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
coolfluid-mesh-transformer.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2013 von Karman Institute for Fluid Dynamics, Belgium
2 //
3 // This software is distributed under the terms of the
4 // GNU Lesser General Public License version 3 (LGPLv3).
5 // See doc/lgpl.txt and doc/gpl.txt for the license text.
6 
7 #include <iostream>
8 
9 #include <boost/program_options.hpp>
10 #include <boost/regex.hpp>
11 
12 #include "common/Log.hpp"
13 #include "common/Core.hpp"
14 #include "common/Foreach.hpp"
15 
16 #include "mesh/Mesh.hpp"
17 
22 
23 using namespace boost;
24 using namespace boost::program_options;
25 
26 using namespace cf3;
27 using namespace cf3::common;
28 using namespace cf3::mesh;
29 using namespace cf3::Tools::Shell;
30 using namespace cf3::Tools::mesh_transformer;
31 
33 
34 int main(int argc, char * argv[])
35 {
36  PE::Comm::instance().init(argc, argv);
37  Core::instance().initiate(argc, argv);
38 
39  try
40  {
41 
42  // --------------------------------------------------------
43 
44  ExceptionManager::instance().ExceptionDumps = false;
45  ExceptionManager::instance().ExceptionOutputs = false;
46  ExceptionManager::instance().ExceptionAborts = false;
47 
48  // create mesh object
49  Component& root = Core::instance().root();
50  Handle<Mesh> mesh = root.create_component<Mesh>("mesh");
51 
52  // Initialize empty commands
53  options_description desc;
54 
55  desc.add(Help(desc));
56 
57  // Add basic commands to program
58  desc.add(BasicCommands::description());
59 
60  // Add mesh transformer commands to program
61  desc.add(Transformer::description());
62 
63  // Parse commands that are passed directly on the command line
64  Interpreter shell(desc);
65  shell.interpret(argc,argv);
66 
67  // --------------------------------------------------------
68 
69  }
70  catch(Exception & e)
71  {
72  std::cerr << e.what() << CFendl;
73  }
74  catch ( std::exception& ex )
75  {
76  CFerror << "Unhandled exception caught at " << FromHere().short_str() << ": " << ex.what() << CFendl;
77  }
78  catch ( ... )
79  {
80  CFerror << "Detected unknown exception" << CFendl;
81  }
82 
83  Core::instance().terminate();
84  PE::Comm::instance().finalize();
85 
86  return 0;
87 }
external boost library namespace
Base class for all Exceptions in CF.
Definition: Exception.hpp:52
Command Line and script interpreter.
Definition: Interpreter.hpp:43
tuple root
Definition: coolfluid.py:24
#define CFendl
Definition: Log.hpp:109
Real e()
Definition of the Unit charge [C].
Definition: Consts.hpp:30
const char * what() const
Definition: Exception.cpp:90
Classes for command line interpreting COOLFluiD.
Basic Classes for Mesh applications used by COOLFluiD.
Top-level namespace for coolfluid.
Definition: Action.cpp:18
LoadBalance::LoadBalance(const std::string &name) std::string desc
Definition: LoadBalance.cpp:35
int main(int argc, char *argv[])
#define CFerror
Definition: Log.hpp:105
Base class for defining CF components.
Definition: Component.hpp:82
Handle< Component > create_component(const std::string &name, const std::string &builder)
Build a (sub)component of this component using the extended type_name of the component.
Definition: Component.cpp:568
Most basic kernel library.
Definition: Action.cpp:19
void interpret(std::istream &input_stream)
Start interpreting an input_stream.
#define FromHere()
Send comments to:
COOLFluiD Web Admin