CLI::Timer renamed to remove compiler errors

This commit is contained in:
Hamidreza Norouzi 2023-03-30 15:07:45 -07:00
parent 58954fcb23
commit e8e093dbfc
5 changed files with 20 additions and 11 deletions

View File

@ -822,7 +822,8 @@ WARN_LOGFILE =
INPUT = $(pFlow_PROJECT_DIR)/src \
$(pFlow_PROJECT_DIR)/utilities \
$(pFlow_PROJECT_DIR)/solvers \
mdDocs
mdDocs \
$(pFlow_PROJECT_DIR)/tutorials
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@ -866,7 +867,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE = $(pFlow_PROJECT_DIR)/src/phasicFlow/commandLine
EXCLUDE = $(pFlow_PROJECT_DIR)/src/phasicFlow/commandLine/CLI
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded

View File

@ -123,17 +123,19 @@ After building, `bin`, `include`, and `lib` folders will be created in `~/Phasic
**note 1**: When compiling the code in parallel, you need to have enough RAM on your computer. As a rule, you need 1 GB free RAM per each processor in your computer for compiling in parallel.
You may want to use fewer number of cores on your computer by using the following command:
`$ make install -j 3`
the above command uses only 3 cores for compiling.
the above command only uses 3 cores for compiling.
**note 2**: By default PhasicFlow is compiled with **double** as floating point variable. You can compile it with **float**. Just in the command line of camke added `-DpFlow_Build_Double=Off` flag to compile it with float. For example if you are building for cuda, you can enter the following command:
`$ cmake ../ -DpFlow_Build_Cuda=On --DpFlow_Build_Double=Off`
`$ cmake ../ -DpFlow_Build_Cuda=On -DpFlow_Build_Double=Off`
### Step 6: Testing
In the current terminal or a new terminal enter the following command:
`$ ~checkPhasicFlow`
`$ checkPhasicFlow`
This command shows the host and device environments and software version. If PhasicFlow was build correctly, you would get the following output:
```

View File

@ -0,0 +1,5 @@
# How to use PhasicFlow {#howToUsePhasicFlow}
Here you will learn how to use PhasicFlow to setup a granular flow simulation. The inputs for simulation are supplied through some text-based files, called file dictionary, located in two folders: `settings` and `caseSetup`. These folders are located under the root case directory.
All the commands are performed through terminal in which the current working directory is root case directory (you see `settings` and `caseSetup` folders when `ls` command is entered). The states of geometry and particles are stored in time folders with names that represent the time. When simulation is finished, one case use post-processing tool pFlowToVTK to convert the stored results in the time folder into VTK file format. The VTK file format can be read by Paraview.
A set of tutorials with detailed descriptions are provided to show you how to use PhasicFlow for various granular flow problems. Here is a list of them.
* [Small rotating drum] (@ref rotatingDrumSmall)

View File

@ -22,7 +22,7 @@
namespace CLI {
/// This is a simple timer with pretty printing. Creating the timer starts counting.
class Timer {
class cliTimer {
protected:
/// This is a typedef to make clocks easier to use
using clock = std::chrono::steady_clock;
@ -57,7 +57,7 @@ class Timer {
public:
/// Standard constructor, can set title and print function
explicit Timer(std::string title = "Timer", time_print_t time_print = Simple)
explicit cliTimer(std::string title = "cliTimer", time_print_t time_print = Simple)
: title_(std::move(title)), time_print_(std::move(time_print)), start_(clock::now()) {}
/// Time a function by running it multiple times. Target time is the len to target.
@ -111,17 +111,17 @@ class Timer {
std::string to_string() const { return time_print_(title_, make_time_str()); }
/// Division sets the number of cycles to divide by (no graphical change)
Timer &operator/(std::size_t val) {
cliTimer &operator/(std::size_t val) {
cycles = val;
return *this;
}
};
/// This class prints out the time upon destruction
class AutoTimer : public Timer {
class AutoTimer : public cliTimer {
public:
/// Reimplementing the constructor is required in GCC 4.7
explicit AutoTimer(std::string title = "Timer", time_print_t time_print = Simple) : Timer(title, time_print) {}
explicit AutoTimer(std::string title = "cliTimer", time_print_t time_print = Simple) : cliTimer(title, time_print) {}
// GCC 4.7 does not support using inheriting constructors.
/// This destructor prints the string
@ -131,4 +131,4 @@ class AutoTimer : public Timer {
} // namespace CLI
/// This prints out the time if shifted into a std::cout like stream.
inline std::ostream &operator<<(std::ostream &in, const CLI::Timer &timer) { return in << timer.to_string(); }
inline std::ostream &operator<<(std::ostream &in, const CLI::cliTimer &timer) { return in << timer.to_string(); }

View File

@ -1,3 +1,4 @@
# Simulating a small rotating drum {#rotatingDrumSmall}
## Problem definition
The problem is to simulate a rotating drum with the diameter 0.24 m and the length 0.1 m rotating at 11.6 rpm. It is filled with 30,000 4-mm spherical particles. The timestep for integration is 0.00001 s.
<div align="center"><b>