298 real_t tol=1e-10,
int npoints = 1000,
301 MFEM_VERIFY(
alpha < 1.,
"alpha must be less than 1");
302 MFEM_VERIFY(
alpha > 0.,
"alpha must be greater than 0");
303 MFEM_VERIFY(npoints > 2,
"npoints must be greater than 2");
304 MFEM_VERIFY(lmax > 0,
"lmin must be greater than 0");
305 MFEM_VERIFY(tol > 0,
"tol must be greater than 0");
307 bool print_warning =
true;
312#ifndef MFEM_USE_LAPACK
316 <<
"\n" << string(80,
'=')
317 <<
"\nMFEM is compiled without LAPACK."
318 <<
"\nUsing precomputed values for PartialFractionApproximation."
319 <<
"\nOnly alpha = 0.33, 0.5, and 0.99 are available."
320 <<
"\nThe default is alpha = 0.5.\n" << string(80,
'=') <<
"\n"
323 const real_t eps = std::numeric_limits<real_t>::epsilon();
325 if (abs(
alpha - 0.33) < eps)
327 coeffs =
Array<real_t> ({1.821898e+03, 9.101221e+01, 2.650611e+01,
328 1.174937e+01, 6.140444e+00, 3.441713e+00,
329 1.985735e+00, 1.162634e+00, 6.891560e-01,
330 4.111574e-01, 2.298736e-01});
331 poles =
Array<real_t> ({-4.155583e+04, -2.956285e+03, -8.331715e+02,
332 -3.139332e+02, -1.303448e+02, -5.563385e+01,
333 -2.356255e+01, -9.595516e+00, -3.552160e+00,
334 -1.032136e+00, -1.241480e-01});
336 else if (abs(
alpha - 0.99) < eps)
338 coeffs =
Array<real_t>({2.919591e-02, 1.419750e-02, 1.065798e-02,
339 9.395094e-03, 8.915329e-03, 8.822991e-03,
340 9.058247e-03, 9.814521e-03, 1.180396e-02,
341 1.834554e-02, 9.840482e-01});
342 poles =
Array<real_t> ({-1.069683e+04, -1.769370e+03, -5.718374e+02,
343 -2.242095e+02, -9.419132e+01, -4.031012e+01,
344 -1.701525e+01, -6.810088e+00, -2.382810e+00,
345 -5.700059e-01, -1.384324e-03});
349 if (abs(
alpha - 0.5) > eps)
353 coeffs =
Array<real_t>({2.290262e+02, 2.641819e+01, 1.005566e+01,
354 5.390411e+00, 3.340725e+00, 2.211205e+00,
355 1.508883e+00, 1.049474e+00, 7.462709e-01,
356 5.482686e-01, 4.232510e-01, 3.578967e-01});
357 poles =
Array<real_t>({-3.168211e+04, -3.236077e+03, -9.868287e+02,
358 -3.945597e+02, -1.738889e+02, -7.925178e+01,
359 -3.624992e+01, -1.629196e+01, -6.982956e+00,
360 -2.679984e+00, -7.782607e-01, -7.649166e-02});
365 mfem::out <<
"=> Using precomputed values for alpha = "
366 <<
alpha <<
"\n" << std::endl;
372 MFEM_CONTRACT_VAR(print_warning);
378 for (
int i = 0; i<npoints; i++)
381 val(i) = pow(x(i),1.-
alpha);