Commit 4847aedf authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Merge remote-tracking branch 'origin/master' into lean_tasks

parents 1f84dd3e 1960b4d1
......@@ -76,12 +76,21 @@ PointMassPotential:
# Isothermal potential parameters
IsothermalPotential:
position_x: 100. # Location of centre of isothermal potential (internal units)
position_x: 100. # Location of centre of isothermal potential with respect to centre of the box (internal units)
position_y: 100.
position_z: 100.
vrot: 200. # Rotation speed of isothermal potential (internal units)
timestep_mult: 0.03 # Dimensionless pre-factor for the time-step condition
# External potential parameters
SoftenedIsothermalPotential:
position_x: 0. # Location of centre of isothermal potential with respect to centre of the box (internal units)
position_y: 0.
position_z: 0.
vrot: 200. # rotation speed of isothermal potential (internal units)
epsilon: 0.1 # Softening size (internal units)
timestep_mult: 0.03 # controls time step
# Disk-patch potential parameters
DiscPatchPotential:
surface_density: 10. # Surface density of the disc (internal units)
......
......@@ -331,4 +331,48 @@ void dumpMETISGraph(const char *prefix, idx_t nvertices, idx_t nvertexweights,
}
}
#endif
#endif /* HAVE_METIS */
#ifdef HAVE_MPI
/**
* @brief Dump the positions and MPI ranks of the given top-level cells
* to a simple text file.
*
* Can be used to visualise the partitioning of an MPI run. Note should
* be used immediately after repartitioning when the top-level cells
* have been assigned their nodes. Each time this is called a new file
* with the given prefix, a unique integer and type of .dat is created.
*
* @param prefix base output filename
* @param cells_top the top-level cells.
* @param nr_cells the number of cells.
*/
void dumpCellRanks(const char *prefix, struct cell *cells_top,
int nr_cells) {
FILE *file = NULL;
/* Name of output file. */
static int nseq = 0;
char fname[200];
sprintf(fname, "%s_%03d.dat", prefix, nseq);
nseq++;
file = fopen(fname, "w");
/* Header. */
fprintf(file, "# %6s %6s %6s %6s %6s %6s %6s\n",
"x", "y", "z", "xw", "yw", "zw", "rank");
/* Output */
for (int i = 0; i < nr_cells; i++) {
struct cell *c = &cells_top[i];
fprintf(file, " %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6d\n",
c->loc[0], c->loc[1], c->loc[2], c->width[0],
c->width[1], c->width[2], c->nodeID);
}
fclose(file);
}
#endif /* HAVE_MPI */
......@@ -37,6 +37,11 @@ int checkSpacehmax(struct space *s);
#include "metis.h"
void dumpMETISGraph(const char *prefix, idx_t nvtxs, idx_t ncon, idx_t *xadj,
idx_t *adjncy, idx_t *vwgt, idx_t *vsize, idx_t *adjwgt);
#endif
#ifdef HAVE_MPI
void dumpCellRanks(const char *prefix, struct cell *cells_top,
int nr_cells);
#endif
#endif /* SWIFT_DEBUG_H */
Supports Markdown
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