@@ -115,11 +115,10 @@ void verifyNumPoints(BoundaryRegion* region, int ptsRequired) {
115115void verifyNumPoints (BoundaryRegion*, int ) {}
116116#endif
117117
118-
119118// /////////////////////////////////////////////////////////////
120119
121120BoundaryOp* 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