Moved serial mode to target mcelecron_serial.

Implemented parallelization with mpi.
This commit is contained in:
Christian
2019-07-18 14:02:19 +02:00
parent fd131afdd3
commit 578d673b65
35 changed files with 916 additions and 469 deletions
+27 -3
View File
@@ -6,16 +6,34 @@
// Copyright © 2019 Christian Reiling. All rights reserved.
//
#include <algorithm>
#include "timer.hpp"
#include "read_system.h"
const double Timer::wgtsT2MaxDensity_m3 = load_parameter("wgtsT2MaxDensity_m3");
double Timer::get_physTime_s() {
return double(*numTotDecays)/T2_activity_s + offset_time_s;
const double Timer::wgtsT2MaxDensity_m3 = load_parameter("wgtsT2MaxDensity_m3");
using namespace std;
/*
Timer::Timer(const Timer& other) {
T2_activity_s = other.T2_activity_s;
offset_time_s = other.offset_time_s;
local_decays = &(*other.local_decays);
global_decays = &(*other.global_decays);
}
Timer& Timer::operator=(const Timer& other) {
Timer tmp(other);
swap(T2_activity_s, tmp.T2_activity_s);
swap(offset_time_s, tmp.offset_time_s);
local_decays = &(*tmp.local_decays);
global_decays = &(*tmp.global_decays);
return *this;
}
*/
void Timer::set_T2_activity_s() {
double r_m = r_WGTS_m;
double l_m = l_WGTS_m;
@@ -24,4 +42,10 @@ void Timer::set_T2_activity_s() {
T2_activity_s = NT2*decayConstT2_s;
}
double Timer::get_physTime_s() {
return double(calc_total_decays())/T2_activity_s + offset_time_s;
}
long int Timer::calc_total_decays() {
return (*local_decays + *global_decays);
}