GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMS.hh
Go to the documentation of this file.
1 #ifndef GUARD_GGEMS_GLOBAL_GGEMS_HH
2 #define GUARD_GGEMS_GLOBAL_GGEMS_HH
3 
4 // ************************************************************************
5 // * This file is part of GGEMS. *
6 // * *
7 // * GGEMS is free software: you can redistribute it and/or modify *
8 // * it under the terms of the GNU General Public License as published by *
9 // * the Free Software Foundation, either version 3 of the License, or *
10 // * (at your option) any later version. *
11 // * *
12 // * GGEMS is distributed in the hope that it will be useful, *
13 // * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 // * GNU General Public License for more details. *
16 // * *
17 // * You should have received a copy of the GNU General Public License *
18 // * along with GGEMS. If not, see <https://www.gnu.org/licenses/>. *
19 // * *
20 // ************************************************************************
21 
34 #ifdef _MSC_VER
35 #pragma warning(disable: 4251) // Deleting warning exporting STL members!!!
36 #endif
37 
38 #include <cstdint>
39 #include <string>
40 #include <vector>
41 
42 #include "GGEMS/global/GGEMSExport.hh"
43 
45 
50 class GGEMS_EXPORT GGEMS
51 {
52  public:
56  GGEMS(void);
57 
61  ~GGEMS(void);
62 
68  GGEMS(GGEMS const& ggems) = delete;
69 
75  GGEMS& operator=(GGEMS const& ggems) = delete;
76 
82  GGEMS(GGEMS const&& ggems) = delete;
83 
89  GGEMS& operator=(GGEMS const&& ggems) = delete;
90 
96  void Initialize(GGuint const& seed = 0);
97 
102  void Run(void);
103 
109  void SetOpenCLVerbose(bool const& is_opencl_verbose);
110 
116  void SetMaterialDatabaseVerbose(bool const& is_material_database_verbose);
117 
123  void SetSourceVerbose(bool const& is_source_verbose);
124 
130  void SetNavigatorVerbose(bool const& is_navigator_verbose);
131 
137  void SetMemoryRAMVerbose(bool const& is_memory_ram_verbose);
138 
144  void SetProcessVerbose(bool const& is_process_verbose);
145 
151  void SetRangeCutsVerbose(bool const& is_range_cuts_verbose);
152 
158  void SetRandomVerbose(bool const& is_random_verbose);
159 
165  void SetProfilingVerbose(bool const& is_profiling_verbose);
166 
172  inline bool IsProfilingVerbose(void) const {return is_profiling_verbose_;};
173 
180  void SetTrackingVerbose(bool const& is_tracking_verbose, GGint const& particle_tracking_id);
181 
187  inline bool IsTrackingVerbose(void) const {return is_tracking_verbose_;};
188 
194  inline GGint GetParticleTrackingID(void) const {return particle_tracking_id_;};
195 
196  private:
201  void PrintBanner(void) const;
202 
208  void RunOnDevice(GGsize const& thread_index);
209 
210  private: // Global simulation parameters
222 };
223 
229 extern "C" GGEMS_EXPORT GGEMS* create_ggems(void);
230 
236 extern "C" GGEMS_EXPORT void delete_ggems(GGEMS* ggems);
237 
244 extern "C" GGEMS_EXPORT void initialize_ggems(GGEMS* ggems, GGuint const seed);
245 
252 extern "C" GGEMS_EXPORT void set_opencl_verbose_ggems(GGEMS* ggems, bool const is_opencl_verbose);
253 
260 extern "C" GGEMS_EXPORT void set_material_database_verbose_ggems(GGEMS* ggems, bool const is_material_database_verbose);
261 
268 extern "C" GGEMS_EXPORT void set_source_ggems(GGEMS* ggems, bool const is_source_verbose);
269 
276 extern "C" GGEMS_EXPORT void set_navigator_ggems(GGEMS* ggems, bool const is_navigator_verbose);
277 
284 extern "C" GGEMS_EXPORT void set_memory_ram_ggems(GGEMS* ggems, bool const is_memory_ram_verbose);
285 
292 extern "C" GGEMS_EXPORT void set_process_ggems(GGEMS* ggems, bool const is_process_verbose);
293 
300 extern "C" GGEMS_EXPORT void set_range_cuts_ggems(GGEMS* ggems, bool const is_range_cuts_verbose);
301 
308 extern "C" GGEMS_EXPORT void set_random_ggems(GGEMS* ggems, bool const is_random_verbose);
309 
316 extern "C" GGEMS_EXPORT void set_profiling_ggems(GGEMS* ggems, bool const is_profiling_verbose);
317 
325 extern "C" GGEMS_EXPORT void set_tracking_ggems(GGEMS* ggems, bool const is_tracking_verbose, GGint const particle_id_tracking);
326 
332 extern "C" GGEMS_EXPORT void run_ggems(GGEMS* ggems);
333 
334 #endif // End of GUARD_GGEMS_GLOBAL_GGEMS_HH
GGEMS::is_tracking_verbose_
bool is_tracking_verbose_
Definition: GGEMS.hh:219
GGEMS::GGEMS
GGEMS(GGEMS const &&ggems)=delete
Avoid copy of the class by rvalue reference.
GGEMS::operator=
GGEMS & operator=(GGEMS const &ggems)=delete
Avoid assignement of the class by reference.
GGEMS::operator=
GGEMS & operator=(GGEMS const &&ggems)=delete
Avoid copy of the class by rvalue reference.
GGEMS::is_range_cuts_verbose_
bool is_range_cuts_verbose_
Definition: GGEMS.hh:217
GGEMS::GetParticleTrackingID
GGint GetParticleTrackingID(void) const
get the id of the particle to track
Definition: GGEMS.hh:194
set_process_ggems
void set_process_ggems(GGEMS *ggems, bool const is_process_verbose)
Set the processes verbosity.
Definition: GGEMS.cc:440
set_tracking_ggems
void set_tracking_ggems(GGEMS *ggems, bool const is_tracking_verbose, GGint const particle_id_tracking)
Set the tracking verbosity.
Definition: GGEMS.cc:476
GGEMS::is_process_verbose_
bool is_process_verbose_
Definition: GGEMS.hh:216
set_source_ggems
void set_source_ggems(GGEMS *ggems, bool const is_source_verbose)
Set the source verbosity.
Definition: GGEMS.cc:413
GGEMS::is_source_verbose_
bool is_source_verbose_
Definition: GGEMS.hh:213
GGEMS::is_opencl_verbose_
bool is_opencl_verbose_
Definition: GGEMS.hh:211
set_profiling_ggems
void set_profiling_ggems(GGEMS *ggems, bool const is_profiling_verbose)
Set the profiling verbosity.
Definition: GGEMS.cc:467
set_range_cuts_ggems
void set_range_cuts_ggems(GGEMS *ggems, bool const is_range_cuts_verbose)
Set the range cuts verbosity.
Definition: GGEMS.cc:449
GGEMS::IsProfilingVerbose
bool IsProfilingVerbose(void) const
get the profiling verbosity flag
Definition: GGEMS.hh:172
create_ggems
GGEMS * create_ggems(void)
Get the GGEMS pointer for python user.
Definition: GGEMS.cc:365
initialize_ggems
void initialize_ggems(GGEMS *ggems, GGuint const seed)
Initialize GGEMS simulation.
Definition: GGEMS.cc:386
GGsize
#define GGsize
Definition: GGEMSTypes.hh:252
GGint
#define GGint
Definition: GGEMSTypes.hh:224
run_ggems
void run_ggems(GGEMS *ggems)
Run the GGEMS simulation.
Definition: GGEMS.cc:485
GGEMS
GGEMS class managing the complete simulation.
Definition: GGEMS.hh:51
GGEMS::is_random_verbose_
bool is_random_verbose_
Definition: GGEMS.hh:218
GGEMS::is_navigator_verbose_
bool is_navigator_verbose_
Definition: GGEMS.hh:214
GGEMSTypes.hh
Redefining types for OpenCL device and host.
GGEMS::GGEMS
GGEMS(GGEMS const &ggems)=delete
Avoid copy of the class by reference.
GGEMS::IsTrackingVerbose
bool IsTrackingVerbose(void) const
get the tracking verbosity flag
Definition: GGEMS.hh:187
GGEMS::is_profiling_verbose_
bool is_profiling_verbose_
Definition: GGEMS.hh:220
set_material_database_verbose_ggems
void set_material_database_verbose_ggems(GGEMS *ggems, bool const is_material_database_verbose)
Set the material database verbosity.
Definition: GGEMS.cc:404
GGEMS::is_material_database_verbose_
bool is_material_database_verbose_
Definition: GGEMS.hh:212
set_memory_ram_ggems
void set_memory_ram_ggems(GGEMS *ggems, bool const is_memory_ram_verbose)
Set the memory RAM verbosity.
Definition: GGEMS.cc:431
GGEMS::is_memory_ram_verbose_
bool is_memory_ram_verbose_
Definition: GGEMS.hh:215
GGuint
#define GGuint
Definition: GGEMSTypes.hh:231
set_navigator_ggems
void set_navigator_ggems(GGEMS *ggems, bool const is_navigator_verbose)
Set the navigator verbosity.
Definition: GGEMS.cc:422
GGEMS::particle_tracking_id_
GGint particle_tracking_id_
Definition: GGEMS.hh:221
set_random_ggems
void set_random_ggems(GGEMS *ggems, bool const is_random_verbose)
Set the random verbosity.
Definition: GGEMS.cc:458
set_opencl_verbose_ggems
void set_opencl_verbose_ggems(GGEMS *ggems, bool const is_opencl_verbose)
Set the OpenCL verbosity.
Definition: GGEMS.cc:395
delete_ggems
void delete_ggems(GGEMS *ggems)
Delete GGEMS pointer.
Definition: GGEMS.cc:374