Skip to content

Commit 8cd5e73

Browse files
committed
minor - fix view for AtPoints operators
1 parent 38bf749 commit 8cd5e73

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

interface/ceed-operator.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,14 @@ static int CeedOperatorFieldView(CeedOperatorField op_field, CeedQFunctionField
136136
@ref Utility
137137
**/
138138
int CeedOperatorSingleView(CeedOperator op, bool sub, FILE *stream) {
139+
bool is_at_points;
139140
const char *pre = sub ? " " : "";
140141
CeedInt num_elem, num_qpts, total_fields = 0, num_input_fields, num_output_fields;
141142
CeedQFunction qf;
142143
CeedQFunctionField *qf_input_fields, *qf_output_fields;
143144
CeedOperatorField *op_input_fields, *op_output_fields;
144145

146+
CeedCall(CeedOperatorIsAtPoints(op, &is_at_points));
145147
CeedCall(CeedOperatorGetNumElements(op, &num_elem));
146148
CeedCall(CeedOperatorGetNumQuadraturePoints(op, &num_qpts));
147149
CeedCall(CeedOperatorGetNumArgs(op, &total_fields));
@@ -150,7 +152,17 @@ int CeedOperatorSingleView(CeedOperator op, bool sub, FILE *stream) {
150152
CeedCall(CeedQFunctionGetFields(qf, NULL, &qf_input_fields, NULL, &qf_output_fields));
151153
CeedCall(CeedQFunctionDestroy(&qf));
152154

153-
fprintf(stream, "%s %" CeedInt_FMT " elements with %" CeedInt_FMT " quadrature points each\n", pre, num_elem, num_qpts);
155+
if (is_at_points) {
156+
CeedInt max_points = 0;
157+
CeedElemRestriction rstr_points;
158+
159+
CeedCall(CeedOperatorAtPointsGetPoints(op, &rstr_points, NULL));
160+
CeedCall(CeedElemRestrictionGetMaxPointsInElement(rstr_points, &max_points));
161+
fprintf(stream, "%s %" CeedInt_FMT " elements with %" CeedInt_FMT " max points each\n", pre, num_elem, max_points);
162+
CeedCall(CeedElemRestrictionDestroy(&rstr_points));
163+
} else {
164+
fprintf(stream, "%s %" CeedInt_FMT " elements with %" CeedInt_FMT " quadrature points each\n", pre, num_elem, num_qpts);
165+
}
154166
fprintf(stream, "%s %" CeedInt_FMT " field%s\n", pre, total_fields, total_fields > 1 ? "s" : "");
155167
fprintf(stream, "%s %" CeedInt_FMT " input field%s:\n", pre, num_input_fields, num_input_fields > 1 ? "s" : "");
156168
for (CeedInt i = 0; i < num_input_fields; i++) {
@@ -1551,9 +1563,10 @@ int CeedOperatorSetName(CeedOperator op, const char *name) {
15511563
@return Error code: 0 - success, otherwise - failure
15521564
**/
15531565
static int CeedOperatorView_Core(CeedOperator op, FILE *stream, bool is_full) {
1554-
bool has_name = op->name, is_composite;
1566+
bool has_name = op->name, is_composite, is_at_points;
15551567

15561568
CeedCall(CeedOperatorIsComposite(op, &is_composite));
1569+
CeedCall(CeedOperatorIsAtPoints(op, &is_at_points));
15571570
if (is_composite) {
15581571
CeedInt num_suboperators;
15591572
CeedOperator *sub_operators;
@@ -1564,11 +1577,12 @@ static int CeedOperatorView_Core(CeedOperator op, FILE *stream, bool is_full) {
15641577

15651578
for (CeedInt i = 0; i < num_suboperators; i++) {
15661579
has_name = sub_operators[i]->name;
1567-
fprintf(stream, " SubOperator %" CeedInt_FMT "%s%s%s\n", i, has_name ? " - " : "", has_name ? sub_operators[i]->name : "", is_full ? ":" : "");
1580+
fprintf(stream, " SubOperator%s %" CeedInt_FMT "%s%s%s\n", is_at_points ? " AtPoints" : "", i, has_name ? " - " : "",
1581+
has_name ? sub_operators[i]->name : "", is_full ? ":" : "");
15681582
if (is_full) CeedCall(CeedOperatorSingleView(sub_operators[i], 1, stream));
15691583
}
15701584
} else {
1571-
fprintf(stream, "CeedOperator%s%s\n", has_name ? " - " : "", has_name ? op->name : "");
1585+
fprintf(stream, "CeedOperator%s%s%s\n", is_at_points ? " AtPoints" : "", has_name ? " - " : "", has_name ? op->name : "");
15721586
if (is_full) CeedCall(CeedOperatorSingleView(op, 0, stream));
15731587
}
15741588
return CEED_ERROR_SUCCESS;

0 commit comments

Comments
 (0)