O P A R - Open Architecture Particle in Cell Simulation - Version 3.0
Plasma simulations with dust particles
|
Velocity_ holds the template of a 3-dimensional 'vector'. More...
#include <dimensionality.h>
Public Member Functions | |
T & | x () |
Returns the first, ie x–element. | |
T & | y () |
Returns the second, ie y–element. | |
T & | z () |
Returns the third, ie z–element. | |
Velocity_ () | |
Default constructor. | |
Velocity_ (T ax, T ay, T az) | |
Construct with a 3 individual values. | |
Velocity_ (T x) | |
Construct with one value. All components are set to the value. | |
operator T * () | |
Returns a pointer to the first element. | |
T | volume () const |
Returns the 3-dim volume, ie the product of all components. | |
T | sum () const |
Returns the sum of all components. | |
double | length () const |
Returns the length of the vector. | |
void | stretch (const Position_< T > &A) |
Stretches the vector componentwise with other vector. | |
void | limitto (const Velocity_< T > &pos) |
If any component of the vector is larger than pos, it is limited to the value given in pos. | |
T | arraypos (const Velocity_< T > &pos) const |
Assuming pos is the size of a 3-dim array, this converts the vector to a position in the according one dimensional array. | |
template<class T2 > | |
operator Velocity_< T2 > () const | |
Typecast into a Velocity_<T2> where T2 is different from T. | |
Velocity_< T > | scale (const Velocity_< T > &V) const |
Returns a nonuniformly scaled Velocity_. | |
double | sqr () |
Returns the sum of the squares of the components. | |
T & | operator[] (const int i) |
< Return the i-th value | |
T | operator[] (const int i) const |
Public Attributes | |
T | P [3] |
< The array containing the values |
Velocity_ holds the template of a 3-dimensional 'vector'.