Skip to content

Commit a8edb68

Browse files
authored
Merge pull request #1796 from CEED/jrwrigh/update_petscoptions
fix(bc): Correct PetscOptionsItems pointer status
2 parents fc9cad3 + 5d4f3a2 commit a8edb68

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

examples/fluids/include/bc_definition.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct _p_BCDefinition {
3434
**/
3535
#define PetscOptionsBCDefinition(opt, text, man, name, bc_def, set) \
3636
PetscOptionsBCDefinition_Private(PetscOptionsObject, opt, text, man, name, bc_def, set)
37-
PetscErrorCode PetscOptionsBCDefinition_Private(PetscOptionItems *PetscOptionsObject, const char opt[], const char text[], const char man[],
37+
PetscErrorCode PetscOptionsBCDefinition_Private(PetscOptionItems PetscOptionsObject, const char opt[], const char text[], const char man[],
3838
const char name[], BCDefinition *bc_def, PetscBool *set);
3939

4040
PetscErrorCode BCDefinitionCreate(const char *name, PetscInt num_label_values, PetscInt label_values[], BCDefinition *bc_def);

examples/fluids/qfunctions/stg_shur14.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@ CEED_QFUNCTION(ICsStg)(void *ctx, CeedInt Q, const CeedScalar *const *in, CeedSc
310310
for (CeedInt j = 0; j < 3; j++) u[j] = ubar[j];
311311
}
312312

313-
CeedScalar Y[5] = {P0, u[0], u[1], u[2], theta0}, q[5];
314-
State s = StateFromY(gas, Y);
313+
CeedScalar Y[5] = {P0, u[0], u[1], u[2], theta0}, q[5] = {0.};
314+
State s = StateFromY(gas, Y);
315315
StateToQ(gas, s, q, gas->state_var);
316316
for (CeedInt j = 0; j < 5; j++) {
317317
q0[j][i] = q[j];
@@ -508,8 +508,8 @@ CEED_QFUNCTION(StgShur14InflowStrongQF)(void *ctx, CeedInt Q, const CeedScalar *
508508
for (CeedInt j = 0; j < 3; j++) u[j] = ubar[j];
509509
}
510510

511-
CeedScalar Y[5] = {P0, u[0], u[1], u[2], theta0}, q[5];
512-
State s = StateFromY(gas, Y);
511+
CeedScalar Y[5] = {P0, u[0], u[1], u[2], theta0}, q[5] = {0.};
512+
State s = StateFromY(gas, Y);
513513
StateToQ(gas, s, q, gas->state_var);
514514
switch (gas->state_var) {
515515
case STATEVAR_CONSERVATIVE:

examples/fluids/src/bc_definition.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ PetscErrorCode BCDefinitionGetEssential(BCDefinition bc_def, PetscInt *num_essen
9191
#define LABEL_ARRAY_SIZE 256
9292

9393
// @brief See `PetscOptionsBCDefinition`
94-
PetscErrorCode PetscOptionsBCDefinition_Private(PetscOptionItems *PetscOptionsObject, const char opt[], const char text[], const char man[],
94+
PetscErrorCode PetscOptionsBCDefinition_Private(PetscOptionItems PetscOptionsObject, const char opt[], const char text[], const char man[],
9595
const char name[], BCDefinition *bc_def, PetscBool *set) {
9696
PetscInt num_label_values = LABEL_ARRAY_SIZE, label_values[LABEL_ARRAY_SIZE] = {0};
9797

examples/fluids/src/misc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ PetscErrorCode DMPlexInsertBoundaryValues_FromICs(DM dm, PetscBool insert_essent
9595

9696
static PetscErrorCode BinaryReadIntoInt(PetscViewer viewer, PetscInt *out, PetscDataType file_type) {
9797
PetscFunctionBeginUser;
98+
*out = -13; // appease the overzealous GCC compiler warning Gods
9899
if (file_type == PETSC_INT32) {
99100
PetscInt32 val;
100101
PetscCall(PetscViewerBinaryRead(viewer, &val, 1, NULL, PETSC_INT32));

0 commit comments

Comments
 (0)