| 1 |
#!/usr/bin/perl -w |
| 2 |
|
| 3 |
use strict; |
| 4 |
use warnings; |
| 5 |
use Test::More tests => 9; |
| 6 |
use Cwd; |
| 7 |
|
| 8 |
use Xray::Feff; |
| 9 |
|
| 10 |
|
| 11 |
my $epsilon = 1e-3; |
| 12 |
|
| 13 |
my $path = Xray::Feff::Path->new(); |
| 14 |
ok(ref($path) =~ m{Feff::Path}, "object created ".$path); |
| 15 |
$path->absorber([1.1, 1.1, 1.1]); |
| 16 |
|
| 17 |
my $ret = $path->atom(1.1, 1.1, -2.51, 1); |
| 18 |
ok((not $ret), "added first leg"); |
| 19 |
ok($path->nleg == 2, "nleg=2"); |
| 20 |
$ret = $path->atom(-0.705, 1.1, -0.705, 1); |
| 21 |
ok((not $ret), "added second leg"); |
| 22 |
ok($path->nleg == 3, "nleg = 3"); |
| 23 |
|
| 24 |
$path->phpad('../fortran/phase_orig.pad'); |
| 25 |
$path->degen(48); |
| 26 |
$path->Index(4); |
| 27 |
$ret = $path->path; |
| 28 |
ok((not $ret), "made path"); |
| 29 |
|
| 30 |
ok($path->ne == 59, "correct length of energy grid"); |
| 31 |
|
| 32 |
ok( ((abs($path->ri->[0]-3.610) < $epsilon) and |
| 33 |
(abs($path->ri->[1]-2.553) < $epsilon) and |
| 34 |
(abs($path->ri->[2]-2.553) < $epsilon)), "ri array"); |
| 35 |
|
| 36 |
ok( ((abs($path->beta->[0]-135) < $epsilon) and |
| 37 |
(abs($path->beta->[1]-90 ) < $epsilon) and |
| 38 |
(abs($path->beta->[2]-135) < $epsilon)), "beta array"); |
| 39 |
|
| 40 |
# 0.000 0.000 -3.610 1 3.610 135.000 0.000 29 |
| 41 |
# -1.805 0.000 -1.805 1 2.553 90.000 0.000 29 |
| 42 |
# 0.000 0.000 0.000 0 2.553 135.000 0.000 29 |
| 43 |
|
| 44 |
undef $path; |