Skip to content
Snippets Groups Projects
Commit d14202c9 authored by Rainer Weinberger's avatar Rainer Weinberger
Browse files

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
No related tags found
No related merge requests found
......@@ -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 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment