| O P A R - Open Architecture Particle in Cell Simulation - Version 3.0
    Plasma simulations with dust particles | 
A n-dimensional grid of arbitrary type to hold, densities, fields, boundary values etc. Unlike C-arrays the grid size specifies the maximum index of the elements. This means that the grid contains one element more in each direction than the equivalent C-array. Elements are from (0,0,...,0) to (size[0], size[1], ... , size[n]). The implementation is mostly independent on the dimension of the system because it makes use of the dimensionality dependent Position and GridPosition classes. More...
#include <numeric.h>
| Public Member Functions | |
| grid () | |
| Default constructor. | |
| grid (GridPosition size_) | |
| Construct with size. | |
| grid (const grid &agrid) | |
| const GridPosition & | Size () const | 
| The n-dimensional size of the grid. | |
| void | Resize (const GridPosition &asize) | 
| Resizes the grid. Makes use of the resize method of valarray to free/reallocate the memory. | |
| const grid & | operator= (const std::valarray< T > arr) | 
| assignment operator. Copies the elements of one array into the other. This operator only works when the two grids are of equal size. | |
| const grid & | operator= (const T val) | 
| const grid & | operator+= (const std::valarray< T > arr) | 
| operators for addition, subtraction, multiplication and division. Only the += -= *= and /= operators are defined for efficiency reasons. Uses the according operators of the valarray. Work element-wise. These operators only work when the two grids are of equal size. | |
| const grid & | operator+= (const grid &arr) | 
| const grid & | operator-= (const std::valarray< T > arr) | 
| const grid & | operator-= (const grid &arr) | 
| const grid & | operator*= (const T val) | 
| const grid & | operator/= (const T val) | 
| T & | operator[] (const GridPosition &i) | 
| T | operator[] (const GridPosition &i) const | 
| T | operator() (const Position &X) const | 
| grid< Position > | derive (Position ddx) | 
| void | apply (T fkt()) | 
| Protected Attributes | |
| T * | G | 
| Holds the values in a one dimensional valarray. | |
| GridPosition | size | 
| The n-dimensional size of the grid. | |
| int | gsize | 
A n-dimensional grid of arbitrary type to hold, densities, fields, boundary values etc. Unlike C-arrays the grid size specifies the maximum index of the elements. This means that the grid contains one element more in each direction than the equivalent C-array. Elements are from (0,0,...,0) to (size[0], size[1], ... , size[n]). The implementation is mostly independent on the dimension of the system because it makes use of the dimensionality dependent Position and GridPosition classes.
 1.8.1.1
 1.8.1.1