From c31ff38461861d397580cf3f7aa397c5c1cfdfe7 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 25 Mar 2019 18:51:33 +0100 Subject: egs: reindent --- ell_grid_solve.c | 68 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/ell_grid_solve.c b/ell_grid_solve.c index 5b4fade..12863d0 100644 --- a/ell_grid_solve.c +++ b/ell_grid_solve.c @@ -187,48 +187,48 @@ static void boundaries_apply(EGSContext *ctx, int init) start = gettime(); for (int order_idx = 0; order_idx < ARRAY_ELEMS(bnd_type_order); order_idx++) { - for (int i = 0; i < ARRAY_ELEMS(ctx->boundaries); i++) { - MG2DBoundary *bnd = ctx->boundaries[i]; + for (int i = 0; i < ARRAY_ELEMS(ctx->boundaries); i++) { + MG2DBoundary *bnd = ctx->boundaries[i]; - const int ci = mg2d_bnd_coord_idx(i); - const ptrdiff_t stride_boundary = strides[!ci]; - const ptrdiff_t stride_offset = strides[ci]; - const size_t size_boundary = ctx->domain_size[!ci]; - const size_t size_offset = ctx->domain_size[ci]; + const int ci = mg2d_bnd_coord_idx(i); + const ptrdiff_t stride_boundary = strides[!ci]; + const ptrdiff_t stride_offset = strides[ci]; + const size_t size_boundary = ctx->domain_size[!ci]; + const size_t size_offset = ctx->domain_size[ci]; - double *dst = ctx->u->data + mg2d_bnd_is_upper(i) * ((size_offset - 1) * stride_offset); - const ptrdiff_t dst_strides[] = { stride_boundary, mg2d_bnd_out_dir(i) * stride_offset }; + double *dst = ctx->u->data + mg2d_bnd_is_upper(i) * ((size_offset - 1) * stride_offset); + const ptrdiff_t dst_strides[] = { stride_boundary, mg2d_bnd_out_dir(i) * stride_offset }; - if (bnd->type != bnd_type_order[order_idx]) - continue; + if (bnd->type != bnd_type_order[order_idx]) + continue; - switch (bnd->type) { - case MG2D_BC_TYPE_FIXVAL: - if (init && !priv->bnd_zero[i]) { + switch (bnd->type) { + case MG2D_BC_TYPE_FIXVAL: + if (init && !priv->bnd_zero[i]) { + start_bnd = gettime(); + boundaries_apply_fixval(dst, dst_strides, bnd->val, + bnd->val_stride, size_boundary); + ctx->time_bnd_fixval += gettime() - start_bnd; + ctx->count_bnd_fixval++; + } + break; + case MG2D_BC_TYPE_REFLECT: start_bnd = gettime(); - boundaries_apply_fixval(dst, dst_strides, bnd->val, - bnd->val_stride, size_boundary); - ctx->time_bnd_fixval += gettime() - start_bnd; - ctx->count_bnd_fixval++; + boundaries_apply_reflect(dst, dst_strides, bnd->val, + bnd->val_stride, size_boundary); + ctx->time_bnd_reflect += gettime() - start_bnd; + ctx->count_bnd_reflect++; + break; + case MG2D_BC_TYPE_FALLOFF: + start_bnd = gettime(); + boundaries_apply_falloff(dst, dst_strides, bnd->val, + bnd->val_stride, size_boundary, ctx); + ctx->time_bnd_falloff += gettime() - start_bnd; + ctx->count_bnd_falloff++; + break; } - break; - case MG2D_BC_TYPE_REFLECT: - start_bnd = gettime(); - boundaries_apply_reflect(dst, dst_strides, bnd->val, - bnd->val_stride, size_boundary); - ctx->time_bnd_reflect += gettime() - start_bnd; - ctx->count_bnd_reflect++; - break; - case MG2D_BC_TYPE_FALLOFF: - start_bnd = gettime(); - boundaries_apply_falloff(dst, dst_strides, bnd->val, - bnd->val_stride, size_boundary, ctx); - ctx->time_bnd_falloff += gettime() - start_bnd; - ctx->count_bnd_falloff++; - break; } } - } /* fill in the corner ghosts */ start_bnd = gettime(); -- cgit v1.2.3