Skip to content

Commit a213af6

Browse files
Revert some whitespace changes for review
1 parent 8afe0d2 commit a213af6

8 files changed

+62
-31
lines changed

interface/ceed-operator.c

+9
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ static int CeedOperatorContextRestoreGenericRead(CeedOperator op, CeedContextFie
438438
439439
@ref Backend
440440
**/
441+
441442
int CeedOperatorGetNumArgs(CeedOperator op, CeedInt *num_args) {
442443
if (op->is_composite) {
443444
// LCOV_EXCL_START
@@ -458,6 +459,7 @@ int CeedOperatorGetNumArgs(CeedOperator op, CeedInt *num_args) {
458459
459460
@ref Backend
460461
**/
462+
461463
int CeedOperatorIsSetupDone(CeedOperator op, bool *is_setup_done) {
462464
*is_setup_done = op->is_backend_setup;
463465
return CEED_ERROR_SUCCESS;
@@ -473,6 +475,7 @@ int CeedOperatorIsSetupDone(CeedOperator op, bool *is_setup_done) {
473475
474476
@ref Backend
475477
**/
478+
476479
int CeedOperatorGetQFunction(CeedOperator op, CeedQFunction *qf) {
477480
if (op->is_composite) {
478481
// LCOV_EXCL_START
@@ -493,6 +496,7 @@ int CeedOperatorGetQFunction(CeedOperator op, CeedQFunction *qf) {
493496
494497
@ref Backend
495498
**/
499+
496500
int CeedOperatorIsComposite(CeedOperator op, bool *is_composite) {
497501
*is_composite = op->is_composite;
498502
return CEED_ERROR_SUCCESS;
@@ -508,6 +512,7 @@ int CeedOperatorIsComposite(CeedOperator op, bool *is_composite) {
508512
509513
@ref Backend
510514
**/
515+
511516
int CeedOperatorGetData(CeedOperator op, void *data) {
512517
*(void **)data = op->data;
513518
return CEED_ERROR_SUCCESS;
@@ -523,6 +528,7 @@ int CeedOperatorGetData(CeedOperator op, void *data) {
523528
524529
@ref Backend
525530
**/
531+
526532
int CeedOperatorSetData(CeedOperator op, void *data) {
527533
op->data = data;
528534
return CEED_ERROR_SUCCESS;
@@ -551,6 +557,7 @@ int CeedOperatorReference(CeedOperator op) {
551557
552558
@ref Backend
553559
**/
560+
554561
int CeedOperatorSetSetupDone(CeedOperator op) {
555562
op->is_backend_setup = true;
556563
return CEED_ERROR_SUCCESS;
@@ -1007,6 +1014,7 @@ int CeedCompositeOperatorAddSub(CeedOperator composite_op, CeedOperator sub_op)
10071014
10081015
@ref Backend
10091016
**/
1017+
10101018
int CeedCompositeOperatorGetNumSub(CeedOperator op, CeedInt *num_suboperators) {
10111019
if (!op->is_composite) {
10121020
// LCOV_EXCL_START
@@ -1027,6 +1035,7 @@ int CeedCompositeOperatorGetNumSub(CeedOperator op, CeedInt *num_suboperators) {
10271035
10281036
@ref Backend
10291037
**/
1038+
10301039
int CeedCompositeOperatorGetSubList(CeedOperator op, CeedOperator **sub_operators) {
10311040
if (!op->is_composite) {
10321041
// LCOV_EXCL_START

interface/ceed-preconditioning.c

+23-6
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ static inline int CeedSingleOperatorAssembleAddDiagonal_Core(CeedOperator op, Ce
276276
CeedElemRestriction assembled_elem_rstr;
277277
CeedInt num_input_fields, num_output_fields;
278278
CeedInt layout[3];
279+
279280
CeedCall(CeedOperatorGetQFunction(op, &qf));
280281
CeedCall(CeedQFunctionGetNumArgs(qf, &num_input_fields, &num_output_fields));
281282
CeedCall(CeedOperatorLinearAssembleQFunctionBuildOrUpdate(op, &assembled_qf, &assembled_elem_rstr, request));
@@ -300,8 +301,10 @@ static inline int CeedSingleOperatorAssembleAddDiagonal_Core(CeedOperator op, Ce
300301
for (CeedInt b = 0; b < num_active_bases; b++) {
301302
// Assemble point block diagonal restriction, if needed
302303
CeedElemRestriction diag_elem_rstr = active_elem_rstrs[b];
304+
303305
if (is_pointblock) {
304306
CeedElemRestriction point_block_elem_rstr;
307+
305308
CeedCall(CeedOperatorCreateActivePointBlockRestriction(diag_elem_rstr, &point_block_elem_rstr));
306309
diag_elem_rstr = point_block_elem_rstr;
307310
}
@@ -313,6 +316,7 @@ static inline int CeedSingleOperatorAssembleAddDiagonal_Core(CeedOperator op, Ce
313316
// Assemble element operator diagonals
314317
CeedScalar *elem_diag_array;
315318
CeedInt num_elem, num_nodes, num_qpts, num_components;
319+
316320
CeedCall(CeedVectorSetValue(elem_diag, 0.0));
317321
CeedCall(CeedVectorGetArray(elem_diag, CEED_MEM_HOST, &elem_diag_array));
318322
CeedCall(CeedElemRestrictionGetNumElements(diag_elem_rstr, &num_elem));
@@ -547,6 +551,7 @@ static int CeedSingleOperatorAssemble(CeedOperator op, CeedInt offset, CeedVecto
547551
// Early exit for empty operator
548552
{
549553
CeedInt num_elem = 0;
554+
550555
CeedCall(CeedOperatorGetNumElements(op, &num_elem));
551556
if (num_elem == 0) return CEED_ERROR_SUCCESS;
552557
}
@@ -558,6 +563,7 @@ static int CeedSingleOperatorAssemble(CeedOperator op, CeedInt offset, CeedVecto
558563
} else {
559564
// Operator fallback
560565
CeedOperator op_fallback;
566+
561567
CeedCall(CeedOperatorGetFallback(op, &op_fallback));
562568
if (op_fallback) {
563569
CeedCall(CeedSingleOperatorAssemble(op_fallback, offset, values));
@@ -573,6 +579,7 @@ static int CeedSingleOperatorAssemble(CeedOperator op, CeedInt offset, CeedVecto
573579
CeedCall(CeedOperatorLinearAssembleQFunctionBuildOrUpdate(op, &assembled_qf, &rstr_q, CEED_REQUEST_IMMEDIATE));
574580
CeedSize qf_length;
575581
CeedCall(CeedVectorGetLength(assembled_qf, &qf_length));
582+
576583
CeedInt num_input_fields, num_output_fields;
577584
CeedOperatorField *input_fields;
578585
CeedOperatorField *output_fields;
@@ -607,16 +614,18 @@ static int CeedSingleOperatorAssemble(CeedOperator op, CeedInt offset, CeedVecto
607614
CeedCall(CeedElemRestrictionGetElementSize(active_rstr, &elem_size));
608615
CeedCall(CeedElemRestrictionGetNumComponents(active_rstr, &num_comp));
609616
CeedCall(CeedBasisGetNumQuadraturePoints(basis_in, &num_qpts));
617+
610618
CeedInt local_num_entries = elem_size * num_comp * elem_size * num_comp * num_elem;
611619

612-
// Loop over elements and put in data structure
620+
// loop over elements and put in data structure
613621
const CeedScalar *assembled_qf_array;
614622
CeedCall(CeedVectorGetArrayRead(assembled_qf, CEED_MEM_HOST, &assembled_qf_array));
623+
615624
CeedInt layout_qf[3];
616625
CeedCall(CeedElemRestrictionGetELayout(rstr_q, &layout_qf));
617626
CeedCall(CeedElemRestrictionDestroy(&rstr_q));
618627

619-
// We store B_mat_in, B_mat_out, BTD, elem_mat in row-major order
628+
// we store B_mat_in, B_mat_out, BTD, elem_mat in row-major order
620629
const CeedScalar **B_mats_in, **B_mats_out;
621630
CeedCall(CeedOperatorAssemblyDataGetBases(data, NULL, NULL, &B_mats_in, &B_mats_out));
622631
const CeedScalar *B_mat_in = B_mats_in[0], *B_mat_out = B_mats_out[0];
@@ -644,10 +653,10 @@ static int CeedSingleOperatorAssemble(CeedOperator op, CeedInt offset, CeedVecto
644653
}
645654
}
646655
}
647-
// Form element matrix itself (for each block component)
656+
// form element matrix itself (for each block component)
648657
CeedCall(CeedMatrixMatrixMultiply(ceed, BTD_mat, B_mat_in, elem_mat, elem_size, elem_size, num_qpts * num_eval_modes_in[0]));
649658

650-
// Put element matrix in coordinate data structure
659+
// put element matrix in coordinate data structure
651660
for (CeedInt i = 0; i < elem_size; i++) {
652661
for (CeedInt j = 0; j < elem_size; j++) {
653662
vals[offset + count] = elem_mat[i * elem_size + j];
@@ -663,6 +672,7 @@ static int CeedSingleOperatorAssemble(CeedOperator op, CeedInt offset, CeedVecto
663672
// LCOV_EXCL_STOP
664673
}
665674
CeedCall(CeedVectorRestoreArray(values, &vals));
675+
666676
CeedCall(CeedVectorRestoreArrayRead(assembled_qf, &assembled_qf_array));
667677
CeedCall(CeedVectorDestroy(&assembled_qf));
668678

@@ -1081,8 +1091,8 @@ int CeedQFunctionAssemblyDataDestroy(CeedQFunctionAssemblyData *data) {
10811091
CeedCall(CeedDestroy(&(*data)->ceed));
10821092
CeedCall(CeedVectorDestroy(&(*data)->vec));
10831093
CeedCall(CeedElemRestrictionDestroy(&(*data)->rstr));
1084-
CeedCall(CeedFree(data));
10851094

1095+
CeedCall(CeedFree(data));
10861096
return CEED_ERROR_SUCCESS;
10871097
}
10881098

@@ -1099,6 +1109,7 @@ int CeedQFunctionAssemblyDataDestroy(CeedQFunctionAssemblyData *data) {
10991109
int CeedOperatorGetOperatorAssemblyData(CeedOperator op, CeedOperatorAssemblyData *data) {
11001110
if (!op->op_assembled) {
11011111
CeedOperatorAssemblyData data;
1112+
11021113
CeedCall(CeedOperatorAssemblyDataCreate(op->ceed, op, &data));
11031114
op->op_assembled = data;
11041115
}
@@ -1229,6 +1240,7 @@ int CeedOperatorAssemblyDataCreate(Ceed ceed, CeedOperator op, CeedOperatorAssem
12291240
}
12301241
if (index == -1) {
12311242
CeedElemRestriction elem_rstr_out;
1243+
12321244
index = num_active_bases;
12331245
CeedCall(CeedRealloc(num_active_bases + 1, &(*data)->active_bases));
12341246
(*data)->active_bases[num_active_bases] = NULL;
@@ -1334,13 +1346,16 @@ int CeedOperatorAssemblyDataGetBases(CeedOperatorAssemblyData data, CeedInt *num
13341346
// Assemble B_in, B_out if needed
13351347
if (assembled_bases_in && !data->assembled_bases_in[0]) {
13361348
CeedInt num_qpts;
1349+
13371350
CeedCall(CeedBasisGetNumQuadraturePoints(data->active_bases[0], &num_qpts));
13381351
for (CeedInt b = 0; b < data->num_active_bases; b++) {
13391352
CeedInt num_nodes;
13401353
CeedScalar *B_in = NULL, *identity = NULL;
13411354
bool has_eval_none = false;
1355+
13421356
CeedCall(CeedBasisGetNumNodes(data->active_bases[b], &num_nodes));
13431357
CeedCall(CeedCalloc(num_qpts * num_nodes * data->num_eval_modes_in[b], &B_in));
1358+
13441359
for (CeedInt i = 0; i < data->num_eval_modes_in[b]; i++) {
13451360
has_eval_none = has_eval_none || (data->eval_modes_in[b][i] == CEED_EVAL_NONE);
13461361
}
@@ -1376,13 +1391,16 @@ int CeedOperatorAssemblyDataGetBases(CeedOperatorAssemblyData data, CeedInt *num
13761391

13771392
if (assembled_bases_out && !data->assembled_bases_out[0]) {
13781393
CeedInt num_qpts;
1394+
13791395
CeedCall(CeedBasisGetNumQuadraturePoints(data->active_bases[0], &num_qpts));
13801396
for (CeedInt b = 0; b < data->num_active_bases; b++) {
13811397
CeedInt num_nodes;
13821398
bool has_eval_none = false;
13831399
CeedScalar *B_out = NULL, *identity = NULL;
1400+
13841401
CeedCall(CeedBasisGetNumNodes(data->active_bases[b], &num_nodes));
13851402
CeedCall(CeedCalloc(num_qpts * num_nodes * data->num_eval_modes_out[b], &B_out));
1403+
13861404
for (CeedInt i = 0; i < data->num_eval_modes_out[b]; i++) {
13871405
has_eval_none = has_eval_none || (data->eval_modes_out[b][i] == CEED_EVAL_NONE);
13881406
}
@@ -2054,7 +2072,6 @@ int CeedCompositeOperatorGetMultiplicity(CeedOperator op, CeedInt num_skip_indic
20542072
CeedCall(CeedElemRestrictionApply(elem_rstr, CEED_NOTRANSPOSE, ones_l_vec, ones_e_vec, CEED_REQUEST_IMMEDIATE));
20552073
CeedCall(CeedElemRestrictionApply(elem_rstr, CEED_TRANSPOSE, ones_e_vec, sub_mult_l_vec, CEED_REQUEST_IMMEDIATE));
20562074
CeedCall(CeedVectorGetArrayRead(sub_mult_l_vec, CEED_MEM_HOST, &sub_mult_array));
2057-
20582075
// ---- Flag every node present in the current suboperator
20592076
for (CeedInt j = 0; j < l_vec_len; j++) {
20602077
if (sub_mult_array[j] > 0.0) mult_array[j] += 1.0;

interface/ceed.c

+5
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ int CeedSetObjectDelegate(Ceed ceed, Ceed delegate, const char *obj_name) {
457457
458458
@ref Backend
459459
**/
460+
460461
int CeedGetOperatorFallbackResource(Ceed ceed, const char **resource) {
461462
*resource = (const char *)ceed->op_fallback_resource;
462463
return CEED_ERROR_SUCCESS;
@@ -472,6 +473,7 @@ int CeedGetOperatorFallbackResource(Ceed ceed, const char **resource) {
472473
473474
@ref Backend
474475
**/
476+
475477
int CeedGetOperatorFallbackCeed(Ceed ceed, Ceed *fallback_ceed) {
476478
if (ceed->has_valid_op_fallback_resource) {
477479
CeedDebug256(ceed, 1, "---------- CeedOperator Fallback ----------\n");
@@ -508,6 +510,7 @@ int CeedGetOperatorFallbackCeed(Ceed ceed, Ceed *fallback_ceed) {
508510
509511
@ref Backend
510512
**/
513+
511514
int CeedSetOperatorFallbackResource(Ceed ceed, const char *resource) {
512515
// Free old
513516
CeedCall(CeedFree(&ceed->op_fallback_resource));
@@ -531,6 +534,7 @@ int CeedSetOperatorFallbackResource(Ceed ceed, const char *resource) {
531534
532535
@ref Backend
533536
**/
537+
534538
int CeedGetOperatorFallbackParentCeed(Ceed ceed, Ceed *parent) {
535539
*parent = ceed->op_fallback_parent;
536540
return CEED_ERROR_SUCCESS;
@@ -546,6 +550,7 @@ int CeedGetOperatorFallbackParentCeed(Ceed ceed, Ceed *parent) {
546550
547551
@ref Backend
548552
**/
553+
549554
int CeedSetDeterministic(Ceed ceed, bool is_deterministic) {
550555
ceed->is_deterministic = is_deterministic;
551556
return CEED_ERROR_SUCCESS;

tests/README.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ This page provides a brief description of the tests for the libCEED library.
44

55
The tests are organized by API object, and some tests are further organized, as required.
66

7-
0. Ceed Tests
8-
1. CeedVector Tests
9-
1.0. CeedVector general tests
10-
1.1. CeedVector error tests
11-
2. CeedElemRestriction Tests
12-
3. CeedBasis Tests
13-
3.0. CeedBasis utility tests
14-
3.1. CeedBasis tensor basis tests
15-
3.2. CeedBasis simplex basis tests
16-
3.3. CeedBasis non-tensor H(div) basis tests
17-
3.4. CeedBasis non-tensor H(curl) basis tests
18-
4. CeedQFunction Tests
19-
4.0. CeedQFunction user code tests
20-
4.1. CeedQFunction gallery code tests
21-
5. CeedOperator Tests
22-
5.0. CeedOperator with tensor bases tests
23-
5.1. CeedOperator with simplex bases tests
24-
5.2. CeedOperator with operator composition tests
25-
5.3. CeedOperator diagonal and CeedQFunction assembly tests
26-
5.4. CeedOperator element inverse tests
27-
5.5. CeedOperator multigrid level tests
7+
0. Ceed Tests
8+
1. CeedVector Tests
9+
1.0. CeedVector general tests
10+
1.1. CeedVector error tests
11+
2. CeedElemRestriction Tests
12+
3. CeedBasis Tests
13+
3.0. CeedBasis utility tests
14+
3.1. CeedBasis tensor basis tests
15+
3.2. CeedBasis simplex basis tests
16+
3.3. CeedBasis non-tensor H(div) basis tests
17+
3.4. CeedBasis non-tensor H(curl) basis tests
18+
4. CeedQFunction Tests
19+
4.0. CeedQFunction user code tests
20+
4.1. CeedQFunction gallery code tests
21+
5. CeedOperator Tests
22+
5.0. CeedOperator with tensor bases tests
23+
5.1. CeedOperator with simplex bases tests
24+
5.2. CeedOperator with operator composition tests
25+
5.3. CeedOperator diagonal and CeedQFunction assembly tests
26+
5.4. CeedOperator element inverse tests
27+
5.5. CeedOperator multigrid level tests
2828
5.6. CeedOperator full assembly tests

tests/t560-operator.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// @file
2-
/// Test full assembly of mass matrix operator (see t533)
2+
/// Test full assembly of mass matrix operator
33
/// \test Test full assembly of mass matrix operator
44
#include <ceed.h>
55
#include <math.h>

tests/t561-operator.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// @file
2-
/// Test full assembly of Poisson operatorr (see t534)
2+
/// Test full assembly of Poisson operator
33
/// \test Test full assembly of Poisson operator
44
#include <ceed.h>
55
#include <math.h>

tests/t564-operator.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// @file
2-
/// Test assembly of mass matrix operator (multi-component) (see t537)
2+
/// Test assembly of mass matrix operator (multi-component) see t537
33
/// \test Test assembly of mass matrix operator (multi-component)
44
#include <ceed.h>
55
#include <math.h>

tests/t566-operator.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// @file
2-
/// Test assembly of non-symmetric mass matrix operator (multi-component) (see t537)
2+
/// Test assembly of non-symmetric mass matrix operator (multi-component) see t537
33
/// \test Test assembly of non-symmetric mass matrix operator (multi-component)
44
#include "t566-operator.h"
55

0 commit comments

Comments
 (0)