@@ -420,7 +420,7 @@ void ZeroBoundaryFlux(MeshData<Real> *md, IndexDomain domain, bool coarse)
420420 auto & B_F = rc->PackVariablesAndFluxes (std::vector<std::string>{" cons.B" });
421421
422422 if (domain == IndexDomain::inner_x2 &&
423- pmb-> boundary_flag [BoundaryFace::inner_x2] == BoundaryFlag::user ) {
423+ KBoundaries::IsPhysicalBoundary (pmb, BoundaryFace::inner_x2) ) {
424424 pmb->par_for (" fix_flux_b_l" , kbs.s , kbs.e , jbf.s , jbf.s , ibs.s , ibs.e ,
425425 KOKKOS_LAMBDA (const int &k, const int &j, const int &i) {
426426 B_F.flux (X2DIR, V1, k, j, i) = 0 .;
@@ -432,7 +432,7 @@ void ZeroBoundaryFlux(MeshData<Real> *md, IndexDomain domain, bool coarse)
432432 }
433433
434434 if (domain == IndexDomain::outer_x2 &&
435- pmb-> boundary_flag [BoundaryFace::outer_x2] == BoundaryFlag::user ) {
435+ KBoundaries::IsPhysicalBoundary (pmb, BoundaryFace::outer_x2) ) {
436436 pmb->par_for (" fix_flux_b_r" , kbs.s , kbs.e , jbf.e , jbf.e , ibs.s , ibs.e ,
437437 KOKKOS_LAMBDA (const int &k, const int &j, const int &i) {
438438 B_F.flux (X2DIR, V1, k, j, i) = 0 .;
@@ -450,7 +450,7 @@ void ZeroBoundaryFlux(MeshData<Real> *md, IndexDomain domain, bool coarse)
450450 // 2. However, B2 and B3 are normal outflow conditions -- despite the fluxes here, the outflow
451451 // conditions will set them equal to the last zone.
452452 if (domain == IndexDomain::inner_x1 &&
453- pmb-> boundary_flag [BoundaryFace::inner_x1] == BoundaryFlag::user ) {
453+ KBoundaries::IsPhysicalBoundary (pmb, BoundaryFace::inner_x1) ) {
454454 pmb->par_for (" fix_flux_b_in_old" , kbs.s , kbs.e , jbs.s , jbs.e , ibf.s , ibf.s ,
455455 KOKKOS_LAMBDA (const int &k, const int &j, const int &i) {
456456 B_F.flux (X1DIR, V2, k, j, i) = 0 .;
@@ -462,7 +462,7 @@ void ZeroBoundaryFlux(MeshData<Real> *md, IndexDomain domain, bool coarse)
462462 }
463463
464464 if (domain == IndexDomain::outer_x1 &&
465- pmb-> boundary_flag [BoundaryFace::outer_x1] == BoundaryFlag::user ) {
465+ KBoundaries::IsPhysicalBoundary (pmb, BoundaryFace::outer_x1) ) {
466466 pmb->par_for (" fix_flux_b_out_old" , kbs.s , kbs.e , jbs.s , jbs.e , ibf.e , ibf.e ,
467467 KOKKOS_LAMBDA (const int &k, const int &j, const int &i) {
468468 B_F.flux (X1DIR, V2, k, j, i) = 0 .;
@@ -509,7 +509,7 @@ void Bflux0(MeshData<Real> *md, IndexDomain domain, bool coarse)
509509 // Allows nonzero flux across X1 boundary but still keeps divB=0 (turns out effectively to have 0 flux)
510510 // Usable only for Dirichlet conditions
511511 if (domain == IndexDomain::inner_x1 &&
512- pmb-> boundary_flag [BoundaryFace::inner_x1] == BoundaryFlag::user )
512+ KBoundaries::IsPhysicalBoundary (pmb, BoundaryFace::inner_x1) )
513513 {
514514 pmb->par_for (" fix_flux_b_in" , kbs.s , kbs.e , jbs.s , jbs.e , ibf.s , ibf.s , // Hyerin (12/28/22) for 1st & 2nd prescription
515515 KOKKOS_LAMBDA (const int &k, const int &j, const int &i) {
@@ -521,7 +521,7 @@ void Bflux0(MeshData<Real> *md, IndexDomain domain, bool coarse)
521521
522522 }
523523 if (domain == IndexDomain::inner_x2 &&
524- pmb-> boundary_flag [BoundaryFace::inner_x2] == BoundaryFlag::user )
524+ KBoundaries::IsPhysicalBoundary (pmb, BoundaryFace::inner_x2) )
525525 {
526526 pmb->par_for (" fix_flux_b_in" , kbs.s , kbs.e , jbf.s , jbf.s , ibs.s , ibs.e ,
527527 KOKKOS_LAMBDA (const int &k, const int &j, const int &i) {
@@ -534,7 +534,7 @@ void Bflux0(MeshData<Real> *md, IndexDomain domain, bool coarse)
534534
535535 // OUTER
536536 if (domain == IndexDomain::outer_x1 &&
537- pmb-> boundary_flag [BoundaryFace::outer_x1] == BoundaryFlag::user )
537+ KBoundaries::IsPhysicalBoundary (pmb, BoundaryFace::outer_x1) )
538538 {
539539 pmb->par_for (" fix_flux_b_out" , kbs.s , kbs.e , jbs.s , jbs.e , ibf.e , ibf.e , // Hyerin (12/28/22) for 1st & 2nd prescription
540540 KOKKOS_LAMBDA (const int &k, const int &j, const int &i) {
@@ -545,7 +545,7 @@ void Bflux0(MeshData<Real> *md, IndexDomain domain, bool coarse)
545545 );
546546 }
547547 if (domain == IndexDomain::outer_x2 &&
548- pmb-> boundary_flag [BoundaryFace::outer_x2] == BoundaryFlag::user )
548+ KBoundaries::IsPhysicalBoundary (pmb, BoundaryFace::outer_x2) )
549549 {
550550 pmb->par_for (" fix_flux_b_out" , kbs.s , kbs.e , jbf.e , jbf.e , ibs.s , ibs.e ,
551551 KOKKOS_LAMBDA (const int &k, const int &j, const int &i) {
@@ -563,9 +563,9 @@ IndexRange ValidDivBX1(MeshBlock *pmb)
563563 // intersecting the interior & exterior faces. Don't report these zones, as we expect it.
564564 const IndexRange ibl = pmb->meshblock_data .Get (" base" )->GetBoundsI (IndexDomain::interior);
565565 bool avoid_inner = (!pmb->packages .Get (" B_FluxCT" )->Param <bool >(" fix_flux_inner_x1" ) &&
566- pmb-> boundary_flag [BoundaryFace::inner_x1] == BoundaryFlag::user );
566+ KBoundaries::IsPhysicalBoundary (pmb, BoundaryFace::inner_x1) );
567567 bool avoid_outer = (!pmb->packages .Get (" B_FluxCT" )->Param <bool >(" fix_flux_outer_x1" ) &&
568- pmb-> boundary_flag [BoundaryFace::outer_x1] == BoundaryFlag::user );
568+ KBoundaries::IsPhysicalBoundary (pmb, BoundaryFace::outer_x1) );
569569 return IndexRange{ibl.s + (avoid_inner), ibl.e + (!avoid_outer)};
570570}
571571
0 commit comments