Skip to content

Commit a960447

Browse files
committed
Apply clang-format
1 parent a9a5f41 commit a960447

2 files changed

Lines changed: 18 additions & 20 deletions

File tree

src/mesh/boundary_factory.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ using std::string;
2020
BoundaryFactory* BoundaryFactory::instance = nullptr;
2121

2222
BoundaryFactory::BoundaryFactory() {
23-
add(new BoundaryDirichlet(), "dirichlet"); // Default
23+
add(new BoundaryDirichlet(), "dirichlet"); // Default
2424
add(new BoundaryDirichlet_O1(), "dirichlet_o1"); // Old implementation in v3
2525
add(new BoundaryDirichlet(), "dirichlet_o2"); // Synonym for "dirichlet"
2626
add(new BoundaryDirichlet_O3(), "dirichlet_o3");
2727
add(new BoundaryDirichlet_O4(), "dirichlet_o4");
2828
add(new BoundaryDirichlet_4thOrder(), "dirichlet_4thorder");
2929

30-
add(new BoundaryNeumann(), "neumann"); // Default
30+
add(new BoundaryNeumann(), "neumann"); // Default
3131
add(new BoundaryNeumann_O1(), "neumann_o1"); // Old implementation in v3
32-
add(new BoundaryNeumann(), "neumann_o2"); // Synonym for "neumann"
32+
add(new BoundaryNeumann(), "neumann_o2"); // Synonym for "neumann"
3333
add(new BoundaryNeumann_4thOrder(), "neumann_4thorder");
3434
add(new BoundaryNeumann_O4(), "neumann_o4");
3535
add(new BoundaryNeumannPar(), "neumannpar");

src/mesh/boundary_standard.cxx

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,10 @@ void verifyNumPoints(BoundaryRegion* region, int ptsRequired) {
115115
void verifyNumPoints(BoundaryRegion*, int) {}
116116
#endif
117117

118-
119118
///////////////////////////////////////////////////////////////
120119

121120
BoundaryOp* BoundaryDirichlet_O1::clone(BoundaryRegion* region,
122-
const std::list<std::string>& args) {
121+
const std::list<std::string>& args) {
123122
verifyNumPoints(region, 1);
124123

125124
std::shared_ptr<FieldGenerator> newgen;
@@ -168,9 +167,8 @@ void BoundaryDirichlet_O1::apply(Field2D& f, BoutReal t) {
168167
for (int i = 1; i < bndry->width; i++) {
169168
int xi = bndry->x + i * bndry->bx;
170169
int yi = bndry->y + i * bndry->by;
171-
f(xi, yi) = val;
172-
}
173-
170+
f(xi, yi) = val;
171+
}
174172
}
175173
}
176174
}
@@ -1844,7 +1842,7 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
18441842
///////////////////////////////////////////////////////////////
18451843

18461844
BoundaryOp* BoundaryNeumann_O1::clone(BoundaryRegion * region,
1847-
const std::list<std::string>& args) {
1845+
const std::list<std::string>& args) {
18481846
verifyNumPoints(region, 1);
18491847
std::shared_ptr<FieldGenerator> newgen = nullptr;
18501848
if (!args.empty()) {
@@ -1857,8 +1855,7 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
18571855
void BoundaryNeumann_O1::apply(Field2D & f) { BoundaryNeumann_O1::apply(f, 0.); }
18581856

18591857
void BoundaryNeumann_O1::apply(Field2D & f, BoutReal t) {
1860-
// Set (at 1st order) the gradient/value at the grid cell to the guard cells.
1861-
1858+
// Set (at 1st order) the gradient/value at the grid cell to the guard cells.
18621859

18631860
#if not(BOUT_USE_METRIC_3D)
18641861
Mesh* mesh = bndry->localmesh;
@@ -1879,7 +1876,7 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
18791876

18801877
CELL_LOC loc = f.getLocation();
18811878
if (mesh->StaggerGrids) {
1882-
// Staggered.
1879+
// Staggered.
18831880
throw BoutException("neumann_o1 BC is not implementated for staggered grids.");
18841881

18851882
} else {
@@ -1896,13 +1893,14 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
18961893
f(bndry->x, bndry->y) =
18971894
f(bndry->x - bndry->bx, bndry->y - bndry->by) + delta * val;
18981895
if (bndry->width == 2) {
1899-
f(bndry->x + bndry->bx, bndry->y + bndry->by) = f(bndry->x, bndry->y) + delta * val;
1896+
f(bndry->x + bndry->bx, bndry->y + bndry->by) =
1897+
f(bndry->x, bndry->y) + delta * val;
19001898
}
19011899
}
19021900
}
19031901
#else
1904-
throw BoutException("Applying boundary condition 'neumann' to Field2D "
1905-
"not compatible with 3D metrics in all cases.");
1902+
throw BoutException("Applying boundary condition 'neumann' to Field2D "
1903+
"not compatible with 3D metrics in all cases.");
19061904
#endif
19071905
}
19081906

@@ -1927,7 +1925,7 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
19271925

19281926
CELL_LOC loc = f.getLocation();
19291927
if (mesh->StaggerGrids) {
1930-
// Staggered.
1928+
// Staggered.
19311929
throw BoutException("neumann_o1 BC is not implementated for staggered grids.");
19321930

19331931
} else {
@@ -1937,9 +1935,9 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
19371935
BoutReal delta = bndry->bx * metric->dx(bndry->x, bndry->y, zk)
19381936
+ bndry->by * metric->dy(bndry->x, bndry->y, zk);
19391937
#else
1940-
BoutReal delta = bndry->bx * metric->dx(bndry->x, bndry->y)
1941-
+ bndry->by * metric->dy(bndry->x, bndry->y);
1942-
for (int zk = mesh->zstart; zk <= mesh->zend; zk++) {
1938+
BoutReal delta = bndry->bx * metric->dx(bndry->x, bndry->y)
1939+
+ bndry->by * metric->dy(bndry->x, bndry->y);
1940+
for (int zk = mesh->zstart; zk <= mesh->zend; zk++) {
19431941
#endif
19441942
if (fg) {
19451943
val = fg->generate(Context(bndry, zk, loc, t, mesh));
@@ -1948,7 +1946,7 @@ void BoundaryNeumann_NonOrthogonal::apply(Field3D& f) {
19481946
f(bndry->x - bndry->bx, bndry->y - bndry->by, zk) + delta * val;
19491947
if (bndry->width == 2) {
19501948
f(bndry->x + bndry->bx, bndry->y + bndry->by, zk) =
1951-
f(bndry->x, bndry->y, zk) + delta * val;
1949+
f(bndry->x, bndry->y, zk) + delta * val;
19521950
}
19531951
}
19541952
}

0 commit comments

Comments
 (0)