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
7294984d
Commit
7294984d
authored
1 year ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Create an include folder for headers
parent
55c0c3c0
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
src/include/List.h
+0
-0
0 additions, 0 deletions
src/include/List.h
src/include/file_io.h
+6
-0
6 additions, 0 deletions
src/include/file_io.h
src/sphere/edfb.cpp
+19
-16
19 additions, 16 deletions
src/sphere/edfb.cpp
with
26 additions
and
16 deletions
.gitignore
+
1
−
0
View file @
7294984d
build/include
build/cluster/*
build/cluster/*
build/sphere/*
build/sphere/*
build/trapping/*
build/trapping/*
...
...
This diff is collapsed.
Click to expand it.
src/
spher
e/List.h
→
src/
includ
e/List.h
+
0
−
0
View file @
7294984d
File moved
This diff is collapsed.
Click to expand it.
src/include/file_io.h
0 → 100644
+
6
−
0
View file @
7294984d
extern
"C"
void
open_file_
(
int
*
,
const
char
*
,
const
char
*
,
const
char
*
);
extern
"C"
void
close_file_
(
int
*
);
extern
"C"
void
read_int_
(
int
*
,
int
*
);
extern
"C"
void
write_complex_
(
int
*
,
double
*
,
double
*
);
extern
"C"
void
write_double_
(
int
*
,
double
*
);
extern
"C"
void
write_int_
(
int
*
,
int
*
);
This diff is collapsed.
Click to expand it.
src/sphere/edfb.cpp
+
19
−
16
View file @
7294984d
...
@@ -7,7 +7,8 @@
...
@@ -7,7 +7,8 @@
#include
<cstring>
#include
<cstring>
#include
<iostream>
#include
<iostream>
#include
<fstream>
#include
<fstream>
#include
"List.h"
#include
"../include/file_io.h"
#include
"../include/List.h"
using
namespace
std
;
using
namespace
std
;
...
@@ -391,24 +392,27 @@ int main(int argc, char **argv) {
...
@@ -391,24 +392,27 @@ int main(int argc, char **argv) {
// The FORTRAN code writes an auxiliary file in binary format. This should
// The FORTRAN code writes an auxiliary file in binary format. This should
// be avoided or possibly replaced with the use of standard file formats for
// be avoided or possibly replaced with the use of standard file formats for
// scientific use (e.g. FITS).
// scientific use (e.g. FITS).
ofstream
tedf_file
;
int
uid
=
27
;
tedf_file
.
open
(
"c_TEDF"
,
ofstream
::
binary
);
string
bin_file_name
=
"c_TEDF"
;
tedf_file
.
write
(
reinterpret_cast
<
char
*>
(
&
nsph
),
sizeof
(
nsph
));
string
status
=
"UNKNOWN"
;
string
mode
=
"UNFORMATTED"
;
open_file_
(
&
uid
,
bin_file_name
.
c_str
(),
status
.
c_str
(),
mode
.
c_str
());
write_int_
(
&
uid
,
&
nsph
);
for
(
int
iogi
=
0
;
iogi
<
nsph
;
iogi
++
)
for
(
int
iogi
=
0
;
iogi
<
nsph
;
iogi
++
)
tedf_file
.
write
(
reinterpret_cast
<
char
*>
(
iog
+
iogi
),
sizeof
(
iog
[
iogi
]
));
write_int_
(
&
uid
,
(
iog
+
iogi
));
tedf_file
.
write
(
reinterpret_cast
<
char
*>
(
&
exdc
),
sizeof
(
exdc
)
)
;
write_double_
(
&
uid
,
&
exdc
);
tedf_file
.
write
(
reinterpret_cast
<
char
*>
(
&
wp
),
sizeof
(
wp
)
)
;
write_double_
(
&
uid
,
&
wp
);
tedf_file
.
write
(
reinterpret_cast
<
char
*>
(
&
xip
),
sizeof
(
xip
)
)
;
write_double_
(
&
uid
,
&
xip
);
tedf_file
.
write
(
reinterpret_cast
<
char
*>
(
&
id
fc
),
sizeof
(
idfc
)
)
;
write_int_
(
&
u
id
,
&
idfc
);
tedf_file
.
write
(
reinterpret_cast
<
char
*>
(
&
nxi
),
sizeof
(
nxi
)
)
;
write_int_
(
&
uid
,
&
nxi
);
for
(
int
i115
=
1
;
i115
<=
nsph
;
i115
++
)
{
for
(
int
i115
=
1
;
i115
<=
nsph
;
i115
++
)
{
if
(
iog
[
i115
-
1
]
<
i115
)
continue
;
if
(
iog
[
i115
-
1
]
<
i115
)
continue
;
tedf_file
.
write
(
reinterpret_cast
<
char
*>
(
nshl
+
i115
-
1
),
sizeof
(
nshl
[
i115
-
1
]
));
write_int_
(
&
uid
,
(
nshl
+
i115
-
1
));
tedf_file
.
write
(
reinterpret_cast
<
char
*>
(
ros
+
i115
-
1
),
sizeof
(
ros
[
i115
-
1
]
));
write_double_
(
&
uid
,
(
ros
+
i115
-
1
));
nsh
=
nshl
[
i115
-
1
];
nsh
=
nshl
[
i115
-
1
];
if
(
i115
==
1
)
nsh
+=
ies
;
if
(
i115
==
1
)
nsh
+=
ies
;
for
(
int
ins
=
0
;
ins
<
nsh
;
ins
++
)
for
(
int
ins
=
0
;
ins
<
nsh
;
ins
++
)
tedf_file
.
write
(
reinterpret_cast
<
char
*>
(
rcf
[
i115
-
1
]
+
ins
),
sizeof
(
rcf
[
i115
-
1
]
[
ins
]
));
write_double_
(
&
uid
,
(
rcf
[
i115
-
1
]
+
ins
));
}
}
// Remake the dc0m matrix.
// Remake the dc0m matrix.
dc0m
=
new
complex
<
double
>**
[
max_nsh
];
dc0m
=
new
complex
<
double
>**
[
max_nsh
];
...
@@ -435,12 +439,11 @@ int main(int argc, char **argv) {
...
@@ -435,12 +439,11 @@ int main(int argc, char **argv) {
// The FORTRAN code writes the complex numbers as a 16-byte long binary stream.
// The FORTRAN code writes the complex numbers as a 16-byte long binary stream.
// Here we assume that the 16 bytes are equally split in 8 bytes to represent the
// Here we assume that the 16 bytes are equally split in 8 bytes to represent the
// real part and 8 bytes to represent the imaginary one.
// real part and 8 bytes to represent the imaginary one.
tedf_file
.
write
(
reinterpret_cast
<
char
*>
(
&
dc0_real
),
sizeof
(
dc0_real
));
write_complex_
(
&
uid
,
&
dc0_real
,
&
dc0_img
);
tedf_file
.
write
(
reinterpret_cast
<
char
*>
(
&
dc0_img
),
sizeof
(
dc0_img
));
}
}
}
}
}
}
tedf_file
.
close
(
);
close_file_
(
&
uid
);
if
(
idfc
!=
0
)
{
if
(
idfc
!=
0
)
{
fprintf
(
output
,
" DIELECTRIC CONSTANTS
\n
"
);
fprintf
(
output
,
" DIELECTRIC CONSTANTS
\n
"
);
for
(
int
i473
=
1
;
i473
<=
nsph
;
i473
++
)
{
for
(
int
i473
=
1
;
i473
<=
nsph
;
i473
++
)
{
...
...
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