Bug fixed, where check_EnergyTermination was used instead of check_Termination.
Changed check_EnergyTermination and check_WallTermination to private methods. Minor change for status updater: Set updater Rate to 1% steps.
This commit is contained in:
@@ -54,11 +54,11 @@ private:
|
||||
// Terminate Electrons
|
||||
public:
|
||||
bool check_Termination(Electron checkElectron);
|
||||
private:
|
||||
bool check_EnergyTermination(double Ekin_eV);
|
||||
bool check_EnergyTermination(Electron checkElectron);
|
||||
bool check_WallTermination(vec3 loc_m);
|
||||
bool check_WallTermination(Electron checkElectron);
|
||||
private:
|
||||
double cutoffEnergy_eV;
|
||||
void set_cutoffEnergy_eV();
|
||||
};
|
||||
|
||||
@@ -19,6 +19,7 @@ using namespace std;
|
||||
Simulation::Simulation() {
|
||||
numberElectrons = 0;
|
||||
rngUni.seed(seed);
|
||||
updater_fraction = numTotalElectrons/100;
|
||||
updater_numberOfPrevious = 0;
|
||||
|
||||
}
|
||||
@@ -33,10 +34,10 @@ void Simulation::doit() {
|
||||
|
||||
status_updater();
|
||||
move_electron(&electronQue.front(), &Log);
|
||||
if (!Kat.check_EnergyTermination (electronQue.front()) ) {
|
||||
if (!Kat.check_Termination (electronQue.front()) ) {
|
||||
do_interaction(&electronQue.front());
|
||||
}
|
||||
if (Kat.check_EnergyTermination (electronQue.front())) {
|
||||
if (Kat.check_Termination (electronQue.front())) {
|
||||
electronQue.pop_front();
|
||||
}
|
||||
}
|
||||
@@ -60,7 +61,7 @@ void Simulation::doTC6() {
|
||||
};
|
||||
|
||||
void Simulation::status_updater() {
|
||||
if (numberElectrons%100 == 0){
|
||||
if (numberElectrons%updater_fraction == 0){
|
||||
if (updater_numberOfPrevious!=numberElectrons) {
|
||||
cout<<numberElectrons<<"/"<<numTotalElectrons<<endl;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ private:
|
||||
int numberElectrons;
|
||||
std::deque<Electron> electronQue;
|
||||
int updater_numberOfPrevious;
|
||||
int updater_fraction;
|
||||
|
||||
public:
|
||||
void doTC6();
|
||||
|
||||
Reference in New Issue
Block a user