COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
gui-main.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2011 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 <QApplication>
10 
11 #include "common/CF.hpp"
12 #include "common/PE/Comm.hpp"
13 #include "common/Core.hpp"
14 #include "common/Environment.hpp"
15 #include "common/NetworkInfo.hpp"
16 #include "common/Exception.hpp"
17 #include "common/OptionList.hpp"
18 
20 
24 
25 using namespace cf3::common;
26 using namespace cf3::Tools::Shell;
27 using namespace cf3::ui::core;
28 using namespace cf3::ui::graphics;
29 
30 int main(int argc, char *argv[])
31 {
32  Application app(argc, argv);
33  int returnValue;
34 
35  JournalBrowserBuilder::instance();
36 
37  ThreadManager::instance().tree();
38 
39  // initiate the core environment
40  Core::instance().environment().options().set("regist_signal_handlers", false);
41  Core::instance().initiate(argc, argv);
42  PE::Comm::instance().init(argc,argv); // this might modify argc and argv
43 
47 
48  // tell CF core that the client is running
50 
51  try
52  {
53  MainWindow window;
54  window.showMaximized();
55  returnValue = app.exec();
56  }
57  catch(Exception e)
58  {
59  std::cerr << "Application stopped on uncaught exception:" << std::endl;
60  std::cerr << e.what() << std::endl;
61  returnValue = -1;
62  }
63 
64  // tell CF core that the client is about to exit
66 
67  // terminate the MPI environment
68 
71 
72  return returnValue;
73 }
bool AssertionThrows
assertions throw exceptions
Definition: Assertions.hpp:67
static AssertionManager & instance()
Gets the instance of the manager.
Definition: Assertions.cpp:33
Base class for all Exceptions in CF.
Definition: Exception.hpp:52
Basic Classes for client-core library used by coolfluid-client application.
Definition: CNode.cpp:57
bool AssertionDumps
assertions dump backtraces
Definition: Assertions.hpp:65
bool ExceptionDumps
if exception contructor should dump backtrace
Definition: Exception.hpp:34
void terminate()
Definition: Core.cpp:131
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.
void initiate(int argc, char **argv)
Definition: Core.cpp:98
void init(int argc=0, char **args=0)
Definition: Comm.cpp:80
static ExceptionManager & instance()
Gets the instance of the manager.
Definition: Exception.cpp:34
int main(int argc, char *argv[])
Definition: gui-main.cpp:30
common::Environment & environment() const
Definition: Core.cpp:168
Basic Classes for Graphics applications used by CF.
coolfluid3 header, included almost everywhere
static Core & instance()
Definition: Core.cpp:37
OptionList & options()
Definition: Component.cpp:856
static Comm & instance()
Return a reference to the current PE.
Definition: Comm.cpp:44
void set(const std::string &pname, const boost::any &val)
Definition: OptionList.cpp:132
Most basic kernel library.
Definition: Action.cpp:19
NetworkInfo & network_info() const
Definition: Core.cpp:216
Client main window.
Definition: MainWindow.hpp:59
Send comments to:
COOLFluiD Web Admin