Commit 0cf4064e authored by Bert Vandenbroucke's avatar Bert Vandenbroucke
Browse files

Fixed wrong box size in 2D Sod shock that caused SHADOWFAX_SPH to crash. Added...

Fixed wrong box size in 2D Sod shock that caused SHADOWFAX_SPH to crash. Added flag in const.h to enable or disable cell motion steering. Made sure cell centroids have all their coordinates initialized.
parent 484e0722
......@@ -88,7 +88,7 @@ file = h5py.File(fileName, 'w')
# Header
grp = file.create_group("/Header")
grp.attrs["BoxSize"] = [boxSize, 0.5, 0.1]
grp.attrs["BoxSize"] = [boxSize, 0.5, 1.0]
grp.attrs["NumPart_Total"] = [numPart, 0, 0, 0, 0, 0]
grp.attrs["NumPart_Total_HighWord"] = [0, 0, 0, 0, 0, 0]
grp.attrs["NumPart_ThisFile"] = [numPart, 0, 0, 0, 0, 0]
......
......@@ -67,7 +67,10 @@
/* Options to control SHADOWFAX_SPH */
/* This option disables cell movement */
#define SHADOWFAX_FIX_CELLS
//#define SHADOWFAX_FIX_CELLS
/* This option enables cell steering, i.e. trying to keep the cells regular by
adding a correction to the cell velocities.*/
#define SHADOWFAX_STEER_CELL_MOTION
/* This option evolves the total energy instead of the thermal energy */
//#define SHADOWFAX_TOTAL_ENERGY
......
......@@ -401,6 +401,7 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
vcell[2] = 0.;
}
#ifdef SHADOWFAX_STEER_CELL_MOTION
/* To prevent stupid things like cell crossovers or generators that move
outside their cell, we steer the motion of the cell somewhat */
if (p->primitives.rho) {
......@@ -428,6 +429,7 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
vcell[1] += vfac * d[1];
vcell[2] += vfac * d[2];
}
#endif
#if defined(SHADOWFAX_FIX_CELLS)
xp->v_full[0] = 0.;
......
......@@ -543,6 +543,7 @@ __attribute__((always_inline)) INLINE void voronoi_get_centroid(
centroid[0] = cell->centroid[0];
centroid[1] = cell->centroid[1];
centroid[2] = 0.0f;
}
/*******************************************************************************
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment