Skip to content

Commit 2ccc907

Browse files
committed
SWE: style
1 parent d3f95a7 commit 2ccc907

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

examples/fluids/shallow-water/shallowwater.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
/// @file
3939
/// Shallow-water equations example using PETSc
4040

41-
const char help[] = "Solve the shallow-water equations using PETSc and libCEED\n";
41+
const char help[] =
42+
"Solve the shallow-water equations using PETSc and libCEED\n";
4243

4344
#include "sw_headers.h"
4445

@@ -78,7 +79,8 @@ int main(int argc, char **argv) {
7879
PetscScalar R_e = 6.37122e6; // Earth radius (m)
7980
PetscScalar g = 9.81; // gravitational acceleration (m/s^2)
8081
PetscScalar H0 = 0; // constant mean height (m)
81-
PetscScalar gamma = 0; // angle between axis of rotation and polar axis
82+
PetscScalar gamma =
83+
0; // angle between axis of rotation and polar axis
8284
PetscScalar mpersquareds;
8385
// Check PETSc CUDA support
8486
PetscBool petschavecuda, setmemtyperequest = PETSC_FALSE;
@@ -102,7 +104,8 @@ int main(int argc, char **argv) {
102104

103105
// Parse command line options
104106
comm = PETSC_COMM_WORLD;
105-
ierr = PetscOptionsBegin(comm, NULL, "Shallow-water equations in PETSc with libCEED",
107+
ierr = PetscOptionsBegin(comm, NULL,
108+
"Shallow-water equations in PETSc with libCEED",
106109
NULL); CHKERRQ(ierr);
107110
ierr = PetscOptionsString("-ceed", "CEED resource specifier",
108111
NULL, ceedresource, ceedresource,
@@ -152,7 +155,8 @@ int main(int argc, char **argv) {
152155
NULL, second, &second, NULL); CHKERRQ(ierr);
153156
second = fabs(second);
154157
outputfreq = 10;
155-
ierr = PetscOptionsInt("-output_freq", "Frequency of output, in number of steps",
158+
ierr = PetscOptionsInt("-output_freq",
159+
"Frequency of output, in number of steps",
156160
NULL, outputfreq, &outputfreq, NULL); CHKERRQ(ierr);
157161
contsteps = 0;
158162
ierr = PetscOptionsInt("-continue", "Continue from previous solution",
@@ -167,7 +171,8 @@ int main(int argc, char **argv) {
167171
NULL, g, &g, NULL); CHKERRQ(ierr);
168172
ierr = PetscOptionsScalar("-H0", "Mean height",
169173
NULL, H0, &H0, NULL); CHKERRQ(ierr);
170-
ierr = PetscOptionsScalar("-H0", "Angle between axis of rotation and polar axis",
174+
ierr = PetscOptionsScalar("-H0",
175+
"Angle between axis of rotation and polar axis",
171176
NULL, gamma, &gamma, NULL); CHKERRQ(ierr);
172177
PetscStrncpy(user->outputfolder, ".", 2);
173178
ierr = PetscOptionsString("-of", "Output folder",
@@ -563,7 +568,7 @@ int main(int argc, char **argv) {
563568
ierr = DMDestroy(&dmviz); CHKERRQ(ierr);
564569
ierr = TSDestroy(&ts); CHKERRQ(ierr);
565570
ierr = DMDestroy(&dm); CHKERRQ(ierr);
566-
ierr = MatDestroy(&J);CHKERRQ(ierr);
571+
ierr = MatDestroy(&J); CHKERRQ(ierr);
567572
ierr = PetscFree(units); CHKERRQ(ierr);
568573
ierr = PetscFree(user); CHKERRQ(ierr);
569574
return PetscFinalize();

examples/fluids/shallow-water/sw_headers.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ typedef struct {
5656
CeedQFunctionUser setup, ics, apply_explfunction, apply_implfunction,
5757
apply_jacobian;
5858
const char *setup_loc, *ics_loc, *apply_explfunction_loc,
59-
*apply_implfunction_loc, *apply_jacobian_loc;
59+
*apply_implfunction_loc, *apply_jacobian_loc;
6060
const bool non_zero_time;
6161
} problemData;
6262

@@ -235,12 +235,12 @@ PetscErrorCode VectorPlacePetscVec(CeedVector c, Vec p);
235235
// Auxiliary function to apply the ICs and eliminate repeated values in initial
236236
// state vector, arising from restriction
237237
PetscErrorCode ICs_FixMultiplicity(CeedOperator op_ics,
238-
CeedVector xcorners, CeedVector q0ceed, DM dm, Vec Qloc, Vec Q,
239-
CeedElemRestriction restrictq, PhysicsContext ctx, CeedScalar time);
238+
CeedVector xcorners, CeedVector q0ceed, DM dm, Vec Qloc, Vec Q,
239+
CeedElemRestriction restrictq, PhysicsContext ctx, CeedScalar time);
240240

241241
// Auxiliary function to compute the lumped mass matrix
242242
PetscErrorCode ComputeLumpedMassMatrix(Ceed ceed, DM dm,
243-
CeedElemRestriction restrictq, CeedBasis basisq,
244-
CeedElemRestriction restrictqdi, CeedVector qdata, Vec M);
243+
CeedElemRestriction restrictq, CeedBasis basisq,
244+
CeedElemRestriction restrictqdi, CeedVector qdata, Vec M);
245245

246246
#endif // sw_headers_h

0 commit comments

Comments
 (0)