Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Jean-Eric Campagne
LagSHT
Commits
4b2ef3c7
Commit
4b2ef3c7
authored
Feb 23, 2016
by
Jean-Eric Campagne
Browse files
(JEC) 23/2/16 Laguerre->Bessel using CC quadrature only
parent
321da181
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
312 additions
and
236 deletions
+312
-236
src/lagsht_testsuite.cc
src/lagsht_testsuite.cc
+34
-32
src/laguerre2bessel.cc
src/laguerre2bessel.cc
+278
-204
No files found.
src/lagsht_testsuite.cc
View file @
4b2ef3c7
...
...
@@ -19,7 +19,7 @@ using namespace std;
using
namespace
LagSHT
;
#define DEBUG 0
#define DEBUG
1
0
//JEC 12/1/16: alpha becomes double instead of int
...
...
@@ -463,9 +463,9 @@ void TestJlnpComputation() {
string
geometry
=
param
.
geometry
;
int
ntheta
=
param
.
ntheta
;
int
nphi
=
param
.
nphi
;
string
clenshawDir
=
param
.
clenshawDir
;
//JEC 23/11/15
string
jlnpDir
=
param
.
jlnpDir
;
// "
bool
recomputeJlnp
=
param
.
recomputeJlnp
;
// "
string
clenshawDir
=
param
.
clenshawDir
;
string
jlnpDir
=
param
.
jlnpDir
;
bool
recomputeJlnp
=
param
.
recomputeJlnp
;
cout
<<
" ______________ TestJlnpComputation START ___________ "
<<
endl
;
LaguerreSphericalTransform
sphlagtrans
(
geometry
,
...
...
@@ -483,11 +483,14 @@ void TestJlnpComputation() {
tstack_push
(
"Ctor lag2bess"
);
recomputeJlnp
=
true
;
Laguerre2Bessel
lag2bess
(
sphere
,
lagTrans
,
Nmax
,
Pmax
,
Rmax
,
clenshawDir
,
jlnpDir
,
recomputeJlnp
);
tstack_pop
(
"Ctor lag2bess"
);
cout
<<
" ______________ TestJlnpComputation End ___________ "
<<
endl
;
}
...
...
@@ -669,49 +672,48 @@ void TestLaguerre2Bessel() {
{
//Check 1
cout
<<
"Dump FL or FB reconstructed
Alm
(r_k)"
<<
endl
;
{
//Check 1
b
cout
<<
"Dump FL or FB reconstructed
Cl
(r_k)"
<<
endl
;
#if DEBUG >=2
std
::
ofstream
ofs
;
ofs
.
open
(
"
Alm
i.txt"
,
std
::
ofstream
::
out
);
ofs
.
open
(
"
Cl
i.txt"
,
std
::
ofstream
::
out
);
#endif
for
(
int
n
=
0
;
n
<
Nmax
;
n
++
){
r_8
err_abs
(
0.
);
r_8
err_rel
(
0.
);
for
(
int
l
=
0
;
l
<
Lmax
;
l
++
){
r_8
ClFL
=
0
;
r_8
ClFB
=
0
;
for
(
int
m
=
0
;
m
<=
l
;
m
++
)
{
int
id
=
n
*
Nalm
+
l
+
m
*
Lmax
-
m
*
(
m
+
1
)
/
2
;
// LagSHT numbering
r_8
almkFL2
=
FLalmk
[
id
].
real
()
*
FLalmk
[
id
].
real
()
+
FLalmk
[
id
].
imag
()
*
FLalmk
[
id
].
imag
();
r_8
almkFB2
=
FBalmk
[
id
].
real
()
*
FBalmk
[
id
].
real
()
+
FBalmk
[
id
].
imag
()
*
FBalmk
[
id
].
imag
();
ClFL
+=
(
m
==
0
)
?
almkFL2
:
2
*
almkFL2
;
ClFB
+=
(
m
==
0
)
?
almkFB2
:
2
*
almkFB2
;
}
//m
ClFL
/=
(
r_8
)(
2
*
l
+
1
);
ClFB
/=
(
r_8
)(
2
*
l
+
1
);
#if DEBUG >=2
ofs
<<
l
<<
" "
<<
m
<<
" "
<<
n
<<
" "
<<
setprecision
(
12
)
<<
FLalmk
[
id
].
real
()
<<
" "
<<
FLalmk
[
id
].
imag
()
<<
" "
<<
FBalmk
[
id
].
real
()
<<
" "
<<
FBalmk
[
id
].
imag
()
<<
endl
;
ofs
<<
l
<<
" "
<<
n
<<
" "
<<
setprecision
(
12
)
<<
ClFL
<<
" "
<<
ClFB
<<
endl
;
#endif
complex
<
r_8
>
cdiff
=
(
FLalmk
[
id
]
-
FBalmk
[
id
])
*
conj
(
FLalmk
[
id
]
-
FBalmk
[
id
]);
r_8
diff
=
sqrt
(
cdiff
.
real
());
if
(
diff
>
err_abs
){
err_abs
=
diff
;
}
complex
<
r_8
>
cref
=
FLalmk
[
id
]
*
conj
(
FLalmk
[
id
]);
r_8
ref
=
sqrt
(
cref
.
real
());
r_8
relatdiff
=
diff
/
ref
;
if
(
relatdiff
>
err_rel
)
err_rel
=
relatdiff
;
}
}
cout
<<
" >>>>>>>>>>>>>>>>>>>>> Shell["
<<
n
<<
"] <<<<<<<<<<<<<<<<<<<<<<<<<<"
<<
endl
;
cout
<<
"Err. Max. "
<<
err_abs
<<
", Err. Rel. "
<<
err_rel
<<
endl
;
cout
<<
" >>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<"
<<
endl
;
}
}
//l
}
//n
#if DEBUG >=2
ofs
.
close
();
#endif
}
//check 1
}
//check 1b
{
//check 2
#if DEBUG >=2
...
...
src/laguerre2bessel.cc
View file @
4b2ef3c7
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment