diff --git a/interface/ceed-basis.c b/interface/ceed-basis.c index d110988371..1f393c3164 100644 --- a/interface/ceed-basis.c +++ b/interface/ceed-basis.c @@ -203,7 +203,10 @@ static int CeedBasisCreateProjectionMatrices(CeedBasis basis_from, CeedBasis bas // Check for compatible quadrature spaces CeedCall(CeedBasisGetNumQuadraturePoints(basis_to, &Q_to)); CeedCall(CeedBasisGetNumQuadraturePoints(basis_from, &Q_from)); - CeedCheck(Q_to == Q_from, ceed, CEED_ERROR_DIMENSION, "Bases must have compatible quadrature spaces"); + CeedCheck(Q_to == Q_from, ceed, CEED_ERROR_DIMENSION, + "Bases must have compatible quadrature spaces." + " 'basis_from has %" CeedInt_FMT " points and 'basis_to' has %" CeedInt_FMT, + Q_from, Q_to); Q = Q_to; // Check for matching tensor or non-tensor @@ -225,9 +228,13 @@ static int CeedBasisCreateProjectionMatrices(CeedBasis basis_from, CeedBasis bas // Check for matching FE space CeedFESpace fe_space_to, fe_space_from; + CeedCall(CeedBasisGetFESpace(basis_to, &fe_space_to)); CeedCall(CeedBasisGetFESpace(basis_from, &fe_space_from)); - CeedCheck(fe_space_to == fe_space_from, ceed, CEED_ERROR_MINOR, "Bases must both be the same FE space type"); + CeedCheck(fe_space_to == fe_space_from, ceed, CEED_ERROR_MINOR, + "Bases must both be the same FE space type." + " 'basis_from' is a %s and 'basis_to' is a %s", + CeedFESpaces[fe_space_from], CeedFESpaces[fe_space_to]); // Get source matrices CeedInt dim, q_comp = 1; diff --git a/interface/ceed-elemrestriction.c b/interface/ceed-elemrestriction.c index 2e78628087..9fa36d45d2 100644 --- a/interface/ceed-elemrestriction.c +++ b/interface/ceed-elemrestriction.c @@ -486,7 +486,10 @@ int CeedElemRestrictionSetAtPointsEVectorSize(CeedElemRestriction rstr, CeedSize CeedCall(CeedElemRestrictionGetCeed(rstr, &ceed)); CeedCall(CeedElemRestrictionGetType(rstr, &rstr_type)); CeedCheck(rstr_type == CEED_RESTRICTION_POINTS, ceed, CEED_ERROR_INCOMPATIBLE, "Can only compute offset for a points CeedElemRestriction"); - CeedCheck(e_size >= rstr->e_size, ceed, CEED_ERROR_INCOMPATIBLE, "Can only increase the size of the E-vector for the CeedElemRestriction"); + CeedCheck(e_size >= rstr->e_size, ceed, CEED_ERROR_INCOMPATIBLE, + "Can only increase the size of the E-vector for the CeedElemRestriction." + " Current size: %" CeedSize_FMT " New size: %" CeedSize_FMT, + rstr->e_size, e_size); rstr->e_size = e_size; return CEED_ERROR_SUCCESS; } diff --git a/interface/ceed-preconditioning.c b/interface/ceed-preconditioning.c index 8eb59409d5..8d50f2dba0 100644 --- a/interface/ceed-preconditioning.c +++ b/interface/ceed-preconditioning.c @@ -472,7 +472,9 @@ static int CeedSingleOperatorAssembleSymbolic(CeedOperator op, CeedInt offset, C if (elem_rstr_in != elem_rstr_out) { CeedCall(CeedElemRestrictionGetNumElements(elem_rstr_out, &num_elem_out)); CeedCheck(num_elem_in == num_elem_out, ceed, CEED_ERROR_UNSUPPORTED, - "Active input and output operator restrictions must have the same number of elements"); + "Active input and output operator restrictions must have the same number of elements." + " Input has %" CeedInt_FMT " elements; output has %" CeedInt_FMT "elements.", + num_elem_in, num_elem_out); CeedCall(CeedElemRestrictionGetElementSize(elem_rstr_out, &elem_size_out)); CeedCall(CeedElemRestrictionGetNumComponents(elem_rstr_out, &num_comp_out)); CeedCall(CeedElemRestrictionGetELayout(elem_rstr_out, layout_er_out)); @@ -602,7 +604,7 @@ static int CeedSingleOperatorAssemble(CeedOperator op, CeedInt offset, CeedVecto CeedCall(CeedOperatorAssemblyDataGetEvalModes(data, &num_active_bases_in, &num_eval_modes_in, &eval_modes_in, NULL, &num_active_bases_out, &num_eval_modes_out, &eval_modes_out, NULL, NULL)); - CeedCheck(num_active_bases_in == num_active_bases_out && num_active_bases_in == 1, ceed, CEED_ERROR_UNSUPPORTED, + CeedCheck(num_active_bases_in == 1 && num_active_bases_out == 1, ceed, CEED_ERROR_UNSUPPORTED, "Cannot assemble operator with multiple active bases"); CeedCheck(num_eval_modes_in[0] > 0 && num_eval_modes_out[0] > 0, ceed, CEED_ERROR_UNSUPPORTED, "Cannot assemble operator without inputs/outputs"); @@ -629,13 +631,17 @@ static int CeedSingleOperatorAssemble(CeedOperator op, CeedInt offset, CeedVecto if (elem_rstr_in != elem_rstr_out) { CeedCall(CeedElemRestrictionGetNumElements(elem_rstr_out, &num_elem_out)); CeedCheck(num_elem_in == num_elem_out, ceed, CEED_ERROR_UNSUPPORTED, - "Active input and output operator restrictions must have the same number of elements"); + "Active input and output operator restrictions must have the same number of elements." + " Input has %" CeedInt_FMT " elements; output has %" CeedInt_FMT "elements.", + num_elem_in, num_elem_out); CeedCall(CeedElemRestrictionGetElementSize(elem_rstr_out, &elem_size_out)); CeedCall(CeedElemRestrictionGetNumComponents(elem_rstr_out, &num_comp_out)); if (basis_out == CEED_BASIS_NONE) num_qpts_out = elem_size_out; else CeedCall(CeedBasisGetNumQuadraturePoints(basis_out, &num_qpts_out)); CeedCheck(num_qpts_in == num_qpts_out, ceed, CEED_ERROR_UNSUPPORTED, - "Active input and output bases must have the same number of quadrature points"); + "Active input and output bases must have the same number of quadrature points." + " Input has %" CeedInt_FMT " points; output has %" CeedInt_FMT "points.", + num_qpts_in, num_qpts_out); CeedCall(CeedElemRestrictionGetType(elem_rstr_out, &elem_rstr_type_out)); if (elem_rstr_type_out == CEED_RESTRICTION_ORIENTED) { @@ -802,7 +808,9 @@ static int CeedSingleOperatorAssemblyCountEntries(CeedOperator op, CeedSize *num if (rstr_in != rstr_out) { CeedCall(CeedElemRestrictionGetNumElements(rstr_out, &num_elem_out)); CeedCheck(num_elem_in == num_elem_out, ceed, CEED_ERROR_UNSUPPORTED, - "Active input and output operator restrictions must have the same number of elements"); + "Active input and output operator restrictions must have the same number of elements." + " Input has %" CeedInt_FMT " elements; output has %" CeedInt_FMT "elements.", + num_elem_in, num_elem_out); CeedCall(CeedElemRestrictionGetElementSize(rstr_out, &elem_size_out)); CeedCall(CeedElemRestrictionGetNumComponents(rstr_out, &num_comp_out)); } else { @@ -2123,7 +2131,9 @@ int CeedOperatorLinearAssemblePointBlockDiagonalSymbolic(CeedOperator op, CeedSi "Active element restrictions must have the same component stride: %d vs %d", comp_stride, comp_stride_sub); CeedCall(CeedElemRestrictionGetNumComponents(active_elem_rstrs[i], &num_active_components_sub)); CeedCheck(num_active_components == num_active_components_sub, ceed, CEED_ERROR_INCOMPATIBLE, - "All suboperators must have the same number of output components"); + "All suboperators must have the same number of output components." + " Previous: %" CeedInt_FMT " Current: %" CeedInt_FMT, + num_active_components, num_active_components_sub); } } } @@ -2571,7 +2581,10 @@ int CeedOperatorMultigridLevelCreateTensorH1(CeedOperator op_fine, CeedVector p_ CeedCall(CeedOperatorGetActiveBasis(op_fine, &basis_fine)); CeedCall(CeedBasisGetNumQuadraturePoints(basis_fine, &Q_f)); CeedCall(CeedBasisGetNumQuadraturePoints(basis_coarse, &Q_c)); - CeedCheck(Q_f == Q_c, ceed, CEED_ERROR_DIMENSION, "Bases must have compatible quadrature spaces"); + CeedCheck(Q_f == Q_c, ceed, CEED_ERROR_DIMENSION, + "Bases must have compatible quadrature spaces." + " Fine grid: %" CeedInt_FMT " points, Coarse grid: %" CeedInt_FMT " points", + Q_f, Q_c); // Create coarse to fine basis, if required if (op_prolong || op_restrict) { diff --git a/interface/ceed-qfunction.c b/interface/ceed-qfunction.c index ad90099412..12c494710d 100644 --- a/interface/ceed-qfunction.c +++ b/interface/ceed-qfunction.c @@ -775,10 +775,14 @@ int CeedQFunctionAddInput(CeedQFunction qf, const char *field_name, CeedInt size CeedCheck(!is_immutable, ceed, CEED_ERROR_MAJOR, "QFunction cannot be changed after set as immutable"); CeedCheck(eval_mode != CEED_EVAL_WEIGHT || size == 1, ceed, CEED_ERROR_DIMENSION, "CEED_EVAL_WEIGHT should have size 1"); for (CeedInt i = 0; i < qf->num_input_fields; i++) { - CeedCheck(strcmp(field_name, qf->input_fields[i]->field_name), ceed, CEED_ERROR_MINOR, "CeedQFunction field names must be unique"); + CeedCheck(strcmp(field_name, qf->input_fields[i]->field_name), ceed, CEED_ERROR_MINOR, + "CeedQFunction field names must be unique. Duplicate name: %s", + field_name); } for (CeedInt i = 0; i < qf->num_output_fields; i++) { - CeedCheck(strcmp(field_name, qf->output_fields[i]->field_name), ceed, CEED_ERROR_MINOR, "CeedQFunction field names must be unique"); + CeedCheck(strcmp(field_name, qf->output_fields[i]->field_name), ceed, CEED_ERROR_MINOR, + "CeedQFunction field names must be unique. Duplicate name: %s", + field_name); } CeedCall(CeedQFunctionFieldSet(&qf->input_fields[qf->num_input_fields], field_name, size, eval_mode)); qf->num_input_fields++; diff --git a/interface/ceed-vector.c b/interface/ceed-vector.c index e2da964009..7c10ca98bc 100644 --- a/interface/ceed-vector.c +++ b/interface/ceed-vector.c @@ -735,7 +735,10 @@ int CeedVectorAXPY(CeedVector y, CeedScalar alpha, CeedVector x) { CeedCall(CeedVectorGetCeed(y, &ceed)); CeedCall(CeedVectorGetLength(y, &length_y)); CeedCall(CeedVectorGetLength(x, &length_x)); - CeedCheck(length_x == length_y, ceed, CEED_ERROR_UNSUPPORTED, "Cannot add vector of different lengths"); + CeedCheck(length_x == length_y, ceed, CEED_ERROR_UNSUPPORTED, + "Cannot add vector of different lengths." + " x length: %" CeedSize_FMT " y length: %" CeedSize_FMT, + length_x, length_y); CeedCheck(x != y, ceed, CEED_ERROR_UNSUPPORTED, "Cannot use same vector for x and y in CeedVectorAXPY"); CeedCall(CeedVectorHasValidArray(x, &has_valid_array_x)); @@ -795,7 +798,10 @@ int CeedVectorAXPBY(CeedVector y, CeedScalar alpha, CeedScalar beta, CeedVector CeedCall(CeedVectorGetLength(y, &length_y)); CeedCall(CeedVectorGetLength(x, &length_x)); - CeedCheck(length_x == length_y, ceed, CEED_ERROR_UNSUPPORTED, "Cannot add vector of different lengths"); + CeedCheck(length_x == length_y, ceed, CEED_ERROR_UNSUPPORTED, + "Cannot add vector of different lengths." + " x length: %" CeedSize_FMT " y length: %" CeedSize_FMT, + length_x, length_y); CeedCheck(x != y, ceed, CEED_ERROR_UNSUPPORTED, "Cannot use same vector for x and y in CeedVectorAXPBY"); CeedCall(CeedVectorHasValidArray(x, &has_valid_array_x)); @@ -856,7 +862,10 @@ int CeedVectorPointwiseMult(CeedVector w, CeedVector x, CeedVector y) { CeedCall(CeedVectorGetLength(w, &length_w)); CeedCall(CeedVectorGetLength(x, &length_x)); CeedCall(CeedVectorGetLength(y, &length_y)); - CeedCheck(length_w == length_x && length_w == length_y, ceed, CEED_ERROR_UNSUPPORTED, "Cannot multiply vectors of different lengths"); + CeedCheck(length_w == length_x && length_w == length_y, ceed, CEED_ERROR_UNSUPPORTED, + "Cannot multiply vectors of different lengths." + " x length: %" CeedSize_FMT " y length: %" CeedSize_FMT, + length_x, length_y); CeedCall(CeedGetParent(w->ceed, &ceed_parent_w)); CeedCall(CeedGetParent(x->ceed, &ceed_parent_x));