75 double dist =
d2(p.
pos,at);
83 template<
typename Iter>
88 for(
auto it = begin; it != end; ++it)
93 template<
typename Iter,
typename PartOf>
97 const PartOf& part_of) {
99 for(
auto it = begin; it != end; ++it)
100 e +=
E(part_of(*it),at);
104 template<
typename PartIter,
typename PosIter,
106 double E(
const PartIter& particle_begin,
107 const PartIter& particle_end,
108 const PosIter& position_begin,
109 const PosIter& position_end,
112 for(
auto it = position_begin; it != position_end; ++it) {
113 auto e =
E(particle_begin,particle_end,*it);
119 return std::sqrt(max_norm);
122 template<
typename PartIter,
typename PosIter,
123 typename OutputIt,
typename PartOf,
typename PosOf>
124 void E_(
const PartIter& particle_begin,
125 const PartIter& particle_end,
126 const PosIter& position_begin,
127 const PosIter& position_end,
129 const PartOf& part_of,
130 const PosOf& pos_of) {
131 for(
auto it = position_begin; it != position_end; ++it)
132 *(out++) =
E_(particle_begin,particle_end,pos_of(*it),part_of);
135 double dist =
d(p.
pos,at);
142 template<
typename Iter>
143 double V(
const Iter& begin,
147 for(
auto it = begin; it != end; ++it)
152 template<
typename PartIter,
typename PosIter,
154 std::pair<double,double>
V(
const PartIter& particle_begin,
155 const PartIter& particle_end,
156 const PosIter& position_begin,
157 const PosIter& position_end,
159 double min = std::numeric_limits<double>::max();
160 double max = std::numeric_limits<double>::lowest();
161 for(
auto it = position_begin; it != position_end; ++it) {
162 double v =
V(particle_begin,particle_end,*it);
Definition: elecParticle.hpp:36
double V(const Particle &p, const Point &at)
Definition: elecParticle.hpp:134
Particle & operator=(const Particle &cp)
Definition: elecParticle.hpp:48
double q
Definition: elecParticle.hpp:39
Point E_(const Iter &begin, const Iter &end, const Point &at, const PartOf &part_of)
Definition: elecParticle.hpp:94
#define elecFIELD_COEF
Definition: elecParams.hpp:29
Point speed
Definition: elecParticle.hpp:38
Particle electron(const Point &pos)
Definition: elecParticle.hpp:66
Particle(const Particle &cp)
Definition: elecParticle.hpp:46
Definition: elecPoint.hpp:35
double d2(const Point &A, const Point &B)
Definition: elecPoint.hpp:131
Particle()
Definition: elecParticle.hpp:42
Point pos
Definition: elecParticle.hpp:38
#define elecEPS_E_RADIUS
Definition: elecParams.hpp:35
double d(const Point &A, const Point &B)
Definition: elecPoint.hpp:136
std::ostream & operator<<(std::ostream &os, const Particle &p)
Definition: elecParticle.hpp:57
Particle proton(const Point &pos)
Definition: elecParticle.hpp:70
#define elecMIN_E_RADIUS
Definition: elecParams.hpp:34
Point E(const Particle &p, const Point &at)
Definition: elecParticle.hpp:74
Particle(const Point &p, double qq)
Definition: elecParticle.hpp:43