42 void SecantRootFinder(
int n,
int nitmx, amrex::Real tol, amrex::Real *zeroj,
int *ier);
60 using namespace amrex::literals;
65 const amrex::Real tol = 1e-14_rt;
66 const amrex::Real nitmx = 10;
68 const amrex::Real c1 = 1.8557571_rt;
69 const amrex::Real c2 = 1.033150_rt;
70 const amrex::Real c3 = 0.00397_rt;
71 const amrex::Real c4 = 0.0908_rt;
72 const amrex::Real c5 = 0.043_rt;
74 const amrex::Real t0 = 4.0_rt*
n*
n;
75 const amrex::Real t1 = t0 - 1.0_rt;
76 const amrex::Real t3 = 4.0_rt*t1*(7.0_rt*t0 - 31.0_rt);
77 const amrex::Real t5 = 32.0_rt*t1*((83.0_rt*t0 - 982.0_rt)*t0 + 3779.0_rt);
78 const amrex::Real t7 = 64.0_rt*t1*(((6949.0_rt*t0 - 153855.0_rt)*t0 + 1585743.0_rt)*t0 - 6277237.0_rt);
85 zeroj = c1 + c2 - c3 - c4 + c5;
95 const amrex::Real f1 = std::pow(
n, (1.0_rt/3.0_rt));
96 const amrex::Real f2 = f1*f1*
n;
97 const amrex::Real f3 = f1*
n*
n;
98 zeroj =
n + c1*f1 + (c2/f1) - (c3/
n) - (c4/f2) + (c5/f3);
113 const amrex::Real b1 = 8.0_rt*b0;
114 const amrex::Real b2 = b1*b1;
115 const amrex::Real b3 = 3.0_rt*b1*b2;
116 const amrex::Real b5 = 5.0_rt*b3*b2;
117 const amrex::Real b7 = 7.0_rt*b5*b2;
119 zeroj = b0 - (t1/b1) - (t3/b3) - (t5/b5) - (t7/b7);
121 const amrex::Real errj = std::abs(jn(
n, zeroj));
135 using namespace amrex::literals;
137 amrex::Real p0, p1, q0, q1,
dp, p;
145 for (
int ntry=0 ; ntry <= 1 ; ntry++) {
146 p0 =
c[ntry]*(*zeroj);
151 for (
int it=1; it <= nitmx; it++) {
153 p = p1 - q1*(p1 - p0)/(q1 - q0);
155 if (it > 1 && std::abs(
dp) < tol) {
void SecantRootFinder(int n, int nitmx, amrex::Real tol, amrex::Real *zeroj, int *ier)
Definition: BesselRoots.H:134
void GetBesselRoots(int n, int nk, amrex::Vector< amrex::Real > &roots, amrex::Vector< int > &ier)
Definition: BesselRoots.H:59
static constexpr auto c
vacuum speed of light [m/s]
Definition: constant.H:44
static constexpr amrex::Real pi
ratio of a circle's circumference to its diameter
Definition: constant.H:23
int n
Definition: run_libensemble_on_warpx.py:67
dp
Definition: stencil.py:23