@@ -19,9 +19,9 @@ namespace user {
1919
2020 template <Dimension D>
2121 struct InitFields {
22- InitFields (real_t b0_, real_t rho_GJ_ , real_t xsurf_, real_t ds_)
22+ InitFields (real_t b0_, real_t coeff_ , real_t xsurf_, real_t ds_)
2323 : b0 { b0_ }
24- , rho_GJ { rho_GJ_ }
24+ , coeff { coeff_ }
2525 , xsurf { xsurf_ }
2626 , ds { ds_ }{}
2727
@@ -30,18 +30,21 @@ namespace user {
3030 }
3131
3232 Inline auto ex1 (const coord_t <D>& x_Ph) const -> real_t {
33- if (x_Ph[0 ] < xsurf + ds){
33+ if (x_Ph[0 ] < xsurf + ds ){
3434 return ZERO;
35+ }else if (x_Ph[0 ] > xsurf + 1.33 * ds){
36+ return -coeff * (x_Ph[0 ] - xsurf - ds * (ONE + 0.03 * math::log (1.01 ) - 0.33 * math::log (0.01 + math::exp (-11.0 / ds))));
37+
3538 }else {
36- // return -rho_GJ * (x_Ph[0] - xsurf - ds
37- // + 0.03 * ds * math::log(0.01 + math::exp((xsurf + 1.0 * ds - x_Ph[0]) / 0.03 / ds))
38- // - 0.03 * ds * math::log(0.01 + 1.0 ));
39- return -rho_GJ * (x_Ph[0 ] - xsurf - ds);
39+ return -coeff * (x_Ph[0 ] - xsurf - ds
40+ + 0.03 * ds * math::log (0.01 + math::exp ((xsurf + 1.0 * ds - x_Ph[0 ]) / 0.03 / ds))
41+ - 0.03 * ds * math::log (0.01 + ONE ));
42+ // return -coeff * (x_Ph[0] - xsurf - ds);
4043 }
4144 }
4245
4346 private:
44- const real_t b0, rho_GJ , xsurf, ds;
47+ const real_t b0, coeff , xsurf, ds;
4548 };
4649
4750 template <Dimension D>
@@ -105,11 +108,14 @@ namespace user {
105108 , ds { ds_ } {}
106109
107110 Inline auto operator ()(const coord_t <M::Dim>& x_Ph) const -> real_t {
108- if (xsurf < x_Ph[0 ] and x_Ph[0 ] <= xsurf + ds){
109- return ONE;
110- }else {
111- // return ONE - 0.01 / (0.01 + math::exp(-(x_Ph[0] - xsurf - 1.0 * ds) / 0.03 / ds));
111+ if ( x_Ph[0 ] < xsurf or x_Ph[0 ] > 1.33 * ds + xsurf){
112112 return ZERO;
113+ }else {
114+ if (x_Ph[0 ] < ds + xsurf){
115+ return ONE;
116+ }else {
117+ return ONE - 0.01 / (0.01 + math::exp (-(x_Ph[0 ] - xsurf - 1.0 * ds) / 0.03 / ds));
118+ }
113119 }
114120 }
115121 }; // ExtraCharge
@@ -175,7 +181,7 @@ namespace user {
175181 }())
176182 // , l_atm { ZERO }
177183 // , init_flds(b0, TWO * FOUR * constant::PI * b0 * Omega * SQR(skindepth0) / larmor0, l_atm, ds)
178- , init_flds(b0, ONE , xsurf, ds)
184+ , init_flds(b0, larmor0 / SQR(skindepth0) , xsurf, ds)
179185 , ext_current(j0)
180186 {}
181187
0 commit comments