53 lines
1.4 KiB
C++
Executable File
53 lines
1.4 KiB
C++
Executable File
#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:
|
|
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 */
|