Skip to content

Commit e4820e4

Browse files
authored
Merge pull request #1032 from CEED/jeremy/empty-composite
Allow empty composite operators
2 parents 43e9189 + 4362246 commit e4820e4

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

interface/ceed-operator.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,18 +1006,20 @@ int CeedOperatorCheckReady(CeedOperator op) {
10061006

10071007
CeedQFunction qf = op->qf;
10081008
if (op->is_composite) {
1009-
if (!op->num_suboperators)
1010-
// LCOV_EXCL_START
1011-
return CeedError(ceed, CEED_ERROR_INCOMPLETE, "No sub_operators set");
1012-
// LCOV_EXCL_STOP
1013-
for (CeedInt i = 0; i < op->num_suboperators; i++) {
1014-
ierr = CeedOperatorCheckReady(op->sub_operators[i]); CeedChk(ierr);
1009+
if (!op->num_suboperators) {
1010+
// Empty operator setup
1011+
op->input_size = 0;
1012+
op->output_size = 0;
1013+
} else {
1014+
for (CeedInt i = 0; i < op->num_suboperators; i++) {
1015+
ierr = CeedOperatorCheckReady(op->sub_operators[i]); CeedChk(ierr);
1016+
}
1017+
// Sub-operators could be modified after adding to composite operator
1018+
// Need to verify no lvec incompatibility from any changes
1019+
CeedSize input_size, output_size;
1020+
ierr = CeedOperatorGetActiveVectorLengths(op, &input_size, &output_size);
1021+
CeedChk(ierr);
10151022
}
1016-
// Sub-operators could be modified after adding to composite operator
1017-
// Need to verify no lvec incompatibility from any changes
1018-
CeedSize input_size, output_size;
1019-
ierr = CeedOperatorGetActiveVectorLengths(op, &input_size, &output_size);
1020-
CeedChk(ierr);
10211023
} else {
10221024
if (op->num_fields == 0)
10231025
// LCOV_EXCL_START

0 commit comments

Comments
 (0)