Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
25d39650
Commit
25d39650
authored
Jul 19, 2016
by
James Willis
Browse files
Added command line arguments for particle spacing and smoothing lengths.
parent
f4bf9d5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/testNonSymInt.c
View file @
25d39650
...
...
@@ -228,8 +228,6 @@ void test_nonsym_density_interaction(struct part *parts, int count) {
/* And go... */
int
main
(
int
argc
,
char
*
argv
[])
{
double
h
=
1
.
2348
,
spacing
=
0
.
5
;
char
outputFileNameExtension
[
200
]
=
""
;
char
vecOutputFileName
[
200
]
=
""
;
double
offset
[
3
]
=
{
0
.
0
,
0
.
0
,
0
.
0
};
int
vel
=
velocity_zero
;
int
count
=
VEC_SIZE
+
1
;
...
...
@@ -237,6 +235,37 @@ int main(int argc, char *argv[]) {
/* Get some randomness going */
srand
(
0
);
char
c
;
while
((
c
=
getopt
(
argc
,
argv
,
"s:h:v:"
))
!=
-
1
)
{
switch
(
c
)
{
case
'h'
:
sscanf
(
optarg
,
"%lf"
,
&
h
);
break
;
case
's'
:
sscanf
(
optarg
,
"%lf"
,
&
spacing
);
break
;
case
'v'
:
sscanf
(
optarg
,
"%d"
,
&
vel
);
break
;
case
'?'
:
error
(
"Unknown option."
);
break
;
}
}
if
(
h
<
0
||
spacing
<
0
)
{
printf
(
"
\n
Usage: %s [OPTIONS...]
\n
"
"
\n
Generates a particle array with equal particle separation."
"
\n
These are then interacted using runner_iact_density and runner_iact_vec_density."
"
\n\n
Options:"
"
\n
-h DISTANCE=1.2348 - Smoothing length in units of <x>"
"
\n
-s spacing - Spacing between particles"
"
\n
-v type (0,1,2,3) - Velocity field: (zero, random, divergent, "
"rotating)"
,
argv
[
0
]);
exit
(
1
);
}
/* Help users... */
message
(
"Smoothing length: h = %f"
,
h
);
message
(
"Kernel: %s"
,
kernel_name
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment