← Back to team overview

libpspio-developers team mailing list archive

[Bug 1348524] [NEW] Weird test_meshfunc behavior

 

Public bug reported:

When I move tests around I get different values for the f1 and f1' and
f1'' in test_meshfunc.

Fragment from the diff:

   eid = pspio_meshfunc_set(&f1, m1, f, NULL, NULL);
   eid = pspio_error_flush();
+  //
+  DEBUG_PRINT("test_meshfunc: evaluating f1 at r=%f\n", r[6]);
+  pspio_meshfunc_eval(f1, 1, &r[6], &feval);
+  DEBUG_PRINT("test_meshfunc: result=%f\n", feval);
+  DEBUG_PRINT("test_meshfunc: evaluating first derivative of f1 at r=%f\n", r[6]);
+  pspio_meshfunc_eval_deriv(f1, 1, &r[6], &feval);
+  DEBUG_PRINT("test_meshfunc: result=%f\n", feval);
+  DEBUG_PRINT("test_meshfunc: evaluating second derivative of f1 at r=%f\n", r[6]);
+  pspio_meshfunc_eval_deriv2(f1, 1, &r[6], &feval);
+  DEBUG_PRINT("test_meshfunc: result=%f\n", feval);
+  //


Output:
test_meshfunc: setting f1
test_meshfunc: evaluating f1 at r=0.850000
test_meshfunc: result=289.000000
test_meshfunc: evaluating first derivative of f1 at r=0.850000
test_meshfunc: result=690.797296
test_meshfunc: evaluating second derivative of f1 at r=0.850000
test_meshfunc: result=677.545347
test_meshfunc: setting f2 with explicit derivative

test_meshfunc: copying f1 to a NULL f3
test_meshfunc: copying f1 to a non-empty f3

test_meshfunc: evaluating f1 at r=0.850000
test_meshfunc: result=289.000000
test_meshfunc: evaluating f2 at r=0.850000
test_meshfunc: result=289.000000
test_meshfunc: evaluating first derivative of f1 at r=0.850000
test_meshfunc: result=340.000000
test_meshfunc: evaluating first derivative of f2 at r=0.850000
test_meshfunc: result=340.000000
test_meshfunc: evaluating second derivative of f1 at r=0.850000
test_meshfunc: result=400.000000
test_meshfunc: evaluating second derivative of f2 at r=0.850000
test_meshfunc: result=400.000000


Is it a bug or am I missing something?

Attaching bzr diff.

Thanks.

** Affects: libpspio
     Importance: Undecided
         Status: New

** Attachment added: "test_meshfunc.r353"
   https://bugs.launchpad.net/bugs/1348524/+attachment/4162526/+files/test_meshfunc.r353

-- 
You received this bug notification because you are a member of Libpspio
Developers, which is subscribed to Libpspio.
https://bugs.launchpad.net/bugs/1348524

Title:
  Weird test_meshfunc behavior

Status in Libpspio pseudopotential I/O library:
  New

Bug description:
  When I move tests around I get different values for the f1 and f1' and
  f1'' in test_meshfunc.

  Fragment from the diff:

     eid = pspio_meshfunc_set(&f1, m1, f, NULL, NULL);
     eid = pspio_error_flush();
  +  //
  +  DEBUG_PRINT("test_meshfunc: evaluating f1 at r=%f\n", r[6]);
  +  pspio_meshfunc_eval(f1, 1, &r[6], &feval);
  +  DEBUG_PRINT("test_meshfunc: result=%f\n", feval);
  +  DEBUG_PRINT("test_meshfunc: evaluating first derivative of f1 at r=%f\n", r[6]);
  +  pspio_meshfunc_eval_deriv(f1, 1, &r[6], &feval);
  +  DEBUG_PRINT("test_meshfunc: result=%f\n", feval);
  +  DEBUG_PRINT("test_meshfunc: evaluating second derivative of f1 at r=%f\n", r[6]);
  +  pspio_meshfunc_eval_deriv2(f1, 1, &r[6], &feval);
  +  DEBUG_PRINT("test_meshfunc: result=%f\n", feval);
  +  //

  
  Output:
  test_meshfunc: setting f1
  test_meshfunc: evaluating f1 at r=0.850000
  test_meshfunc: result=289.000000
  test_meshfunc: evaluating first derivative of f1 at r=0.850000
  test_meshfunc: result=690.797296
  test_meshfunc: evaluating second derivative of f1 at r=0.850000
  test_meshfunc: result=677.545347
  test_meshfunc: setting f2 with explicit derivative

  test_meshfunc: copying f1 to a NULL f3
  test_meshfunc: copying f1 to a non-empty f3

  test_meshfunc: evaluating f1 at r=0.850000
  test_meshfunc: result=289.000000
  test_meshfunc: evaluating f2 at r=0.850000
  test_meshfunc: result=289.000000
  test_meshfunc: evaluating first derivative of f1 at r=0.850000
  test_meshfunc: result=340.000000
  test_meshfunc: evaluating first derivative of f2 at r=0.850000
  test_meshfunc: result=340.000000
  test_meshfunc: evaluating second derivative of f1 at r=0.850000
  test_meshfunc: result=400.000000
  test_meshfunc: evaluating second derivative of f2 at r=0.850000
  test_meshfunc: result=400.000000

  
  Is it a bug or am I missing something?

  Attaching bzr diff.

  Thanks.

To manage notifications about this bug go to:
https://bugs.launchpad.net/libpspio/+bug/1348524/+subscriptions


Follow ups

References