Changeset 166 in PSPA for Interface_Web/trunk/pspaWT/include


Ignore:
Timestamp:
Dec 10, 2012, 7:06:24 PM (12 years ago)
Author:
lemeur
Message:

reecriture de particleBeam

Location:
Interface_Web/trunk/pspaWT/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/include/bareParticle.h

    r56 r166  
    3434~bareParticle() {;}
    3535
    36  inline bareParticle& operator = (const bareParticle& bp)
    37    {
    38      position_ = bp.position_;
    39      betagamma_ = bp.betagamma_;
    40      gamma_ = bp.gamma_;
    41      return *this;
    42    }
    4336
    44  bareParticle(const TRIDVECTOR&  pos , const TRIDVECTOR& bg)
    45    {
    46      position_ = pos;
    47      betagamma_ = bg;
    48      gamma_ = sqrt( 1.0 + betagamma_.norm2() );
    49    }
     37 bareParticle(const TRIDVECTOR&  pos , const TRIDVECTOR& bg);
    5038
    51  inline void resetDynamics(const bareParticle& bp)
    52   {
    53     position_ = bp.position_;
    54     betagamma_ = bp.betagamma_;
    55     gamma_ = bp.gamma_;
     39 bareParticle(bareParticle& bp);
    5640
    57   }
     41 bareParticle(const bareParticle& bp);
     42 
     43 void resetDynamics(const bareParticle& bp);
     44
     45 bareParticle& operator = (const bareParticle& bp);
    5846
    5947
     48 const TRIDVECTOR& getReferenceToPosition() const;
    6049
    61 inline  const TRIDVECTOR& getReferenceToPosition() const
    62   {
    63     return position_;
    64   }
     50 TRIDVECTOR getPosition() const;
    6551
    66 inline  TRIDVECTOR getPosition() const
    67   {
    68     return position_;
    69   }
     52 TRIDVECTOR& getReferenceToPosition();
    7053
    71  inline  TRIDVECTOR& getReferenceToPosition()
    72   {
    73     return position_;
    74   }
    75 
    76 inline  double getZ() const
    77   {
    78     return position_.getComponent(2);
    79   }
     54 double getZ() const;
    8055
    8156
    82 inline void setZ(double z)
    83   {
    84     position_.setComponent(2, z);
    85   }
     57 void setZ(double z);
    8658
    87  inline  void incrementZ( double dz)
    88   {
    89     position_.incrementComponent(2, dz);
    90   }
     59 void incrementZ( double dz);
    9160
    92 inline   void setX(double x)
    93   {
    94     position_.setComponent(0, x);
    95   }
     61 void setX(double x);
    9662
    9763
    98 inline   double getRadius() const
    99   {
    100     double auxx = position_.getComponent(0);
    101     double auxy = position_.getComponent(1);
    102 
    103     return sqrt(auxx * auxx + auxy * auxy);
    104   }
     64 double getRadius() const;
    10565
    10666
    107 inline  TRIDVECTOR getBetaGamma() const
    108   {
    109     return betagamma_;
    110   }
     67 TRIDVECTOR getBetaGamma() const;
    11168
    11269
    113 inline TRIDVECTOR& getReferenceToBetaGamma()
    114   {
    115     return betagamma_;
    116   }
     70 TRIDVECTOR& getReferenceToBetaGamma();
    11771 
    118 inline void setBetaGamma(const TRIDVECTOR& btg)
    119   {
    120     betagamma_ = btg;
    121      gamma_ = sqrt( 1.0 + betagamma_.norm2() );
    122   }
     72 void setBetaGamma(const TRIDVECTOR& btg);
    12373
    124 inline double getBetaz() const
    125   {
    126     return betagamma_.getComponent(2)/gamma_;
    127   }
     74 double getBetaz() const;
    12875
    12976
    130 inline  double getGamma() const
    131   {
    132     return gamma_;
    133   }
     77 double getGamma() const;
    13478
    13579
     
    13781
    13882
    139  inline string FileOutputFlow() const
    140   {
    141     ostringstream sortie;
    142     sortie << position_.output_flow()  << betagamma_.output_flow() << " " <<  gamma_;
    143     return sortie.str();
    144   }
     83 string FileOutputFlow() const;
    14584
    146 virtual inline bool FileInput( ifstream& ifs)
    147  {
    148     bool test = false;
    149     if ( position_.input_flow(ifs) && betagamma_.input_flow(ifs) )
    150       {
    151         if (  ifs >> gamma_ )
    152           {
    153             test = true;
    154           }
    155       }
    156     return test;
    157  }
     85 virtual bool FileInput( ifstream& ifs);
    15886
    15987
  • Interface_Web/trunk/pspaWT/include/mathematicalTools.h

    r52 r166  
    9191 inline const double& operator() (int index) const { return vec_[index]; }
    9292
    93 inline void operator = (const TRIDVECTOR& triv)
    94 {
    95   setComponents( triv.vec_[0],triv.vec_[1], triv.vec_[2]);
     93inline TRIDVECTOR& operator= (const TRIDVECTOR& triv)
     94{
     95  setComponents( triv.vec_[0],triv.vec_[1], triv.vec_[2]);
     96  return *this;
    9697}
    9798
  • Interface_Web/trunk/pspaWT/include/particleBeam.h

    r153 r166  
    1111#include "bareParticle.h"
    1212#include "mathematicalTools.h"
    13 #include "mathematicalConstants.h"
    14 #include "PhysicalConstants.h"
    1513#include "nomdElements.h"
    1614
    1715using namespace std;
    1816
    19 struct particle
     17typedef struct
    2018{
    2119  float xx, xxp, begamx,yy,yyp,begamy,z, begamz,phi,wz;
     
    3129    printf( " %e %e %e %e %e %e %e %e %e %e %d %d %d, %d %e %e %e %e \n", xx, xxp, begamx,yy,yyp,begamy,z, begamz,phi,wz,ne,np,ngood,npart,phi0, ksi1,ksi2,ksi3);
    3230  }
    33 };
     31} parmelaParticle;
    3432
    3533
     
    4543  vector<bareParticle> goodPartic_;
    4644
    47       vector< vector<double> > rij_transportMoments_;
    48       vector<double> centroid_;
    49       double P0Transport_;
     45  vector< vector<double> > rij_transportMoments_;
     46  vector<double> centroid_;
     47  double P0Transport_;
    5048
    5149
    52       void readTransportMoments(ifstream& inp);
     50  void readTransportMoments(ifstream& inp);
    5351
    54       void impressionDesMoments() const;
     52  void impressionDesMoments() const;
     53  void razDesMoments();
    5554
    5655
    5756 public:
    5857
    59  particleBeam() 
    60    {
    61      rij_transportMoments_.resize(6);
    62      unsigned dim=0;
    63      unsigned k;
    64      for ( k=0; k < 6; k++)
    65        {
    66          rij_transportMoments_.at(k).resize(++dim);
    67        }
    68      P0Transport_ = 0.0;
    69      particleRepresentationOk_ = false;
    70      momentRepresentationOk_ = false;
    71 
    72    }
     58  particleBeam();
    7359
    7460  ~particleBeam() {;}
    7561
    7662  bool setFromParmela(unsigned numeroElement,double referencefrequency);
    77       void buildMomentRepresentation();
     63  void buildMomentRepresentation();
    7864
    79       //       bool setFromTransport(ifstream& inp, unsigned nblignes);
    80           bool  setFromTransport(string elementLabel, const nomdElements elem);
     65  bool  setFromTransport(string elementLabel, const nomdElements elem);
    8166
    82   inline void clear()
    83   {
    84     goodPartic_.clear();
    85      P0Transport_ = 0.0;
    86      particleRepresentationOk_ = false;
    87      momentRepresentationOk_ = false;
    88   }
     67  void clear();
    8968
    90 inline  int getNbParticles() const
    91   {
    92     return goodPartic_.size();
    93   }
     69  int getNbParticles() const;
    9470
    95  inline const vector< vector<double> >&  getTransportMoments() const  { return rij_transportMoments_;}
    96  inline double getP0Transport() const { return P0Transport_;}
    97   inline bool particleRepresentationOk() const {return particleRepresentationOk_;}
    98  inline bool momentRepresentationOk() const {return momentRepresentationOk_;}
     71  const vector< vector<double> >&  getTransportMoments() const;
     72  double getP0Transport() const;
     73  bool particleRepresentationOk() const;
     74  bool momentRepresentationOk() const;
    9975
    10076
    101 inline void  addParticle( bareParticle p)
    102     {
    103       goodPartic_.push_back(p);
    104     }
     77  void  addParticle( bareParticle p);
    10578
    10679
    10780
    108 inline const vector<bareParticle>& getParticleVector() const
    109  {
    110    return goodPartic_;
    111  }
     81  const vector<bareParticle>& getParticleVector() const;
    11282
    113 inline vector<bareParticle>& getParticleVector()
    114  {
    115    return goodPartic_;
    116  }
     83  vector<bareParticle>& getParticleVector();
    11784
    118  double getXmaxRms();
     85  double getXmaxRms();
    11986
    120  void getVariance(double& varx, double& vary, double& varz) const;
     87  void getVariance(double& varx, double& vary, double& varz) const;
    12188 
    12289
    123  void printAllXYZ() const;
     90  void printAllXYZ() const;
    12491
    12592
    126  void Zrange(double& zmin, double& zmax) const;
     93  void Zrange(double& zmin, double& zmax) const;
    12794
    128  void donneesDessinEllipseXxp(vector<double>& xcor, vector<double>& ycor);
     95  void donneesDessinEllipseXxp(vector<double>& xcor, vector<double>& ycor);
    12996
    13097
    131  virtual string FileOutputFlow() const;
     98  virtual string FileOutputFlow() const;
    13299
    133100
    134  virtual bool FileInput(ifstream& ifs);
     101  virtual bool FileInput(ifstream& ifs);
    135102
    136103
Note: See TracChangeset for help on using the changeset viewer.