Changeset 418 in PSPA for Interface_Web/trunk/pspaWT/sources/controler/src/elementRfgun.cc
- Timestamp:
- Jun 21, 2013, 10:16:56 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/controler/src/elementRfgun.cc
r387 r418 15 15 parametersString_ = new string[nbParam_+1]; 16 16 // parmelaOk_ = true; 17 registerAcceptableSoftware(nomDeLogiciel::parmela, TBoolOk);18 registerAcceptableSoftware(nomDeLogiciel::generator, TBoolOk);17 // registerAcceptableSoftware(nomDeLogiciel::parmela, TBoolOk); 18 // registerAcceptableSoftware(nomDeLogiciel::generator, TBoolOk); 19 19 } 20 20 21 21 void elementRfgun::setDefaultValues() 22 22 { 23 default Label_ = "rfgun";23 defaultSpecificName_ = "rfgun"; 24 24 defaultPhaseStep_ = 1.0; 25 25 defaultNmacrop_ = 0; … … 36 36 void elementRfgun::setDefaults() 37 37 { 38 label_ = defaultLabel_;38 specificName_ = defaultSpecificName_; 39 39 phaseStep_ = defaultPhaseStep_; 40 40 nmacrop_ = defaultNmacrop_; … … 54 54 int compteur = -1; 55 55 parametersString_[++compteur] = mixedTools::intToString(nbParam_); 56 parametersString_[++compteur] = label_;56 parametersString_[++compteur] = specificName_; 57 57 parametersString_[++compteur] = mixedTools::intToString(nmacrop_); 58 58 parametersString_[++compteur] = mixedTools::doubleToString(sigma_t_); … … 81 81 } 82 82 83 label_ = param[++compteur];83 specificName_ = param[++compteur]; 84 84 nmacrop_ = atoi(param[++compteur].c_str()); 85 85 sigma_t_ = atof(param[++compteur].c_str()); … … 93 93 } 94 94 95 string elementRfgun::parmelaOutputFlow() const96 {97 ostringstream sortie;98 // on prend les troncatures tmax et rmax à 3 sigmas99 sortie << "INPUT 10 /np=" << nmacrop_ << " /sigt=" << sigma_t_ << endl;100 sortie << " /tmax=" << 3.3*sigma_t_ << " /sigr=" << sigma_r_ << endl;101 sortie << " /rmax=" << 3.0*sigma_r_ << " /W0=" << E_cin_ << " /dw0=" << sigma_E_ << endl;102 sortie << " /dwt=" << phaseStep_ << " /ran=2" << endl;103 104 // on doit entrer le nb vrai de part. (avec signe moins)95 // string elementRfgun::parmelaOutputFlow() const 96 // { 97 // ostringstream sortie; 98 // // on prend les troncatures tmax et rmax à 3 sigmas 99 // sortie << "INPUT 10 /np=" << nmacrop_ << " /sigt=" << sigma_t_ << endl; 100 // sortie << " /tmax=" << 3.3*sigma_t_ << " /sigr=" << sigma_r_ << endl; 101 // sortie << " /rmax=" << 3.0*sigma_r_ << " /W0=" << E_cin_ << " /dw0=" << sigma_E_ << endl; 102 // sortie << " /dwt=" << phaseStep_ << " /ran=2" << endl; 103 104 // // on doit entrer le nb vrai de part. (avec signe moins) 105 105 106 106 107 sortie << "SCHEFF /beami=" << -fabs(totalCharge_)/ELECTRONANOCOULOMB << " /nprog=2 /point=-1.7" << endl;107 // sortie << "SCHEFF /beami=" << -fabs(totalCharge_)/ELECTRONANOCOULOMB << " /nprog=2 /point=-1.7" << endl; 108 108 109 return sortie.str();110 }111 112 string elementRfgun::generatorOutputFlow() const {113 ostringstream sortie;114 sortie << "Ipart=" << nmacrop_ << endl;115 116 sortie << "Probe=.True." << endl;117 sortie << "Noise_reduc=.T" << endl;118 sortie << "Cathode=.T." << endl;119 sortie << "Q_total=" << totalCharge_ << endl;120 sortie << "Ref_zpos=0.0" << endl;121 sortie << "Ref_clock=0.0" << endl;122 sortie << "Ref_Ekin=" << E_cin_ << endl; // tjs en MeV123 sortie << "Dist_z='g'" << endl;124 sortie << "sig_clock=" << 1.0e-3*sigma_t_ << endl; // passage de ps en ns125 sortie << "Dist_pz='g', sig_Ekin=" << 1000.*sigma_E_ << ", emit_z=0.0 , cor_Ekin=0.0 " << endl; // passage en keV126 sortie << "Dist_x='gauss', sig_x=" << 10.*sigma_r_ << endl; // passage en mm127 sortie << "Dist_px='g', Nemit_x=" << emit_x_ << ", cor_px=0.0" << endl;128 sortie << "Dist_y='gauss', sig_y=" << 10.*sigma_r_ << endl; // passage en mm129 sortie << "Dist_py='g', Nemit_y=" << emit_y_ << ", cor_py=0.0" << endl;130 return sortie.str();131 }109 // return sortie.str(); 110 // } 111 112 // string elementRfgun::generatorOutputFlow() const { 113 // ostringstream sortie; 114 // sortie << "Ipart=" << nmacrop_ << endl; 115 116 // sortie << "Probe=.True." << endl; 117 // sortie << "Noise_reduc=.T" << endl; 118 // sortie << "Cathode=.T." << endl; 119 // sortie << "Q_total=" << totalCharge_ << endl; 120 // sortie << "Ref_zpos=0.0" << endl; 121 // sortie << "Ref_clock=0.0" << endl; 122 // sortie << "Ref_Ekin=" << E_cin_ << endl; // tjs en MeV 123 // sortie << "Dist_z='g'" << endl; 124 // sortie << "sig_clock=" << 1.0e-3*sigma_t_ << endl; // passage de ps en ns 125 // sortie << "Dist_pz='g', sig_Ekin=" << 1000.*sigma_E_ << ", emit_z=0.0 , cor_Ekin=0.0 " << endl; // passage en keV 126 // sortie << "Dist_x='gauss', sig_x=" << 10.*sigma_r_ << endl; // passage en mm 127 // sortie << "Dist_px='g', Nemit_x=" << emit_x_ << ", cor_px=0.0" << endl; 128 // sortie << "Dist_y='gauss', sig_y=" << 10.*sigma_r_ << endl; // passage en mm 129 // sortie << "Dist_py='g', Nemit_y=" << emit_y_ << ", cor_py=0.0" << endl; 130 // return sortie.str(); 131 // } 132 132 133 133 … … 138 138 // on prend les troncatures tmax et rmax à 3 sigmas 139 139 // sortie << elementName_.getElementType() << endl; 140 sortie << elementName_.get ElementLabel() << endl;141 sortie << label_ << endl;140 sortie << elementName_.getGenericLabel() << endl; 141 sortie << specificName_ << endl; 142 142 sortie << nmacrop_ << " " << sigma_t_ << " " << sigma_r_ << endl; 143 143 sortie << emit_x_ << " " << emit_y_ << endl; … … 147 147 } 148 148 149 vector< pair<string, vector<string> > > elementRfgun::parametersToSoftware () const { 150 vector< pair<string, vector<string> > > sortie; 151 sortie.push_back( pair<string, vector<string> >("labelsGenericSpecific", vector<string>() ) ); 152 sortie.back().second.push_back(elementName_.getGenericLabel()); 153 sortie.back().second.push_back(specificName_); 154 sortie.push_back( pair<string, vector<string> >("nbMacroparticles", vector<string>() ) ); 155 sortie.back().second.push_back(mixedTools::intToString(nmacrop_)); 156 sortie.push_back( pair<string, vector<string> >("sigmasTR", vector<string>() ) ); 157 sortie.back().second.push_back(mixedTools::doubleToString(sigma_t_)); 158 sortie.back().second.push_back(mixedTools::doubleToString(sigma_r_)); 159 sortie.push_back( pair<string, vector<string> >("emittancesXY", vector<string>() ) ); 160 sortie.back().second.push_back(mixedTools::doubleToString(emit_x_)); 161 sortie.back().second.push_back(mixedTools::doubleToString(emit_y_)); 162 sortie.push_back( pair<string, vector<string> >("kineticE", vector<string>() ) ); 163 sortie.back().second.push_back(mixedTools::doubleToString(E_cin_)); 164 sortie.back().second.push_back(mixedTools::doubleToString(sigma_E_)); 165 sortie.push_back( pair<string, vector<string> >("phaseStep", vector<string>() ) ); 166 sortie.back().second.push_back(mixedTools::doubleToString(phaseStep_)); 167 sortie.push_back( pair<string, vector<string> >("totalCharge", vector<string>() ) ); 168 sortie.back().second.push_back(mixedTools::doubleToString(totalCharge_)); 169 return sortie; 170 } 171 149 172 void elementRfgun::FileInput(ifstream& ifs) 150 173 { 151 ifs >> label_;174 ifs >> specificName_; 152 175 ifs >> nmacrop_ >> sigma_t_ >> sigma_r_; 153 176 ifs >> emit_x_ >> emit_y_; … … 160 183 string txt = ""; 161 184 162 txt += label_;185 txt += specificName_; 163 186 txt += "\ntotal charge : "; 164 187 txt += mixedTools::doubleToString(totalCharge_);
Note: See TracChangeset
for help on using the changeset viewer.