...
 
Commits (2)
......@@ -36,8 +36,9 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "add_bggrid.h"
#include "../domain/domain.h"
#include "add_bggrid.h"
#ifdef ADDBACKGROUNDGRID
......
......@@ -40,6 +40,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "add_bggrid.h"
......
......@@ -40,6 +40,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "add_bggrid.h"
#ifdef ADDBACKGROUNDGRID
......
......@@ -62,6 +62,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#include "domain.h"
......
......@@ -48,6 +48,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#include "domain.h"
......
......@@ -51,6 +51,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/bsd_tree.h"
#include "../domain/domain.h"
#include "../mesh/voronoi/voronoi.h"
......
......@@ -40,6 +40,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#include "domain.h"
......
......@@ -39,6 +39,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#include "domain.h"
......
......@@ -44,6 +44,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#include "domain.h"
......
......@@ -40,6 +40,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#include "domain.h"
......
......@@ -43,6 +43,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#include "domain.h"
......
......@@ -44,6 +44,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#include "bsd_tree.h"
#include "domain.h"
......
......@@ -41,6 +41,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#include "domain.h"
......
......@@ -51,6 +51,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../mesh/voronoi/voronoi.h"
......
......@@ -51,6 +51,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../subfind/subfind.h"
#include "fof.h"
......@@ -350,7 +351,7 @@ void fof_prepare_output_order(void)
aux_sort[i].DM_BindingEnergy = PS[i].BindingEnergy;
#endif /* #ifdef SUBFIND */
aux_sort[i].Type = P[i].Type;
aux_sort[i].ID = P[i].ID;
aux_sort[i].ID = P[i].ID;
#if defined(RECOMPUTE_POTENTIAL_IN_SNAPSHOT)
aux_sort[i].FileOrder = P[i].FileOrder;
#endif /* #if defined(RECOMPUTE_POTENTIAL_IN_SNAPSHOT) */
......
......@@ -39,6 +39,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../subfind/subfind.h"
#include "fof.h"
......
......@@ -54,6 +54,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../subfind/subfind.h"
#include "fof.h"
......
......@@ -65,6 +65,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../gitversion/version.h"
#include "../subfind/subfind.h"
......
......@@ -50,6 +50,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../subfind/subfind.h"
#include "fof.h"
......
......@@ -66,6 +66,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../subfind/subfind.h"
#include "fof.h"
......
......@@ -42,6 +42,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../subfind/subfind.h"
#include "fof.h"
......
......@@ -75,6 +75,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
static int *th_list;
......
......@@ -43,6 +43,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/bsd_tree.h"
#include "../domain/domain.h"
......
......@@ -44,6 +44,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#ifdef EXTERNALGRAVITY
......
......@@ -41,6 +41,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
/*! \brief Sets the (comoving) softening length of all particle
......
......@@ -45,6 +45,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#ifdef ALLOW_DIRECT_SUMMATION
......
......@@ -50,6 +50,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
static double ThreadsCosttotal[NUM_THREADS]; /*!< The total cost of the particles/nodes processed by each thread */
......
......@@ -51,6 +51,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#ifdef FORCETEST
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -96,6 +96,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
/*! \brief Data needed for flux calculation.
......
......@@ -38,6 +38,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
int N_Grad = 0;
......
......@@ -62,6 +62,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#if !(defined(RIEMANN_HLLC) || defined(RIEMANN_HLLD))
......
......@@ -42,6 +42,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#if defined(RIEMANN_HLLC)
......
......@@ -69,6 +69,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#if defined(RIEMANN_HLLD)
......
......@@ -40,6 +40,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#ifdef MAXSCALARS
......
......@@ -44,11 +44,11 @@
* - 11.05.2018 Prepared file for public release -- Rainer Weinberger
*/
#include <gsl/gsl_linalg.h>
#include "../main/allvars.h"
#include "../main/proto.h"
#include <gsl/gsl_linalg.h>
/*! \brief Main routine to update the primitive hydrodynamics variables from
* the conserved ones.
*
......
......@@ -49,6 +49,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../mesh/voronoi/voronoi.h"
......
......@@ -55,6 +55,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
static int density_evaluate(int target, int mode, int threadid);
......
......@@ -42,6 +42,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../mesh/voronoi/voronoi.h"
......
......@@ -76,6 +76,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../fof/fof.h"
#include "../gitversion/version.h"
#include "../mesh/voronoi/voronoi.h"
......
......@@ -46,6 +46,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#define CPU_STRING_LEN 120
......
......@@ -73,6 +73,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../debug_md5/Md5.h"
#include "../domain/domain.h"
#include "../mesh/voronoi/voronoi.h"
......
......@@ -50,6 +50,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../mesh/voronoi/voronoi.h"
......
......@@ -38,6 +38,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#ifdef ONEDIMS_SPHERICAL
......
This diff is collapsed.
This diff is collapsed.
......@@ -39,28 +39,25 @@
* void voronoi_1D_order(void)
* int voronoi_1D_compare_key(const void *a, const void *b)
* void voronoi_1D_reorder_gas(void)
*
*
* \par Major modifications and contributions:
*
*
* - DD.MM.YYYY Description
* - 21.05.2018 Prepared file for public release -- Rainer Weinberger
*/
#include <gmp.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <gmp.h>
#include "../../main/allvars.h"
#include "../../main/proto.h"
#include "voronoi.h"
#include "voronoi.h"
#if defined (ONEDIMS) && !defined (ONEDIMS_SPHERICAL) /* will only be compiled in 1D case */
#if defined(ONEDIMS) && !defined(ONEDIMS_SPHERICAL) /* will only be compiled in 1D case */
/*! \brief Output of Voroioi mesh to file.
*
......@@ -68,12 +65,11 @@
*
* \return void
*/
void write_voronoi_mesh(tessellation * T, char *fname, int writeTask, int lastTask)
void write_voronoi_mesh(tessellation *T, char *fname, int writeTask, int lastTask)
{
terminate("write_voronoi_mesh not supported in 1d case!");
}
/*! \brief Initialises 1d tessellation and create all-enclosing segment.
*
* \param[out] T Pointer to tessllation structure which is set and its arrays
......@@ -81,7 +77,7 @@ void write_voronoi_mesh(tessellation * T, char *fname, int writeTask, int lastTa
*
* \return void
*/
void initialize_and_create_first_tetra(tessellation * T)
void initialize_and_create_first_tetra(tessellation *T)
{
char msg[200];
......@@ -105,7 +101,6 @@ void initialize_and_create_first_tetra(tessellation * T)
T->Nvf = 0;
T->Ndt = 0;
T->VF = mymalloc_movable(&T->VF, "VF", T->MaxNvf * sizeof(face));
T->DP = mymalloc_movable(&T->DP, "DP", (T->MaxNdp + 5) * sizeof(point));
......@@ -114,7 +109,6 @@ void initialize_and_create_first_tetra(tessellation * T)
T->DT = mymalloc_movable(&T->DT, "DT", T->MaxNdt * sizeof(tetra));
}
/*! \brief Computes circumcircles in 1d.
*
* Not necessary in 1d. However, this function has to exist for the 1d code
......@@ -124,10 +118,7 @@ void initialize_and_create_first_tetra(tessellation * T)
*
* \return void
*/
void compute_circumcircles(tessellation * T)
{
}
void compute_circumcircles(tessellation *T) {}
/*! \brief Empty funciton in 1d case.
*
......@@ -136,10 +127,7 @@ void compute_circumcircles(tessellation * T)
*
* \return void
*/
void set_integers_for_point(tessellation * T, int pp)
{
}
void set_integers_for_point(tessellation *T, int pp) {}
/*! \brief Empty funciton in 1d case.
*
......@@ -148,11 +136,7 @@ void set_integers_for_point(tessellation * T, int pp)
*
* \return 0
*/
int insert_point(tessellation * T, int pp, int ttstart)
{
return 0;
}
int insert_point(tessellation *T, int pp, int ttstart) { return 0; }
/*! \brief Wrapper routine to search for ghost cells for boundary cells.
*
......@@ -160,11 +144,7 @@ int insert_point(tessellation * T, int pp, int ttstart)
*
* \return 0
*/
int voronoi_ghost_search(tessellation * T)
{
return voronoi_ghost_search_alternative(T);
}
int voronoi_ghost_search(tessellation *T) { return voronoi_ghost_search_alternative(T); }
/*! \brief Empty funciton in 1d case.
*
......@@ -173,11 +153,7 @@ int voronoi_ghost_search(tessellation * T)
*
* \return 0
*/
int count_undecided_tetras(tessellation * T)
{
return 0;
}
int count_undecided_tetras(tessellation *T) { return 0; }
/*! \brief Searches for ghost cells in 1d Voronoi mesh.
*
......@@ -187,55 +163,54 @@ int count_undecided_tetras(tessellation * T)
*
* \return 0
*/
int voronoi_ghost_search_alternative(tessellation * T)
int voronoi_ghost_search_alternative(tessellation *T)
{
double xl, xr;
int index_l, index_r;
#if defined(REFLECTIVE_X)
xl = -P[0].Pos[0];
xl = -P[0].Pos[0];
index_l = 0;
xr = boxSize_X + (boxSize_X - P[NumGas - 1].Pos[0]);
xr = boxSize_X + (boxSize_X - P[NumGas - 1].Pos[0]);
index_r = NumGas - 1;
#else /* #if defined(REFLECTIVE_X) */
xl = P[NumGas - 1].Pos[0] - boxSize_X;
#else /* #if defined(REFLECTIVE_X) */
xl = P[NumGas - 1].Pos[0] - boxSize_X;
index_l = NumGas - 1;
xr = P[0].Pos[0] + boxSize_X;
xr = P[0].Pos[0] + boxSize_X;
index_r = 0;
#endif /* #if defined(REFLECTIVE_X) #else */
point *DP = T->DP;
DP[-1].x = xl;
DP[-1].y = 0;
DP[-1].z = 0;
DP[-1].task = ThisTask;
DP[-1].ID = P[index_l].ID;
DP[-1].index = index_l + NumGas; /* this is a mirrored local point */
DP[-1].x = xl;
DP[-1].y = 0;
DP[-1].z = 0;
DP[-1].task = ThisTask;
DP[-1].ID = P[index_l].ID;
DP[-1].index = index_l + NumGas; /* this is a mirrored local point */
#if defined(REFLECTIVE_X)
DP[-1].image_flags = REFL_X_FLAGS;
#if (REFLECTIVE_X == 2)
#if(REFLECTIVE_X == 2)
DP[-1].image_flags |= OUTFLOW_X;
#endif /* #if (REFLECTIVE_X == 2) */
#endif /* #if defined(REFLECTIVE_X) */
DP[NumGas].x = xr;
DP[NumGas].y = 0;
DP[NumGas].z = 0;
DP[NumGas].task = ThisTask;
DP[NumGas].ID = P[index_r].ID;
DP[NumGas].index = index_r + NumGas; /* this is a mirrored local point */
DP[NumGas].x = xr;
DP[NumGas].y = 0;
DP[NumGas].z = 0;
DP[NumGas].task = ThisTask;
DP[NumGas].ID = P[index_r].ID;
DP[NumGas].index = index_r + NumGas; /* this is a mirrored local point */
#if defined(REFLECTIVE_X)
DP[NumGas].image_flags = REFL_X_FLAGS;
#if (REFLECTIVE_X == 2)
#if(REFLECTIVE_X == 2)
DP[NumGas].image_flags |= OUTFLOW_X;
#endif /* #if (REFLECTIVE_X == 2) */
#endif /* #if defined(REFLECTIVE_X) */
return 0;
}
/*! \brief Computes faces and volume of cells in 1d Voronoi mesh.
*
* Also computes the center of mass.
......@@ -248,9 +223,9 @@ void compute_voronoi_faces_and_volumes(void)
tessellation *T = &Mesh;
T->Nvf = 0;
T->Nvf = 0;
point *DP = T->DP;
face *VF = T->VF;
face *VF = T->VF;
for(i = -1; i < NumGas; i++)
{
......@@ -259,8 +234,8 @@ void compute_voronoi_faces_and_volumes(void)
VF[T->Nvf].cx = 0.5 * (DP[i].x + DP[i + 1].x);
VF[T->Nvf].cy = 0;
VF[T->Nvf].cz = 0;
VF[T->Nvf].cy = 0;
VF[T->Nvf].cz = 0;
VF[T->Nvf].area = 1;
T->Nvf++;
......@@ -268,7 +243,7 @@ void compute_voronoi_faces_and_volumes(void)
for(i = 0; i < NumGas; i++)
{
SphP[i].Volume = VF[i + 1].cx - VF[i].cx;
SphP[i].Volume = VF[i + 1].cx - VF[i].cx;
SphP[i].Center[0] = 0.5 * (VF[i + 1].cx + VF[i].cx);
SphP[i].Center[1] = 0;
SphP[i].Center[2] = 0;
......@@ -277,20 +252,16 @@ void compute_voronoi_faces_and_volumes(void)
}
}
/*! \brief Data for 1d Voronoi mesh.
*/
static struct voronoi_1D_data
{
double x;
int index;
}
*mp;
} * mp;
static int *Id;
/*! \brief Sort cells by their position and reorder in P and SphP array.
*
* \return void
......@@ -303,18 +274,17 @@ void voronoi_1D_order(void)
if(NumGas)
{
mp = (struct voronoi_1D_data *) mymalloc("mp", sizeof(struct voronoi_1D_data) * NumGas);
Id = (int *) mymalloc("Id", sizeof(int) * NumGas);
mp = (struct voronoi_1D_data *)mymalloc("mp", sizeof(struct voronoi_1D_data) * NumGas);
Id = (int *)mymalloc("Id", sizeof(int) * NumGas);
for(i = 0; i < NumGas; i++)
{
mp[i].index = i;
mp[i].x = P[i].Pos[0];
mp[i].x = P[i].Pos[0];
}
mysort(mp, NumGas, sizeof(struct voronoi_1D_data), voronoi_1D_compare_key);
for(i = 0; i < NumGas; i++)
Id[mp[i].index] = i;
......@@ -327,7 +297,6 @@ void voronoi_1D_order(void)
mpi_printf("1D order done.\n");
}
/*! \brief Compare x value of voronoi_1D_data objects.
*
* \param[in] a Pointer to first voronoi_1D_data object.
......@@ -337,16 +306,15 @@ void voronoi_1D_order(void)
*/
int voronoi_1D_compare_key(const void *a, const void *b)
{
if(((struct voronoi_1D_data *) a)->x < (((struct voronoi_1D_data *) b)->x))
if(((struct voronoi_1D_data *)a)->x < (((struct voronoi_1D_data *)b)->x))
return -1;
if(((struct voronoi_1D_data *) a)->x > (((struct voronoi_1D_data *) b)->x))
if(((struct voronoi_1D_data *)a)->x > (((struct voronoi_1D_data *)b)->x))
return +1;
return 0;
}
/*! \brief Order the gas cells according to the index given in the ID array.
*
* \return void
......@@ -362,28 +330,28 @@ void voronoi_1D_reorder_gas(void)
{
if(Id[i] != i)
{
Psource = P[i];
Psource = P[i];
SphPsource = SphP[i];
idsource = Id[i];
dest = Id[i];
dest = Id[i];
do
{
Psave = P[dest];
Psave = P[dest];
SphPsave = SphP[dest];
idsave = Id[dest];
idsave = Id[dest];
P[dest] = Psource;
P[dest] = Psource;
SphP[dest] = SphPsource;
Id[dest] = idsource;
Id[dest] = idsource;
if(dest == i)
break;
Psource = Psave;
Psource = Psave;
SphPsource = SphPsave;
idsource = idsave;
idsource = idsave;
dest = idsource;
}
......@@ -392,5 +360,4 @@ void voronoi_1D_reorder_gas(void)
}
}
#endif /* #if defined (ONEDIMS) && !defined (ONEDIMS_SPHERICAL) */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -56,6 +56,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../gravity/forcetree.h"
......
......@@ -44,8 +44,8 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../gravity/forcetree.h"
#include "../gravity/forcetree.h"
#ifdef USE_SFR
......
......@@ -45,6 +45,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../gravity/forcetree.h"
#ifdef USE_SFR
......
......@@ -44,6 +44,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../fof/fof.h"
......
......@@ -42,6 +42,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../fof/fof.h"
#include "subfind.h"
......
......@@ -42,6 +42,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../fof/fof.h"
......
......@@ -47,6 +47,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../gravity/forcetree.h"
#include "subfind.h"
......
......@@ -43,6 +43,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../fof/fof.h"
#include "subfind.h"
......
......@@ -71,6 +71,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../domain/domain.h"
#include "../fof/fof.h"
#include "subfind.h"
......
......@@ -46,6 +46,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
/*! \brief Applies gravity kick to particles.
......
......@@ -42,6 +42,7 @@
#include "../main/allvars.h"
#include "../main/proto.h"
#include "../mesh/voronoi/voronoi.h"
#if USEDBITS > 31
......