Moved serial mode to target mcelecron_serial.
Implemented parallelization with mpi.
This commit is contained in:
@@ -17,11 +17,11 @@ void EnergeticPop_Container::set_Map() {
|
||||
double Ex_max = ceil(log10(E_max_eV));
|
||||
double step = (Ex_max-Ex_min)/Epoints;
|
||||
double x, E_eV;
|
||||
for (vector<vec3>::iterator Itr = bins.begin(); Itr!=bins.end(); Itr++) {
|
||||
for (vector<vec3>::iterator itr = bins.begin(); itr!=bins.end(); itr++) {
|
||||
for (int i = 1; i<=Epoints; i++) {
|
||||
x = Ex_min + step*i;
|
||||
E_eV = pow(10,x);
|
||||
addPoint(deque<double>{(*Itr)[0], (*Itr)[1], (*Itr)[2], E_eV, 0});
|
||||
addPoint(deque<double>{(*itr)[0], (*itr)[1], (*itr)[2], E_eV, 0});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,8 +37,8 @@ double EnergeticPop_Container::getDensity_m3(const vec3 &locXYZ_m, double physTi
|
||||
double EnergeticPop_Container::get_cumulated_time_s(vec3 zrphiCords) {
|
||||
dim1Map EMap = *getSubMap<dim1Map>(ddeque{zrphiCords[0], zrphiCords[1], zrphiCords[2]}, Lower_bound);
|
||||
double cumTime_s = 0;
|
||||
for (dim1Map::iterator Itr = EMap.begin(); Itr != EMap.end(); Itr++) {
|
||||
cumTime_s +=Itr->second;
|
||||
for (dim1Map::iterator itr = EMap.begin(); itr != EMap.end(); itr++) {
|
||||
cumTime_s +=itr->second;
|
||||
}
|
||||
return cumTime_s;
|
||||
}
|
||||
@@ -62,11 +62,11 @@ void EnergeticPop_Container::upDensity (const Particle &upParticle, const vec3 &
|
||||
double vAbs_ms = upParticle.get_vAbs_ms();
|
||||
double E_eV = upParticle.get_E_eV();
|
||||
|
||||
dim4Map::iterator zItr_min = Map.lower_bound(z_min_m);
|
||||
dim4Map::iterator zItr_max = Map.lower_bound(z_max_m);
|
||||
dim4Map::iterator zitr_min = Map.lower_bound(z_min_m);
|
||||
dim4Map::iterator zitr_max = Map.lower_bound(z_max_m);
|
||||
|
||||
for (dim4Map::iterator Itr = zItr_min;Itr != zItr_max;Itr++) {
|
||||
Itr->second.lower_bound(r_m)->second.lower_bound(phi)->second.lower_bound(E_eV)->second += l_m/vAbs_ms;
|
||||
for (dim4Map::iterator itr = zitr_min;itr != zitr_max;itr++) {
|
||||
itr->second.lower_bound(r_m)->second.lower_bound(phi)->second.lower_bound(E_eV)->second += l_m/vAbs_ms;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,17 +79,17 @@ double EnergeticPop_Container::roll_Energy_eV(const vec3 &locXYZ_m, UniRNG *rngU
|
||||
|
||||
double targetTime_s = rngUni->random() * get_cumulated_time_s(zrphiCords);
|
||||
double summedTime_s = 0;
|
||||
dim1Map::iterator Itr = EMap.begin();
|
||||
dim1Map::iterator itr = EMap.begin();
|
||||
do {
|
||||
summedTime_s += Itr->second;
|
||||
Itr++;
|
||||
summedTime_s += itr->second;
|
||||
itr++;
|
||||
} while(summedTime_s < targetTime_s);
|
||||
Itr--;
|
||||
itr--;
|
||||
|
||||
if (Itr == EMap.begin() ) {
|
||||
return Itr->first;
|
||||
if (itr == EMap.begin() ) {
|
||||
return itr->first;
|
||||
} else {
|
||||
double E_eV = ( (Itr->first) + ((--Itr)->first) )/2;
|
||||
double E_eV = ( (itr->first) + ((--itr)->first) )/2;
|
||||
return E_eV;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user