Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Arepo
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
Volker Springel
Arepo
Commits
d14202c9
Commit
d14202c9
authored
4 years ago
by
Rainer Weinberger
Browse files
Options
Downloads
Patches
Plain Diff
warning if startup with nonzero y or z velocity in 1d case or nonzero z velocity in 2d case
parent
df98ffef
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/init/init.c
+19
-0
19 additions, 0 deletions
src/init/init.c
with
19 additions
and
0 deletions
src/init/init.c
+
19
−
0
View file @
d14202c9
...
...
@@ -166,19 +166,38 @@ int init(void)
P
[
i
].
GravCost
[
j
]
=
0
;
/* set unused coordinate values in 1d and 2d simulations to zero; this is needed for correct interfaces */
int
nonzero_vel
=
0
;
#ifdef ONEDIMS
for
(
i
=
0
;
i
<
NumPart
;
i
++
)
{
P
[
i
].
Pos
[
1
]
=
0
.
0
;
P
[
i
].
Pos
[
2
]
=
0
.
0
;
if
(
P
[
i
].
Vel
[
1
]
!=
0
.
0
||
P
[
i
].
Vel
[
2
]
!=
0
.
0
)
{
nonzero_vel
=
1
;
}
}
if
(
nonzero_vel
>
0
)
{
warn
(
"Initial y or z velocity nonzero in 1d simulation! Make sure you really want this!"
);
}
#endif
/* #ifdef ONEDIMS */
#ifdef TWODIMS
for
(
i
=
0
;
i
<
NumPart
;
i
++
)
{
P
[
i
].
Pos
[
2
]
=
0
;
if
(
P
[
i
].
Vel
[
2
]
!=
0
.
0
)
{
nonzero_vel
=
1
;
}
}
if
(
nonzero_vel
>
0
)
{
warn
(
"Initial z velocity nonzero in 2d simulation! Make sure you really want this!"
);
}
#endif
/* #ifdef TWODIMS */
if
(
All
.
ComovingIntegrationOn
)
/* change to new velocity variable */
...
...
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