FLAME  devel
 All Classes Functions Variables Typedefs Enumerations Pages
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
MomentState Struct Reference

#include <moment.h>

Inheritance diagram for MomentState:
Inheritance graph
[legend]
Collaboration diagram for MomentState:
Collaboration graph
[legend]

Public Types

enum  { maxsize =7 }
 
enum  param_t {
  PS_X, PS_PX, PS_Y, PS_PY,
  PS_S, PS_PS, PS_QQ
}
 
typedef
boost::numeric::ublas::vector
< double,
boost::numeric::ublas::bounded_array
< double, maxsize > > 
vector_t
 
typedef
boost::numeric::ublas::matrix
< double,
boost::numeric::ublas::row_major,
boost::numeric::ublas::bounded_array
< double, maxsize *maxsize > > 
matrix_t
 

Public Member Functions

 MomentState (const Config &c)
 
virtual void assign (const StateBase &other)
 
virtual void show (std::ostream &strm, int level) const
 
virtual bool getArray (unsigned idx, ArrayInfo &Info)
 Introspect named parameter of the derived class. More...
 
virtual MomentStateclone () const
 
void recalc ()
 
void calc_rms ()
 
size_t size () const
 

of charge states


 

Public Attributes

Particle ref
 
std::vector< Particlereal
 
std::vector< vector_t > moment0
 
std::vector< matrix_t > moment1
 
vector_t moment0_env
 
vector_t moment0_rms
 
matrix_t moment1_env
 
- Public Attributes inherited from StateBase
size_t next_elem
 
double pos
 absolute longitudinal position at end of Element
 

Protected Member Functions

 MomentState (const MomentState &o, clone_tag)
 
- Protected Member Functions inherited from StateBase
 StateBase (const Config &c)
 
 StateBase (const StateBase &c, clone_tag)
 For use in clone()
 

Detailed Description

State for sim_type=MomentMatrix

Represents a set of charge states

See also
sim_type=MomentMatrix

Definition at line 76 of file moment.h.

Member Function Documentation

void MomentState::assign ( const StateBase other)
virtual

virtual equivalent to operator=() Should only be used with another State originating from the same Machine from Machine::allocState() or clone().

Implements StateBase.

Definition at line 233 of file moment.cpp.

virtual MomentState* MomentState::clone ( ) const
inlinevirtual

Allocate a new instance which is a copy of this one. Caller is responsible to delete the returned pointer

Implements StateBase.

Definition at line 112 of file moment.h.

bool MomentState::getArray ( unsigned  index,
ArrayInfo Info 
)
virtual

Introspect named parameter of the derived class.

Parameters
idxThe index of the parameter
Infomailbox to be filled with information about this paramter
Returns
true if 'idx' is valid and Info was filled in, otherwise false

To introspect call this with index increasing from zero until false is returned.

Sub-classes are required to maintain a fixed number of parameters. The same ArrayInfo::name should alwaysbe returned for a given index. Similarly ArrayInfo::ndim and ArrayInfo.type should not change.

ArrayInfo::ptr, ArrayInfo::dim, ArrayInfo::stride are allowed to change when the state is passed to Machine::propagate().

Therefore, if getArray() for an instance has returned true for some index, then a caller may assume that all future calls to getArray() for this instance will also return true. However, the caller must still re-call getArray() in future as the storage and sizes may have changed.

Reimplemented from StateBase.

Definition at line 289 of file moment.cpp.

void MomentState::show ( std::ostream &  ,
int  level 
) const
virtual

Print information about the state. level is a hint as to the verbosity expected by the caller.

Reimplemented from StateBase.

Definition at line 248 of file moment.cpp.


The documentation for this struct was generated from the following files: