Ignore:
Timestamp:
Jun 21, 2013, 10:16:56 AM (11 years ago)
Author:
lemeur
Message:

definition des compatibilites des elements dans les software

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/sources/controler/src/elementRfgun.cc

    r387 r418  
    1515    parametersString_ = new string[nbParam_+1];
    1616    //      parmelaOk_ = true;
    17     registerAcceptableSoftware(nomDeLogiciel::parmela, TBoolOk);
    18     registerAcceptableSoftware(nomDeLogiciel::generator, TBoolOk);
     17    // registerAcceptableSoftware(nomDeLogiciel::parmela, TBoolOk);
     18    // registerAcceptableSoftware(nomDeLogiciel::generator, TBoolOk);
    1919}
    2020
    2121void elementRfgun::setDefaultValues()
    2222{
    23     defaultLabel_ = "rfgun";
     23    defaultSpecificName_ = "rfgun";
    2424    defaultPhaseStep_ = 1.0;
    2525    defaultNmacrop_ = 0;
     
    3636  void elementRfgun::setDefaults()
    3737  {
    38     label_ = defaultLabel_;
     38    specificName_ = defaultSpecificName_;
    3939    phaseStep_ = defaultPhaseStep_;
    4040    nmacrop_ = defaultNmacrop_;
     
    5454   int compteur = -1;
    5555    parametersString_[++compteur] = mixedTools::intToString(nbParam_);
    56   parametersString_[++compteur] = label_;
     56  parametersString_[++compteur] = specificName_;
    5757    parametersString_[++compteur] = mixedTools::intToString(nmacrop_);
    5858    parametersString_[++compteur] = mixedTools::doubleToString(sigma_t_);
     
    8181      }
    8282
    83     label_ = param[++compteur];
     83    specificName_ = param[++compteur];
    8484    nmacrop_ = atoi(param[++compteur].c_str());
    8585    sigma_t_ = atof(param[++compteur].c_str());
     
    9393  }
    9494
    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)
     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)
    105105   
    106106
    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;
    108108 
    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 }
     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// }
    132132
    133133
     
    138138    // on prend les troncatures tmax et rmax à 3 sigmas
    139139    //    sortie << elementName_.getElementType() << endl;
    140     sortie << elementName_.getElementLabel() << endl;
    141     sortie  << label_ << endl;
     140    sortie << elementName_.getGenericLabel() << endl;
     141    sortie  << specificName_ << endl;
    142142    sortie <<  nmacrop_ << "  " << sigma_t_ << "  " << sigma_r_ << endl;
    143143    sortie << emit_x_ << "  " << emit_y_ << endl;
     
    147147  }
    148148
     149vector< 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
    149172void elementRfgun::FileInput(ifstream& ifs)
    150173{
    151   ifs >> label_;
     174  ifs >> specificName_;
    152175  ifs >> nmacrop_ >> sigma_t_ >> sigma_r_;
    153176  ifs >> emit_x_  >>  emit_y_;
     
    160183    string txt = "";
    161184   
    162     txt += label_;
     185    txt += specificName_;
    163186    txt += "\ntotal charge : ";
    164187    txt += mixedTools::doubleToString(totalCharge_);
Note: See TracChangeset for help on using the changeset viewer.