Skip to content

Commit

Permalink
Apply p4estindent.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkestene committed Dec 20, 2024
1 parent 798add7 commit d924914
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 150 deletions.
34 changes: 17 additions & 17 deletions example/simple/simple2.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ static const simple_regression_t regression[] =
/* *INDENT-ON* */

static void
init_fn (p4est_t * p4est, p4est_topidx_t which_tree,
p4est_quadrant_t * quadrant)
init_fn (p4est_t *p4est, p4est_topidx_t which_tree,
p4est_quadrant_t *quadrant)
{
user_data_t *data = (user_data_t *) quadrant->p.user_data;

data->a = which_tree;
}

static int
refine_normal_fn (p4est_t * p4est, p4est_topidx_t which_tree,
p4est_quadrant_t * quadrant)
refine_normal_fn (p4est_t *p4est, p4est_topidx_t which_tree,
p4est_quadrant_t *quadrant)
{
if ((int) quadrant->level >= (refine_level - (int) (which_tree % 3))) {
return 0;
Expand All @@ -168,8 +168,8 @@ refine_normal_fn (p4est_t * p4est, p4est_topidx_t which_tree,
}

static int
refine_uniform_fn(p4est_t *p4est, p4est_topidx_t which_tree,
p4est_quadrant_t *quadrant)
refine_uniform_fn (p4est_t *p4est, p4est_topidx_t which_tree,
p4est_quadrant_t *quadrant)
{
if ((int) quadrant->level >= refine_level) {
return 0;
Expand All @@ -178,8 +178,8 @@ refine_uniform_fn(p4est_t *p4est, p4est_topidx_t which_tree,
}

static int
refine_evil_fn (p4est_t * p4est, p4est_topidx_t which_tree,
p4est_quadrant_t * quadrant)
refine_evil_fn (p4est_t *p4est, p4est_topidx_t which_tree,
p4est_quadrant_t *quadrant)
{
if ((int) quadrant->level >= refine_level) {
return 0;
Expand All @@ -192,8 +192,8 @@ refine_evil_fn (p4est_t * p4est, p4est_topidx_t which_tree,
}

static int
refine_evil3_fn (p4est_t * p4est, p4est_topidx_t which_tree,
p4est_quadrant_t * quadrant)
refine_evil3_fn (p4est_t *p4est, p4est_topidx_t which_tree,
p4est_quadrant_t *quadrant)
{
p4est_qcoord_t u2;
p4est_quadrant_t ref;
Expand Down Expand Up @@ -225,8 +225,8 @@ refine_evil3_fn (p4est_t * p4est, p4est_topidx_t which_tree,
}

static int
coarsen_evil_fn (p4est_t * p4est, p4est_topidx_t which_tree,
p4est_quadrant_t * q[])
coarsen_evil_fn (p4est_t *p4est, p4est_topidx_t which_tree,
p4est_quadrant_t *q[])
{
if (p4est->mpirank >= 2) {
return 1;
Expand All @@ -236,8 +236,8 @@ coarsen_evil_fn (p4est_t * p4est, p4est_topidx_t which_tree,
}

static int
refine_icosahedron_fn (p4est_t * p4est, p4est_topidx_t which_tree,
p4est_quadrant_t * quadrant)
refine_icosahedron_fn (p4est_t *p4est, p4est_topidx_t which_tree,
p4est_quadrant_t *quadrant)
{

p4est_geometry_t *geom = (p4est_geometry_t *) p4est->user_pointer;
Expand Down Expand Up @@ -436,15 +436,15 @@ main (int argc, char **argv)
geom = p4est_geometry_new_pillow (connectivity, R);
}
else if (config == P4EST_CONFIG_PILLOW_DISK) {
double R = 1.0; /* disk radius default value */
int iconfig;
double R = 1.0; /* disk radius default value */
int iconfig;
pillow_disk_config_t pconfig = FIG32A;

if (argc >= 4)
R = atof (argv[3]);
if (argc >= 5) {
iconfig = atoi (argv[4]);
if (iconfig >=FIG32A && iconfig <=FIG32D) {
if (iconfig >= FIG32A && iconfig <= FIG32D) {
pconfig = (pillow_disk_config_t) iconfig;
}
}
Expand Down
23 changes: 11 additions & 12 deletions example/simple/simple3.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,17 @@ static const simple_regression_t regression[] =
/* *INDENT-ON* */

static void
init_fn (p8est_t * p8est, p4est_topidx_t which_tree,
p8est_quadrant_t * quadrant)
init_fn (p8est_t *p8est, p4est_topidx_t which_tree,
p8est_quadrant_t *quadrant)
{
user_data_t *data = (user_data_t *) quadrant->p.user_data;

data->a = which_tree;
}

static int
refine_sparse_fn (p8est_t * p8est, p4est_topidx_t which_tree,
p8est_quadrant_t * quadrant)
refine_sparse_fn (p8est_t *p8est, p4est_topidx_t which_tree,
p8est_quadrant_t *quadrant)
{
if (which_tree != 0) {
return 0;
Expand All @@ -150,8 +150,8 @@ refine_sparse_fn (p8est_t * p8est, p4est_topidx_t which_tree,
}

static int
refine_normal_fn (p8est_t * p8est, p4est_topidx_t which_tree,
p8est_quadrant_t * quadrant)
refine_normal_fn (p8est_t *p8est, p4est_topidx_t which_tree,
p8est_quadrant_t *quadrant)
{
if ((int) quadrant->level >= (refine_level - (int) (which_tree % 3))) {
return 0;
Expand All @@ -171,16 +171,15 @@ refine_normal_fn (p8est_t * p8est, p4est_topidx_t which_tree,
}

static int
refine_uniform_fn(p8est_t *p4est, p4est_topidx_t which_tree,
p8est_quadrant_t *quadrant)
refine_uniform_fn (p8est_t *p4est, p4est_topidx_t which_tree,
p8est_quadrant_t *quadrant)
{
if ((int) quadrant->level >= refine_level) {
return 0;
}
return 1;
}


int
main (int argc, char **argv)
{
Expand Down Expand Up @@ -318,15 +317,15 @@ main (int argc, char **argv)
geom = p8est_geometry_new_sphere (connectivity, 1., 0.191728, 0.039856);
}
else if (config == P8EST_CONFIG_PILLOW_SPHERE) {
double R = 1.0; /* sphere radius default value */
int iconfig;
double R = 1.0; /* sphere radius default value */
int iconfig;
pillow_sphere_config_t pconfig = FIG52B;

if (argc >= 4)
R = atof (argv[3]);
if (argc >= 5) {
iconfig = atoi (argv[4]);
if (iconfig >=FIG52B && iconfig <=FIG52C) {
if (iconfig >= FIG52B && iconfig <= FIG52C) {
pconfig = (pillow_sphere_config_t) iconfig;
}
}
Expand Down
Loading

0 comments on commit d924914

Please sign in to comment.