@@ -297,8 +297,8 @@ static int CeedOperatorContextSetGeneric(CeedOperator op, CeedContextFieldLabel
297
297
CeedInt num_sub ;
298
298
CeedOperator * sub_operators ;
299
299
300
- CeedCall (CeedOperatorGetNumSub (op , & num_sub ));
301
- CeedCall (CeedOperatorGetSubList (op , & sub_operators ));
300
+ CeedCall (CeedCompositeOperatorGetNumSub (op , & num_sub ));
301
+ CeedCall (CeedCompositeOperatorGetSubList (op , & sub_operators ));
302
302
if (num_sub != field_label -> num_sub_labels ) {
303
303
// LCOV_EXCL_START
304
304
return CeedError (op -> ceed , CEED_ERROR_UNSUPPORTED ,
@@ -407,48 +407,6 @@ int CeedOperatorIsComposite(CeedOperator op, bool *is_composite) {
407
407
return CEED_ERROR_SUCCESS ;
408
408
}
409
409
410
- /**
411
- @brief Get the number of sub_operators associated with a CeedOperator
412
-
413
- @param[in] op CeedOperator
414
- @param[out] num_suboperators Variable to store number of sub_operators
415
-
416
- @return An error code: 0 - success, otherwise - failure
417
-
418
- @ref Backend
419
- **/
420
-
421
- int CeedOperatorGetNumSub (CeedOperator op , CeedInt * num_suboperators ) {
422
- if (!op -> is_composite ) {
423
- // LCOV_EXCL_START
424
- return CeedError (op -> ceed , CEED_ERROR_MINOR , "Not a composite operator" );
425
- // LCOV_EXCL_STOP
426
- }
427
- * num_suboperators = op -> num_suboperators ;
428
- return CEED_ERROR_SUCCESS ;
429
- }
430
-
431
- /**
432
- @brief Get the list of sub_operators associated with a CeedOperator
433
-
434
- @param[in] op CeedOperator
435
- @param[out] sub_operators Variable to store list of sub_operators
436
-
437
- @return An error code: 0 - success, otherwise - failure
438
-
439
- @ref Backend
440
- **/
441
-
442
- int CeedOperatorGetSubList (CeedOperator op , CeedOperator * * sub_operators ) {
443
- if (!op -> is_composite ) {
444
- // LCOV_EXCL_START
445
- return CeedError (op -> ceed , CEED_ERROR_MINOR , "Not a composite operator" );
446
- // LCOV_EXCL_STOP
447
- }
448
- * sub_operators = op -> sub_operators ;
449
- return CEED_ERROR_SUCCESS ;
450
- }
451
-
452
410
/**
453
411
@brief Get the backend data of a CeedOperator
454
412
@@ -909,6 +867,48 @@ int CeedCompositeOperatorAddSub(CeedOperator composite_op, CeedOperator sub_op)
909
867
return CEED_ERROR_SUCCESS ;
910
868
}
911
869
870
+ /**
871
+ @brief Get the number of sub_operators associated with a CeedOperator
872
+
873
+ @param[in] op CeedOperator
874
+ @param[out] num_suboperators Variable to store number of sub_operators
875
+
876
+ @return An error code: 0 - success, otherwise - failure
877
+
878
+ @ref Backend
879
+ **/
880
+
881
+ int CeedCompositeOperatorGetNumSub (CeedOperator op , CeedInt * num_suboperators ) {
882
+ if (!op -> is_composite ) {
883
+ // LCOV_EXCL_START
884
+ return CeedError (op -> ceed , CEED_ERROR_MINOR , "Not a composite operator" );
885
+ // LCOV_EXCL_STOP
886
+ }
887
+ * num_suboperators = op -> num_suboperators ;
888
+ return CEED_ERROR_SUCCESS ;
889
+ }
890
+
891
+ /**
892
+ @brief Get the list of sub_operators associated with a CeedOperator
893
+
894
+ @param op CeedOperator
895
+ @param[out] sub_operators Variable to store list of sub_operators
896
+
897
+ @return An error code: 0 - success, otherwise - failure
898
+
899
+ @ref Backend
900
+ **/
901
+
902
+ int CeedCompositeOperatorGetSubList (CeedOperator op , CeedOperator * * sub_operators ) {
903
+ if (!op -> is_composite ) {
904
+ // LCOV_EXCL_START
905
+ return CeedError (op -> ceed , CEED_ERROR_MINOR , "Not a composite operator" );
906
+ // LCOV_EXCL_STOP
907
+ }
908
+ * sub_operators = op -> sub_operators ;
909
+ return CEED_ERROR_SUCCESS ;
910
+ }
911
+
912
912
/**
913
913
@brief Check if a CeedOperator is ready to be used.
914
914
@@ -1218,9 +1218,9 @@ int CeedOperatorGetFlopsEstimate(CeedOperator op, CeedSize *flops) {
1218
1218
CeedCall (CeedOperatorIsComposite (op , & is_composite ));
1219
1219
if (is_composite ) {
1220
1220
CeedInt num_suboperators ;
1221
- CeedCall (CeedOperatorGetNumSub (op , & num_suboperators ));
1221
+ CeedCall (CeedCompositeOperatorGetNumSub (op , & num_suboperators ));
1222
1222
CeedOperator * sub_operators ;
1223
- CeedCall (CeedOperatorGetSubList (op , & sub_operators ));
1223
+ CeedCall (CeedCompositeOperatorGetSubList (op , & sub_operators ));
1224
1224
1225
1225
// FLOPs for each suboperator
1226
1226
for (CeedInt i = 0 ; i < num_suboperators ; i ++ ) {
@@ -1299,8 +1299,8 @@ int CeedOperatorContextGetFieldLabel(CeedOperator op, const char *field_name, Ce
1299
1299
CeedContextFieldLabel new_field_label ;
1300
1300
1301
1301
CeedCall (CeedCalloc (1 , & new_field_label ));
1302
- CeedCall (CeedOperatorGetNumSub (op , & num_sub ));
1303
- CeedCall (CeedOperatorGetSubList (op , & sub_operators ));
1302
+ CeedCall (CeedCompositeOperatorGetNumSub (op , & num_sub ));
1303
+ CeedCall (CeedCompositeOperatorGetSubList (op , & sub_operators ));
1304
1304
CeedCall (CeedCalloc (num_sub , & new_field_label -> sub_labels ));
1305
1305
new_field_label -> num_sub_labels = num_sub ;
1306
1306
@@ -1437,9 +1437,9 @@ int CeedOperatorApply(CeedOperator op, CeedVector in, CeedVector out, CeedReques
1437
1437
CeedCall (op -> ApplyComposite (op , in , out , request ));
1438
1438
} else {
1439
1439
CeedInt num_suboperators ;
1440
- CeedCall (CeedOperatorGetNumSub (op , & num_suboperators ));
1440
+ CeedCall (CeedCompositeOperatorGetNumSub (op , & num_suboperators ));
1441
1441
CeedOperator * sub_operators ;
1442
- CeedCall (CeedOperatorGetSubList (op , & sub_operators ));
1442
+ CeedCall (CeedCompositeOperatorGetSubList (op , & sub_operators ));
1443
1443
1444
1444
// Zero all output vectors
1445
1445
if (out != CEED_VECTOR_NONE ) {
@@ -1489,9 +1489,9 @@ int CeedOperatorApplyAdd(CeedOperator op, CeedVector in, CeedVector out, CeedReq
1489
1489
CeedCall (op -> ApplyAddComposite (op , in , out , request ));
1490
1490
} else {
1491
1491
CeedInt num_suboperators ;
1492
- CeedCall (CeedOperatorGetNumSub (op , & num_suboperators ));
1492
+ CeedCall (CeedCompositeOperatorGetNumSub (op , & num_suboperators ));
1493
1493
CeedOperator * sub_operators ;
1494
- CeedCall (CeedOperatorGetSubList (op , & sub_operators ));
1494
+ CeedCall (CeedCompositeOperatorGetSubList (op , & sub_operators ));
1495
1495
1496
1496
for (CeedInt i = 0 ; i < num_suboperators ; i ++ ) {
1497
1497
CeedCall (CeedOperatorApplyAdd (sub_operators [i ], in , out , request ));
0 commit comments