Changeset 418 in PSPA for Interface_Web/trunk/pspaWT/sources/controler/src/elementCell.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/elementCell.cc
r387 r418 14 14 nbParam_ = elementName_.getElementNbParameters(); 15 15 parametersString_ = new string[nbParam_+1]; 16 // parmelaOk_ = true; 17 registerAcceptableSoftware(nomDeLogiciel::parmela, TBoolOk); 16 // registerAcceptableSoftware(nomDeLogiciel::parmela, TBoolOk); 18 17 } 19 18 20 19 void elementCell::setDefaultValues() 21 20 { 22 default Label_ = "cell";21 defaultSpecificName_ = "cell"; 23 22 initialPhaseDef_ = 0.0; 24 23 acceleratingFieldDef_ = 1.0; … … 31 30 void elementCell::setDefaults() 32 31 { 33 label_ = defaultLabel_;32 specificName_ = defaultSpecificName_; 34 33 initialPhase_ = initialPhaseDef_; 35 34 acceleratingField_ = acceleratingFieldDef_; … … 45 44 int compteur = -1; 46 45 parametersString_[++compteur] = mixedTools::intToString(nbParam_); 47 parametersString_[++compteur] = label_;46 parametersString_[++compteur] = specificName_; 48 47 parametersString_[++compteur] = mixedTools::doubleToString(lenghtElem_); 49 48 parametersString_[++compteur] = mixedTools::doubleToString(aperture_); … … 78 77 } 79 78 80 label_ = param[++compteur];79 specificName_ = param[++compteur]; 81 80 lenghtElem_ = atof(param[++compteur].c_str()); 82 81 aperture_ = atof(param[++compteur].c_str()); … … 90 89 } 91 90 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 // } 105 103 106 return sortie.str();107 }104 // return sortie.str(); 105 // } 108 106 109 107 … … 112 110 ostringstream sortie; 113 111 // sortie << elementName_.getElementType() << endl; 114 sortie << elementName_.get ElementLabel() << endl;115 sortie << label_ << endl;112 sortie << elementName_.getGenericLabel() << endl; 113 sortie << specificName_ << endl; 116 114 sortie << lenghtElem_ << " " << aperture_ << endl; 117 115 sortie << initialPhase_ << " " << acceleratingField_ << endl; … … 123 121 } 124 122 123 124 vector< 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 125 147 void elementCell::FileInput(ifstream& ifs) 126 148 { 127 ifs >> label_;149 ifs >> specificName_; 128 150 ifs >> lenghtElem_ >> aperture_; 129 151 ifs >> initialPhase_ >> acceleratingField_; … … 139 161 140 162 141 txt += label_;163 txt += specificName_; 142 164 txt += "\nlength (cm) : "; 143 165 txt += mixedTools::doubleToString(lenghtElem_);
Note: See TracChangeset
for help on using the changeset viewer.