Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
25d39650
Commit
25d39650
authored
9 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Added command line arguments for particle spacing and smoothing lengths.
parent
f4bf9d5b
No related branches found
No related tags found
1 merge request
!203
Gadget2 part update
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/testNonSymInt.c
+31
-2
31 additions, 2 deletions
tests/testNonSymInt.c
with
31 additions
and
2 deletions
tests/testNonSymInt.c
+
31
−
2
View file @
25d39650
...
@@ -228,8 +228,6 @@ void test_nonsym_density_interaction(struct part *parts, int count) {
...
@@ -228,8 +228,6 @@ void test_nonsym_density_interaction(struct part *parts, int count) {
/* And go... */
/* And go... */
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
double
h
=
1
.
2348
,
spacing
=
0
.
5
;
double
h
=
1
.
2348
,
spacing
=
0
.
5
;
char
outputFileNameExtension
[
200
]
=
""
;
char
vecOutputFileName
[
200
]
=
""
;
double
offset
[
3
]
=
{
0
.
0
,
0
.
0
,
0
.
0
};
double
offset
[
3
]
=
{
0
.
0
,
0
.
0
,
0
.
0
};
int
vel
=
velocity_zero
;
int
vel
=
velocity_zero
;
int
count
=
VEC_SIZE
+
1
;
int
count
=
VEC_SIZE
+
1
;
...
@@ -237,6 +235,37 @@ int main(int argc, char *argv[]) {
...
@@ -237,6 +235,37 @@ int main(int argc, char *argv[]) {
/* Get some randomness going */
/* Get some randomness going */
srand
(
0
);
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... */
/* Help users... */
message
(
"Smoothing length: h = %f"
,
h
);
message
(
"Smoothing length: h = %f"
,
h
);
message
(
"Kernel: %s"
,
kernel_name
);
message
(
"Kernel: %s"
,
kernel_name
);
...
...
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