add: support for multi process

This commit is contained in:
liuyihui 2022-05-18 23:47:50 +08:00
parent c026f0d6c9
commit 3183f8e6d2
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
# 多线程设置 # 多线程设置
/run/numberOfThreads 1 /run/numberOfThreads 12
# verbose # verbose
/control/verbose 2 /control/verbose 2

View File

@ -12,7 +12,6 @@
G4double M = 931.5; G4double M = 931.5;
G4double C1, C2, C3, C4, sum; G4double C1, C2, C3, C4, sum;
std::ifstream modelFile("assets/model.txt");
PrimaryGeneratorAction::PrimaryGeneratorAction() { PrimaryGeneratorAction::PrimaryGeneratorAction() {
G4ParticleDefinition* ion = DefineParticle(); G4ParticleDefinition* ion = DefineParticle();
@ -29,6 +28,7 @@ PrimaryGeneratorAction::~PrimaryGeneratorAction() { delete fParticleGun; }
G4ParticleDefinition* PrimaryGeneratorAction::DefineParticle() { G4ParticleDefinition* PrimaryGeneratorAction::DefineParticle() {
G4double Z, A; G4double Z, A;
std::string tmp, line, name; std::string tmp, line, name;
std::ifstream modelFile("assets/model.txt");
while (std::getline(modelFile, line)) { while (std::getline(modelFile, line)) {
std::stringstream ss(line); std::stringstream ss(line);