00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef EfieldIntegrand_H
00014 #define EfieldIntegrand_H
00015
00016 #include "vector3.h"
00017 #include "vector.h"
00018 #include "nedelecmesh.h"
00019
00022 template <typename Curve>
00023 class EfieldDs {
00024 public:
00032 EfieldDs(Curve curve,
00033 const NedelecMesh& nedelec_mesh,
00034 const colarray::Vector<double>& q)
00035 : curve_(curve),
00036 nedelec_mesh_(nedelec_mesh),
00037 q_(q)
00038 { }
00040 double operator()(const double t) {
00041 mesh::Vector3 field = nedelec_mesh_.eval(curve_(t), q_);
00042 return field.dot_product(curve_.deriv(t));
00043 }
00044 private:
00046 Curve curve_;
00047 const NedelecMesh& nedelec_mesh_;
00049 const colarray::Vector<double>& q_;
00050 };
00051
00053 class EfieldIntegrand {
00054 public:
00061 EfieldIntegrand(const mesh::Vector3& start,
00062 const mesh::Vector3& direction,
00063 const NedelecMesh& nedelec_mesh,
00064 const colarray::Vector<double>& q)
00065 : start_(start),
00066 direction_(direction),
00067 nedelec_mesh_(nedelec_mesh),
00068 q_(q)
00069 { }
00071 double operator()(const double x) {
00072 mesh::Vector3 p(start_ + x*direction_);
00073 mesh::Vector3 field = nedelec_mesh_.eval(p, q_);
00074 return field.dot_product(direction_);
00075 }
00076 private:
00078 const mesh::Vector3& start_;
00080 const mesh::Vector3& direction_;
00081 const NedelecMesh& nedelec_mesh_;
00083 const colarray::Vector<double>& q_;
00084 };
00085
00086 #endif