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/elementCell.cc

    r387 r418  
    1414      nbParam_ = elementName_.getElementNbParameters();
    1515      parametersString_ = new string[nbParam_+1];
    16       //      parmelaOk_ = true;
    17         registerAcceptableSoftware(nomDeLogiciel::parmela, TBoolOk);
     16      //        registerAcceptableSoftware(nomDeLogiciel::parmela, TBoolOk);
    1817    }
    1918
    2019void elementCell::setDefaultValues()
    2120{
    22     defaultLabel_ = "cell";
     21    defaultSpecificName_ = "cell";
    2322    initialPhaseDef_ = 0.0;
    2423    acceleratingFieldDef_ = 1.0;
     
    3130void elementCell::setDefaults()
    3231{
    33     label_ = defaultLabel_;
     32    specificName_ = defaultSpecificName_;
    3433    initialPhase_ = initialPhaseDef_;
    3534    acceleratingField_ = acceleratingFieldDef_;
     
    4544   int compteur = -1;
    4645    parametersString_[++compteur] = mixedTools::intToString(nbParam_);
    47   parametersString_[++compteur] = label_;
     46  parametersString_[++compteur] = specificName_;
    4847    parametersString_[++compteur] = mixedTools::doubleToString(lenghtElem_);
    4948    parametersString_[++compteur] = mixedTools::doubleToString(aperture_);
     
    7877      }
    7978
    80     label_ = param[++compteur];
     79    specificName_ = param[++compteur];
    8180    lenghtElem_ = atof(param[++compteur].c_str());
    8281    aperture_ = atof(param[++compteur].c_str());
     
    9089  }
    9190
    92 string elementCell::parmelaOutputFlow() const
    93   {
    94     ostringstream sortie;
    95     // on prend les troncatures tmax et rmax à 3 sigmas
    96     sortie << "CELL /l=" << lenghtElem_ << "  /aper=" << aperture_ << endl;
    97     sortie << "  /iout=1  /phi0=" << initialPhase_ << " /E0=" << acceleratingField_ << endl;
    98     sortie << " /nc=1 /dwtmax=" << phaseStepMax_ << " /sym=-1" << endl;
    99     sortie << "CFIELD 1" << endl;
    100     sortie << acceleratingShapeFile_ << endl;
    101     if ( focusingMagFile_ != "") {
    102       sortie << "POISSON /zoff=" << offsetMag_ << " /rmult=" << scaleFactor_ << endl;
    103       sortie << focusingMagFile_ << endl;
    104     }
     91// string elementCell::parmelaOutputFlow() const
     92//   {
     93//     ostringstream sortie;
     94//     sortie << "CELL /l=" << lenghtElem_ << "  /aper=" << aperture_ << endl;
     95//     sortie << "  /iout=1  /phi0=" << initialPhase_ << " /E0=" << acceleratingField_ << endl;
     96//     sortie << " /nc=1 /dwtmax=" << phaseStepMax_ << " /sym=-1" << endl;
     97//     sortie << "CFIELD 1" << endl;
     98//     sortie << acceleratingShapeFile_ << endl;
     99//     if ( focusingMagFile_ != "") {
     100//       sortie << "POISSON /zoff=" << offsetMag_ << " /rmult=" << scaleFactor_ << endl;
     101//       sortie << focusingMagFile_ << endl;
     102//     }
    105103
    106     return sortie.str();
    107   }
     104//     return sortie.str();
     105//   }
    108106
    109107
     
    112110    ostringstream sortie;
    113111    //    sortie << elementName_.getElementType()  << endl;
    114     sortie << elementName_.getElementLabel() << endl;
    115     sortie  << label_ << endl;
     112    sortie << elementName_.getGenericLabel() << endl;
     113    sortie  << specificName_ << endl;
    116114    sortie << lenghtElem_ << " " << aperture_ << endl;
    117115    sortie << initialPhase_ << "  " << acceleratingField_ << endl;
     
    123121  }
    124122
     123
     124vector< pair<string, vector<string> > > elementCell::parametersToSoftware () const {
     125  vector< pair<string, vector<string> > >  sortie;
     126  sortie.push_back( pair<string, vector<string> >("labelsGenericSpecific",  vector<string>() ) );
     127  sortie.back().second.push_back(elementName_.getGenericLabel());
     128  sortie.back().second.push_back(specificName_);
     129  sortie.push_back( pair<string, vector<string> >("lenghtAperture",  vector<string>() ) );
     130  sortie.back().second.push_back(mixedTools::doubleToString(lenghtElem_));
     131  sortie.back().second.push_back(mixedTools::doubleToString( aperture_));
     132  sortie.push_back( pair<string, vector<string> >("phaseInitialStepmax",  vector<string>() ) );
     133  sortie.back().second.push_back(mixedTools::doubleToString( initialPhase_));
     134  sortie.back().second.push_back(mixedTools::doubleToString( phaseStepMax_));
     135  sortie.push_back( pair<string, vector<string> >("fieldValueFile",  vector<string>() ) );
     136  sortie.back().second.push_back(mixedTools::doubleToString( acceleratingField_));
     137  sortie.back().second.push_back(acceleratingShapeFile_);
     138  sortie.push_back( pair<string, vector<string> >("MagFocusingFileOffsetScale",  vector<string>() ) );
     139  sortie.back().second.push_back(focusingMagFile_);
     140  sortie.back().second.push_back(mixedTools::doubleToString( offsetMag_));
     141  sortie.back().second.push_back(mixedTools::doubleToString( scaleFactor_));
     142
     143  return sortie;
     144}
     145
     146
    125147void elementCell::FileInput(ifstream& ifs)
    126148{
    127   ifs >> label_;
     149  ifs >> specificName_;
    128150  ifs >> lenghtElem_ >>  aperture_;
    129151  ifs >> initialPhase_ >> acceleratingField_;
     
    139161
    140162
    141     txt += label_;
     163    txt += specificName_;
    142164    txt += "\nlength (cm) : ";
    143165    txt += mixedTools::doubleToString(lenghtElem_);
Note: See TracChangeset for help on using the changeset viewer.