Skip to content

Commit

Permalink
Feature GMT: selective indent on gmt_models
Browse files Browse the repository at this point in the history
  • Loading branch information
cburstedde committed Apr 13, 2024
1 parent 52960e8 commit c0a2ccc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
10 changes: 5 additions & 5 deletions example/gmt/gmt_models.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,17 +411,17 @@ model_sphere_intersect (p4est_t *p4est,
void *point)
{
/* global gmt context */
global_t *g = (global_t*) p4est->user_pointer;
global_t *g = (global_t *) p4est->user_pointer;
/* generic model */
p4est_gmt_model_t *model = g->model;
/* sphere model */
p4est_gmt_model_sphere_t *sdata;
/* geodesic segment */
const p4est_gmt_sphere_geoseg_t *seg;
/* quadrant height/width */
double qh;
double qh;
/* quadrant corner coordinates */
double coord[4];
double coord[4];

P4EST_ASSERT (model != NULL);
sdata = (p4est_gmt_model_sphere_t *) model->model_data;
Expand Down Expand Up @@ -635,7 +635,7 @@ p4est_gmt_model_sphere_new (int resolution, const char *input,
model->model_data = sdata = P4EST_ALLOC (p4est_gmt_model_sphere_t, 1);
model->c = P4EST_ALLOC (p4est_transfer_search_t, 1);
model->c->points = sc_array_new_count (sizeof (p4est_gmt_sphere_geoseg_t),
local_num_points);
local_num_points);
model->c->num_resp = local_num_points;

/* Set final geodesic count */
Expand Down Expand Up @@ -753,4 +753,4 @@ p4est_gmt_model_destroy (p4est_gmt_model_t *model)
/* destroy connectivity outside of the specific model */
p4est_connectivity_destroy (model->conn);
P4EST_FREE (model);
}
}
25 changes: 13 additions & 12 deletions example/gmt/gmt_models.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,29 @@ typedef int (*p4est_gmt_intersect_t) (p4est_topidx_t which_tree,
* This avoids duplicate code since communication patterns are essentially
* identical for the two types of point we send (owned and responsible).
*/
typedef struct p4est_gmt_comm
typedef struct p4est_gmt_comm
{
/** in the following p refers to the local rank, and q any rank **/

/** data used for sending */
/* number of points that p receives in this iteration */
size_t num_incoming;
size_t num_incoming;
/* q -> {points that are being sent to q } */
sc_array_t **to_send;
sc_array_t **to_send;
/* ranks receiving points from p */
sc_array_t *receivers;
sc_array_t *receivers;
/* number of points each receiver gets from p */
sc_array_t *recvs_counts;
sc_array_t *recvs_counts;

/** data used for receiving */
/* ranks sending points to p */
sc_array_t *senders;
sc_array_t *senders;
/* number of points p gets from each sender */
sc_array_t *senders_counts;
sc_array_t *senders_counts;
/* q -> byte offset to receive message from q at */
size_t * offsets;
} p4est_gmt_comm_t;
size_t *offsets;
}
p4est_gmt_comm_t;

/** General, application specific model data */
typedef struct p4est_gmt_model
Expand All @@ -75,10 +76,10 @@ typedef struct p4est_gmt_model
void *model_data;

/* model points and propagation responsibilities for distributed mode */
p4est_transfer_search_t *c;
p4est_transfer_search_t *c;

/* point-quadrant intersection */
p4est_intersect_t intersect;
p4est_intersect_t intersect;

/** When not NULL, free whatever is stored in model->model_data. */
p4est_gmt_destroy_data_t destroy_data;
Expand Down

0 comments on commit c0a2ccc

Please sign in to comment.