GranOO  3.0
A robust and versatile workbench to build 3D dynamic simulations based on the Discrete Element Method
Logger.hpp
Go to the documentation of this file.
1 // This file is part of GranOO, a workbench for DEM simulation.
2 //
3 // Author(s) : - Damien Andre IRCER/UNILIM, Limoges France
4 // <damien.andre@unilim.fr>
5 // - Jean-luc Charles Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
6 // <jean-luc.charles@ensam.eu>
7 // - Jeremie Girardot Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
8 // <jeremie.girardot@ensam.eu>
9 // - Cedric Hubert LAMIH/UPHF, Valenciennes France
10 // <cedric.hubert@uphf.fr>
11 // - Ivan Iordanoff Arts et Metiers ParisTech, CNRS, I2M, Bordeaux France
12 // <ivan.iordanoff@ensam.eu>
13 // - Lucas Teixeira, RHI Magnesita, 8700 Leoben, Autriche
14 // <lucas.teixeira@rhimagnesita.com>
15 //
16 // Copyright (C) 2008-2022 D. Andre, JL. Charles, J. Girardot, C. Hubert, I. Iordanoff, L. Teixeira
17 //
18 // This program is free software: you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation, either version 3 of the License, or
21 // (at your option) any later version.
22 //
23 // This program is distributed in the hope that it will be useful,
24 // but WITHOUT ANY WARRANTY; without even the implied warranty of
25 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 // GNU General Public License for more details.
27 //
28 // You should have received a copy of the GNU General Public License
29 // along with this program. If not, see <http://www.gnu.org/licenses/>.
30 
31 
32 #ifndef _libCore_Logger_hpp_
33 #define _libCore_Logger_hpp_
34 
35 #include <string>
36 
37 #include <boost/program_options.hpp>
38 #include <boost/filesystem/path.hpp>
39 
40 #include "GranOO3/Core/PlugIn.hpp"
41 
42 namespace po = boost::program_options;
43 
44 namespace GranOO3
45 {
46  namespace Core
47  {
48  class Logger{
49  public:
50  Logger();
51 
52  std::string directory_already_exists(const std::string&);
53  std::string cant_read(const std::string&);
54  std::string cant_detect_number_processors();
55  std::string invalid_thread_number(const std::string&);
56  std::string file_already_exists(const std::string&);
57  std::string cant_create(boost::filesystem::path);
58 
59  void granoo_start();
60  void granoo_run();
61  void granoo_init();
62  void granoo_stop();
63  void io_info(const std::string&, const std::string&, const unsigned int);
64  void read_inp(const std::string&);
65  void reading_in_file(const std::string&, boost::filesystem::path,
66  const std::string&);
67  void calculation_info(const std::string&, const std::string&,
68  double, unsigned int, const std::vector<Core::PlugIn*> &);
69 
70  std::string problem_description();
71  std::string run_example();
72  std::string ramp_and_constant();
73  std::string uni_random();
74  std::string normal_random();
75  std::string sine_ramp();
76  std::string cycle4();
77  std::string cycle5();
78  std::string exit_request();
79  std::string too_many_threads_required();
80 
81  po::options_description program_options(int argc, char * argv[]);
82 
83  const std::string& get_command() const;
84  void set_command(int, char * []);
85  void system_info();
86 
87  private:
88  std::string get_temporary_file_name();
89  void get_system_info(const std::string&, const std::string&);
90 
91  std::string _command;
92  std::string _elapsed_str = "Elapsed time for PlugIn";
93  std::string _elapsed_str_mt = "Elapsed time for PlugIn (MT)";
94  };
95  }
96 }
97 
98 #endif
Definition: Logger.hpp:48
void calculation_info(const std::string &, const std::string &, double, unsigned int, const std::vector< Core::PlugIn * > &)
Definition: Logger.cpp:125
std::string _elapsed_str
Definition: Logger.hpp:92
void granoo_run()
Definition: Logger.cpp:92
std::string cycle4()
Definition: Logger.cpp:283
void read_inp(const std::string &)
Definition: Logger.cpp:114
const std::string & get_command() const
Definition: Logger.cpp:389
std::string problem_description()
Definition: Logger.cpp:159
void granoo_start()
Definition: Logger.cpp:86
std::string cycle5()
Definition: Logger.cpp:306
void get_system_info(const std::string &, const std::string &)
Definition: Logger.cpp:405
void set_command(int, char *[])
Definition: Logger.cpp:393
std::string cant_read(const std::string &)
Definition: Logger.cpp:64
std::string _command
Definition: Logger.hpp:91
std::string exit_request()
Definition: Logger.cpp:332
std::string file_already_exists(const std::string &)
Definition: Logger.cpp:78
std::string _elapsed_str_mt
Definition: Logger.hpp:93
std::string ramp_and_constant()
Definition: Logger.cpp:236
std::string get_temporary_file_name()
Definition: Logger.cpp:398
void granoo_init()
Definition: Logger.cpp:97
std::string invalid_thread_number(const std::string &)
Definition: Logger.cpp:73
std::string uni_random()
Definition: Logger.cpp:251
std::string sine_ramp()
Definition: Logger.cpp:264
void reading_in_file(const std::string &, boost::filesystem::path, const std::string &)
Definition: Logger.cpp:118
std::string run_example()
Definition: Logger.cpp:198
std::string cant_detect_number_processors()
Definition: Logger.cpp:69
Logger()
Definition: Logger.cpp:51
po::options_description program_options(int argc, char *argv[])
Definition: Logger.cpp:347
std::string directory_already_exists(const std::string &)
Definition: Logger.cpp:55
std::string normal_random()
Definition: Logger.cpp:257
std::string cant_create(boost::filesystem::path)
Definition: Logger.cpp:82
void granoo_stop()
Definition: Logger.cpp:102
void io_info(const std::string &, const std::string &, const unsigned int)
Definition: Logger.cpp:107
void system_info()
Definition: Logger.cpp:437
std::string too_many_threads_required()
Definition: Logger.cpp:339
Definition: Common.hpp:198