Version 2, position dependent E/B, kinetic ions, boris mover, terminator
This commit is contained in:
Executable
+53
@@ -0,0 +1,53 @@
|
||||
#ifndef VECTOR_FIELD_H
|
||||
#define VECTOR_FIELD_H
|
||||
|
||||
#include <functional>
|
||||
#include "blitz/array.h"
|
||||
|
||||
#include "simulation/coordinates.h"
|
||||
#include "simulation/position_binning.h"
|
||||
|
||||
class VectorField {
|
||||
public:
|
||||
virtual CylinderVector value(const Coordinate& coordinate) const = 0;
|
||||
};
|
||||
|
||||
class VectorFieldFromArray : public VectorField {
|
||||
public:
|
||||
VectorFieldFromArray(const blitz::Array<double, 3>& radial_component,
|
||||
const blitz::Array<double, 3>& azimuthal_component,
|
||||
const blitz::Array<double, 3>& longitudial_component,
|
||||
double radius,
|
||||
double length);
|
||||
|
||||
CylinderVector value(const Coordinate& coordinate) const;
|
||||
|
||||
private:
|
||||
// todo: make sure we use fast axis on z to reduce acess time
|
||||
const blitz::Array<double, 3> Fr_;
|
||||
const blitz::Array<double, 3> Fphi_;
|
||||
const blitz::Array<double, 3> Fz_;
|
||||
|
||||
CylinderBinning binning_;
|
||||
CylinderVector value(const blitz::TinyVector<int, 3>& bin) const;
|
||||
};
|
||||
|
||||
class VectorFieldConstant : public VectorField {
|
||||
public:
|
||||
VectorFieldConstant(const CylinderVector& constant);
|
||||
CylinderVector value(const Coordinate& coordinate) const;
|
||||
|
||||
private:
|
||||
const CylinderVector constant_;
|
||||
};
|
||||
|
||||
class VectorFieldFunctionInZ : public VectorField {
|
||||
public:
|
||||
VectorFieldFunctionInZ(std::function<double(double, double, double)> v_z);
|
||||
CylinderVector value(const Coordinate& coordinate) const;
|
||||
|
||||
private:
|
||||
std::function<double(double, double, double)> F_z_;
|
||||
};
|
||||
|
||||
#endif /* VECTOR_FIELD_H */
|
||||
Reference in New Issue
Block a user