Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
9f2bb199
Commit
9f2bb199
authored
1 year ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Implement LFFFT formatted output
parent
3f5b4f16
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/trapping/clffft.cpp
+42
-0
42 additions, 0 deletions
src/trapping/clffft.cpp
with
42 additions
and
0 deletions
src/trapping/clffft.cpp
+
42
−
0
View file @
9f2bb199
...
@@ -251,6 +251,12 @@ void lffft(string data_file, string output_path) {
...
@@ -251,6 +251,12 @@ void lffft(string data_file, string output_path) {
const
int
nlmmt
=
nlmm
+
nlmm
;
const
int
nlmmt
=
nlmm
+
nlmm
;
ws
=
new
complex
<
double
>
[
nlmmt
]();
ws
=
new
complex
<
double
>
[
nlmmt
]();
if
(
lm
>
le
)
wsl
=
new
complex
<
double
>
[
nlmmt
]();
if
(
lm
>
le
)
wsl
=
new
complex
<
double
>
[
nlmmt
]();
// FORTRAN writes two output formatted files without opening them
// explicitly. It is assumed thay can be opened here.
string
out66_name
=
output_path
+
"/c_out66.txt"
;
string
out67_name
=
output_path
+
"/c_out67.txt"
;
FILE
*
output66
=
fopen
(
out66_name
.
c_str
(),
"w"
);
FILE
*
output67
=
fopen
(
out67_name
.
c_str
(),
"w"
);
for
(
int
iz475
=
0
;
iz475
<
nzv
;
iz475
++
)
{
for
(
int
iz475
=
0
;
iz475
<
nzv
;
iz475
++
)
{
for
(
int
iy475
=
0
;
iy475
<
nyv
;
iy475
++
)
{
for
(
int
iy475
=
0
;
iy475
<
nyv
;
iy475
++
)
{
for
(
int
ix475
=
0
;
ix475
<
nxv
;
ix475
++
)
{
for
(
int
ix475
=
0
;
ix475
<
nxv
;
ix475
++
)
{
...
@@ -299,6 +305,18 @@ void lffft(string data_file, string output_path) {
...
@@ -299,6 +305,18 @@ void lffft(string data_file, string output_path) {
ffrf
(
zpv
,
ac
,
ws
,
fffe
,
fffs
,
cil
,
ccr
);
ffrf
(
zpv
,
ac
,
ws
,
fffe
,
fffs
,
cil
,
ccr
);
if
(
jss
==
1
)
{
if
(
jss
==
1
)
{
// Writes to 66
// Writes to 66
fprintf
(
output66
,
" %18.16lE%18.16lE%18.16lE
\n
"
,
fffe
[
0
],
fffs
[
0
],
fffe
[
0
]
-
fffs
[
0
]
);
fprintf
(
output66
,
" %18.16lE%18.16lE%18.16lE
\n
"
,
fffe
[
1
],
fffs
[
1
],
fffe
[
1
]
-
fffs
[
1
]
);
fprintf
(
output66
,
" %18.16lE%18.16lE%18.16lE
\n
"
,
fffe
[
2
],
fffs
[
2
],
fffe
[
2
]
-
fffs
[
2
]
);
}
else
{
// label 450
}
else
{
// label 450
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
double
value
=
fffe
[
i
]
-
fffs
[
i
];
double
value
=
fffe
[
i
]
-
fffs
[
i
];
...
@@ -306,6 +324,11 @@ void lffft(string data_file, string output_path) {
...
@@ -306,6 +324,11 @@ void lffft(string data_file, string output_path) {
}
}
if
(
jtw
==
1
)
{
if
(
jtw
==
1
)
{
// Writes to 66
// Writes to 66
fprintf
(
output66
,
" %5d%4d%4d%15.4lE%15.4lE%15.4lE
\n
"
,
ix475
+
1
,
iy475
+
1
,
iz475
+
1
,
fffe
[
0
]
-
fffs
[
0
],
fffe
[
1
]
-
fffs
[
1
],
fffe
[
2
]
-
fffs
[
2
]
);
}
}
}
}
if
(
jft
<
0
)
goto475
=
true
;
if
(
jft
<
0
)
goto475
=
true
;
...
@@ -319,6 +342,18 @@ void lffft(string data_file, string output_path) {
...
@@ -319,6 +342,18 @@ void lffft(string data_file, string output_path) {
ffrt
(
ac
,
ws
,
ffte
,
ffts
,
cil
);
ffrt
(
ac
,
ws
,
ffte
,
ffts
,
cil
);
if
(
jss
==
1
)
{
if
(
jss
==
1
)
{
// Writes to 67
// Writes to 67
fprintf
(
output67
,
" %18.16lE%18.16lE%18.16lE
\n
"
,
ffte
[
0
],
ffts
[
0
],
ffte
[
0
]
-
ffts
[
0
]
);
fprintf
(
output67
,
" %18.16lE%18.16lE%18.16lE
\n
"
,
ffte
[
1
],
ffts
[
1
],
ffte
[
1
]
-
ffts
[
1
]
);
fprintf
(
output67
,
" %18.16lE%18.16lE%18.16lE
\n
"
,
ffte
[
2
],
ffts
[
2
],
ffte
[
2
]
-
ffts
[
2
]
);
}
else
{
// label 470
}
else
{
// label 470
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
double
value
=
ffte
[
i
]
-
ffts
[
i
];
double
value
=
ffte
[
i
]
-
ffts
[
i
];
...
@@ -326,6 +361,11 @@ void lffft(string data_file, string output_path) {
...
@@ -326,6 +361,11 @@ void lffft(string data_file, string output_path) {
}
}
if
(
jtw
==
1
)
{
if
(
jtw
==
1
)
{
// Writes to 67
// Writes to 67
fprintf
(
output67
,
" %5d%4d%4d%15.4lE%15.4lE%15.4lE
\n
"
,
ix475
+
1
,
iy475
+
1
,
iz475
+
1
,
ffte
[
0
]
-
ffts
[
0
],
ffte
[
1
]
-
ffts
[
1
],
ffte
[
2
]
-
ffts
[
2
]
);
}
}
}
}
delete
[]
ffte
;
delete
[]
ffte
;
...
@@ -339,6 +379,8 @@ void lffft(string data_file, string output_path) {
...
@@ -339,6 +379,8 @@ void lffft(string data_file, string output_path) {
if
(
jft
<=
0
)
tlfff
.
close
();
if
(
jft
<=
0
)
tlfff
.
close
();
if
(
jft
>=
0
)
tlfft
.
close
();
if
(
jft
>=
0
)
tlfft
.
close
();
}
}
fclose
(
output66
);
fclose
(
output67
);
}
}
}
}
binary_input
.
close
();
binary_input
.
close
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment