An open source method of characteristics neutron transport code.
Progress.h
Go to the documentation of this file.
1 
8 #ifndef PROGRESS_H_
9 #define PROGRESS_H_
10 
11 
12 #ifdef __cplusplus
13 #include <math.h>
14 #include <map>
15 #include <vector>
16 #include <string>
17 #include <iostream>
18 #include <sstream>
19 #include <stdlib.h>
20 #include <stdio.h>
21 #include <string>
22 #include <iomanip>
23 #include <omp.h>
24 #include "log.h"
25 #endif
26 
27 #ifdef MPIx
28 #include <mpi.h>
29 #endif
30 
31 class Geometry;
32 
33 class Progress {
34 
35 private:
36 
37  std::string _name;
38  long _counter;
39  long _num_iterations;
40  int _curr_interval;
41  std::vector<long> _intervals;
42  Geometry* _geometry;
43  bool _mpi_comm;
44 
45 public:
46  Progress(long num_iterations, std::string name, double interval=0.1,
47  Geometry* geometry=NULL, bool mpi_comm=false);
48  virtual ~Progress();
49 
50  /* Worker functions */
51  void incrementCounter();
52  void reset();
53 };
54 
55 #endif /* PROGRESS_H_ */
The master class containing references to all geometry-related objects - Surfaces, Cells, Universes and Lattices - and Materials.
Definition: Geometry.h:122
void reset()
Reset the counter.
Definition: Progress.cpp:85
Definition: Progress.h:33
virtual ~Progress()
Destructor for Progress.
Definition: Progress.cpp:39
Progress(long num_iterations, std::string name, double interval=0.1, Geometry *geometry=NULL, bool mpi_comm=false)
Constructor for Progress.
Definition: Progress.cpp:7
void incrementCounter()
Increment the counter, print log if it has reached an interval bound.
Definition: Progress.cpp:46
Utility functions for writing log messages to the screen.