From edc1e17fc9a7367a0c7ba7c885581b473e98f188 Mon Sep 17 00:00:00 2001 From: Sebastian Grimberg Date: Mon, 17 Apr 2023 15:44:01 -0700 Subject: [PATCH] clang-format --- backends/ref/ceed-ref-restriction.c | 46 ++++++++++++++++++----------- interface/ceed-preconditioning.c | 3 +- tests/t570-operator.c | 3 +- tests/t570-operator.h | 4 +-- 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/backends/ref/ceed-ref-restriction.c b/backends/ref/ceed-ref-restriction.c index 519d20f17c..0f23d37159 100644 --- a/backends/ref/ceed-ref-restriction.c +++ b/backends/ref/ceed-ref-restriction.c @@ -16,8 +16,8 @@ // Core ElemRestriction Apply Code //------------------------------------------------------------------------------ static inline int CeedElemRestrictionApply_Ref_Core(CeedElemRestriction r, const CeedInt num_comp, const CeedInt blk_size, const CeedInt comp_stride, - CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, - CeedRequest *request) { + CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, + CeedVector v, CeedRequest *request) { CeedElemRestriction_Ref *impl; CeedCallBackend(CeedElemRestrictionGetData(r, &impl)); const CeedScalar *uu; @@ -81,8 +81,7 @@ static inline int CeedElemRestrictionApply_Ref_Core(CeedElemRestriction r, const CeedPragmaSIMD for (CeedInt i = 0; i < elem_size * blk_size; i++) { if (!use_orient || !impl->orient) { // Unsigned restriction - vv[elem_size * (k * blk_size + num_comp * e) + i - v_offset] = - uu[impl->offsets[i + elem_size * e] + k * comp_stride]; + vv[elem_size * (k * blk_size + num_comp * e) + i - v_offset] = uu[impl->offsets[i + elem_size * e] + k * comp_stride]; } else { // Signed restriction vv[elem_size * (k * blk_size + num_comp * e) + i - v_offset] = @@ -138,8 +137,7 @@ static inline int CeedElemRestrictionApply_Ref_Core(CeedElemRestriction r, const for (CeedInt j = i; j < i + CeedIntMin(blk_size, num_elem - e); j++) { if (!use_orient || !impl->orient) { // Unsigned restriction - vv[impl->offsets[j + e * elem_size] + k * comp_stride] += - uu[elem_size * (k * blk_size + num_comp * e) + j - v_offset]; + vv[impl->offsets[j + e * elem_size] + k * comp_stride] += uu[elem_size * (k * blk_size + num_comp * e) + j - v_offset]; } else { // Signed restriction vv[impl->offsets[j + e * elem_size] + k * comp_stride] += @@ -161,66 +159,78 @@ static inline int CeedElemRestrictionApply_Ref_Core(CeedElemRestriction r, const // ElemRestriction Apply - Common Sizes //------------------------------------------------------------------------------ static int CeedElemRestrictionApply_Ref_110(CeedElemRestriction r, const CeedInt num_comp, const CeedInt blk_size, const CeedInt comp_stride, - CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, CeedRequest *request) { + CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, + CeedRequest *request) { return CeedElemRestrictionApply_Ref_Core(r, 1, 1, comp_stride, start, stop, use_orient, t_mode, u, v, request); } static int CeedElemRestrictionApply_Ref_111(CeedElemRestriction r, const CeedInt num_comp, const CeedInt blk_size, const CeedInt comp_stride, - CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, CeedRequest *request) { + CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, + CeedRequest *request) { return CeedElemRestrictionApply_Ref_Core(r, 1, 1, 1, start, stop, use_orient, t_mode, u, v, request); } static int CeedElemRestrictionApply_Ref_180(CeedElemRestriction r, const CeedInt num_comp, const CeedInt blk_size, const CeedInt comp_stride, - CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, CeedRequest *request) { + CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, + CeedRequest *request) { return CeedElemRestrictionApply_Ref_Core(r, 1, 8, comp_stride, start, stop, use_orient, t_mode, u, v, request); } static int CeedElemRestrictionApply_Ref_181(CeedElemRestriction r, const CeedInt num_comp, const CeedInt blk_size, const CeedInt comp_stride, - CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, CeedRequest *request) { + CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, + CeedRequest *request) { return CeedElemRestrictionApply_Ref_Core(r, 1, 8, 1, start, stop, use_orient, t_mode, u, v, request); } static int CeedElemRestrictionApply_Ref_310(CeedElemRestriction r, const CeedInt num_comp, const CeedInt blk_size, const CeedInt comp_stride, - CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, CeedRequest *request) { + CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, + CeedRequest *request) { return CeedElemRestrictionApply_Ref_Core(r, 3, 1, comp_stride, start, stop, use_orient, t_mode, u, v, request); } static int CeedElemRestrictionApply_Ref_311(CeedElemRestriction r, const CeedInt num_comp, const CeedInt blk_size, const CeedInt comp_stride, - CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, CeedRequest *request) { + CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, + CeedRequest *request) { return CeedElemRestrictionApply_Ref_Core(r, 3, 1, 1, start, stop, use_orient, t_mode, u, v, request); } static int CeedElemRestrictionApply_Ref_380(CeedElemRestriction r, const CeedInt num_comp, const CeedInt blk_size, const CeedInt comp_stride, - CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, CeedRequest *request) { + CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, + CeedRequest *request) { return CeedElemRestrictionApply_Ref_Core(r, 3, 8, comp_stride, start, stop, use_orient, t_mode, u, v, request); } static int CeedElemRestrictionApply_Ref_381(CeedElemRestriction r, const CeedInt num_comp, const CeedInt blk_size, const CeedInt comp_stride, - CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, CeedRequest *request) { + CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, + CeedRequest *request) { return CeedElemRestrictionApply_Ref_Core(r, 3, 8, 1, start, stop, use_orient, t_mode, u, v, request); } // LCOV_EXCL_START static int CeedElemRestrictionApply_Ref_510(CeedElemRestriction r, const CeedInt num_comp, const CeedInt blk_size, const CeedInt comp_stride, - CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, CeedRequest *request) { + CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, + CeedRequest *request) { return CeedElemRestrictionApply_Ref_Core(r, 5, 1, comp_stride, start, stop, use_orient, t_mode, u, v, request); } // LCOV_EXCL_STOP static int CeedElemRestrictionApply_Ref_511(CeedElemRestriction r, const CeedInt num_comp, const CeedInt blk_size, const CeedInt comp_stride, - CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, CeedRequest *request) { + CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, + CeedRequest *request) { return CeedElemRestrictionApply_Ref_Core(r, 5, 1, 1, start, stop, use_orient, t_mode, u, v, request); } // LCOV_EXCL_START static int CeedElemRestrictionApply_Ref_580(CeedElemRestriction r, const CeedInt num_comp, const CeedInt blk_size, const CeedInt comp_stride, - CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, CeedRequest *request) { + CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, + CeedRequest *request) { return CeedElemRestrictionApply_Ref_Core(r, 5, 8, comp_stride, start, stop, use_orient, t_mode, u, v, request); } // LCOV_EXCL_STOP static int CeedElemRestrictionApply_Ref_581(CeedElemRestriction r, const CeedInt num_comp, const CeedInt blk_size, const CeedInt comp_stride, - CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, CeedRequest *request) { + CeedInt start, CeedInt stop, bool use_orient, CeedTransposeMode t_mode, CeedVector u, CeedVector v, + CeedRequest *request) { return CeedElemRestrictionApply_Ref_Core(r, 5, 8, 1, start, stop, use_orient, t_mode, u, v, request); } diff --git a/interface/ceed-preconditioning.c b/interface/ceed-preconditioning.c index 3e4f3b177b..af868a5247 100644 --- a/interface/ceed-preconditioning.c +++ b/interface/ceed-preconditioning.c @@ -442,7 +442,8 @@ static inline int CeedCompositeOperatorLinearAssembleAddDiagonal(CeedOperator op Users should generally use CeedOperatorLinearAssembleSymbolic() - Note: For operators using oriented element restrictions, entries in rows or cols may be negative indicating the assembled value at this nonzero should be negated + Note: For operators using oriented element restrictions, entries in rows or cols may be negative indicating the assembled value at this nonzero +should be negated @param[in] op CeedOperator to assemble nonzero pattern @param[in] offset Offset for number of entries diff --git a/tests/t570-operator.c b/tests/t570-operator.c index 20eb3b4336..3da2208be3 100644 --- a/tests/t570-operator.c +++ b/tests/t570-operator.c @@ -1,13 +1,14 @@ /// @file /// Test assembly of H(div) mass matrix operator diagonal /// \test Test assembly of H(div) mass matrix operator diagonal +#include "t570-operator.h" + #include #include #include #include #include "t330-basis.h" -#include "t570-operator.h" int main(int argc, char **argv) { Ceed ceed; diff --git a/tests/t570-operator.h b/tests/t570-operator.h index cab7f4865b..e5cc2eb467 100644 --- a/tests/t570-operator.h +++ b/tests/t570-operator.h @@ -8,9 +8,7 @@ #include // Compute det(A) -CEED_QFUNCTION_HELPER CeedScalar MatDet2x2(const CeedScalar A[2][2]) { - return A[0][0] * A[1][1] - A[1][0] * A[0][1]; -} +CEED_QFUNCTION_HELPER CeedScalar MatDet2x2(const CeedScalar A[2][2]) { return A[0][0] * A[1][1] - A[1][0] * A[0][1]; } // Compute alpha * A^T * B = C CEED_QFUNCTION_HELPER int AlphaMatTransposeMatMult2x2(const CeedScalar alpha, const CeedScalar A[2][2], const CeedScalar B[2][2],