Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add passive scalars #263

Merged
merged 133 commits into from
May 4, 2019
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
d7c7d75
Duplicate 2x hydro/.cpp files to scalars/; rename wl,wr,etc. to sl...
felker Apr 18, 2019
762e377
Uncomment all scalars parts of task_list/; start implementing Integra…
felker Apr 18, 2019
91d73e2
Finish implementing all 7x passive scalar tasks in time_integrator.cpp
felker Apr 18, 2019
c158f80
Delete unnecessary header includes
felker Apr 19, 2019
68fa7ad
Merge branch 'master' into feature/passive_scalars
felker Apr 22, 2019
3f896cd
Merge branch 'hotfix/remove_shallow_copies' into feature/passive_scalars
felker Apr 22, 2019
f0aeea7
Merge branch 'master' into feature/passive_scalars
felker Apr 23, 2019
a436d2f
Remove unnecessary headers from reconstruction/*.cpp
felker Apr 23, 2019
6e246e5
Remove unnecessary parentheses
felker Apr 23, 2019
57cfe28
Rename 2x INT_HYD and 1x INT_SCLRS task related fns
felker Apr 23, 2019
3b17674
Add 3x "simple" near-copies of existing reconstruction files for scalars
felker Apr 23, 2019
e4c2c63
Use new Reconstruction fn overloads in scalars/calculate_scalar_fluxe…
felker Apr 23, 2019
6791dd8
Remove unnecessary header includes
felker Apr 23, 2019
fc1507e
Exchange passive scalars like Hydro, Field boundary variables in Mesh…
felker Apr 23, 2019
c66e4af
Create RiemannSolver() analog, PassiveScalars::ComputeUpwindFlux
felker Apr 23, 2019
95ff9a0
Trivially initialize all scalars in shock_tube.cpp
felker Apr 23, 2019
ab8a8d4
Fix bug; sl,sr_ are 2D AthenArrays, not 4D
felker Apr 23, 2019
d24d2e6
Prepare passive scalar memory registers in StartupTaskList
felker Apr 23, 2019
063e6ea
Infer size of 4th dim of AthenaArray in MeshBlock::WeightedAve
felker Apr 23, 2019
f1f8ba0
Conditionally delete PassiveScalars object in MeshBlock dtor
felker Apr 23, 2019
742ec3f
Make CON2PRIM and PROLONG tasks conditionally depend on SETB_SCLR
felker Apr 23, 2019
5e9246b
Fix bug: AthenaArray PassiveScalars::s is 4D, not 3D
felker Apr 24, 2019
65638b7
Add PassiveScalars OutputData object to linked list
felker Apr 24, 2019
861fbe8
Move OutputType child class ctor definitions to be inline (all identi…
felker Apr 24, 2019
72bf48f
Add volume-averaged sum of passive scalar concentration to history ou…
felker Apr 24, 2019
4cd59fa
Fix style error
felker Apr 24, 2019
e3f7df7
Fix divide by zero compiler warning
felker Apr 24, 2019
d60773c
Move OutputType ctor body to initializer list
felker Apr 24, 2019
688feb2
Add self-gravity rho*phi to .hst output files
felker Apr 24, 2019
5ef44a3
Add input file for future pgen/slotted_cylinder.cpp
felker Apr 24, 2019
51f0037
Modify self-gravity .hst output to use 1/2 factor
felker Apr 24, 2019
ea01c90
Change column header string for self-gravity history output
felker Apr 24, 2019
706e6e0
Fix typo in rt.cpp RefinementCondition()
felker Apr 24, 2019
aafa820
Properly add passive scalars to HDF5 and restart outputs
felker Apr 25, 2019
8852d05
Account for passive scalars size in MeshBlock::GetBlockSizeInBytes
felker Apr 25, 2019
c74a6e3
Fix typo (missing space) in error message
felker Apr 25, 2019
b0032e0
Rescale domain limits of slotted cylinder problem for symmetry about 0,0
felker Apr 25, 2019
3615a60
Create separate input file for SMR and AMR variants of slotted cylinder
felker Apr 25, 2019
4f904bf
Add initial draft of slotted cylinder problem, with working AMR condi…
felker Apr 25, 2019
08b2e6c
Use std::sqrt, not sqrt
felker Apr 25, 2019
919d473
Drop trailing underscore from names of Mesh::f2,f3 members
felker Apr 25, 2019
e72bc6b
Use initializer list for 2x Mesh ctors
felker Apr 25, 2019
03411ed
Initialize MeshGenerator_[] array of fn ptrs in initializer list
felker Apr 25, 2019
172f04c
Merge branch 'master' into feature/passive_scalars
felker Apr 26, 2019
22eb714
Remove trivial "== true"
felker Apr 26, 2019
94a23b7
Remove more trivial "==true"
felker Apr 26, 2019
0c3526c
Fix missed renaming of f2_, f3_
felker Apr 26, 2019
54b07d2
Create new scoped enumerator type for controlling evolution of fluid
felker Apr 26, 2019
fb4ce44
Skip dynamic Hydro tasks if hydro/active=background or disabled
felker Apr 26, 2019
cd884cb
Conditionally allocate 4th order arrays in Hydro ctor
felker Apr 26, 2019
5951f71
Deep copy 4th order face-centered mass fluxes from Hydro to PassiveSc…
felker Apr 26, 2019
c2ac5bc
Add error calculation to slotted cylinder's UserWorkAfterLoop
felker Apr 26, 2019
aaafabc
Replace all ==false with !
felker Apr 26, 2019
1f4c3fa
Extend time/correct_ic=true 4th order correction to passive scalars IC
felker Apr 26, 2019
61bbb47
Disable allocation of 4th order PassiveScalars::s_cc
felker Apr 26, 2019
d54b92a
Fix bug in 4th order scalars IC correction
felker Apr 26, 2019
3855aec
Merge branch 'master' into feature/passive_scalars
felker Apr 29, 2019
7fc5491
Begin new file, eos_scalars.cpp, for passive scalar floors and conver…
felker Apr 29, 2019
1894981
Update all ApplyPrimitiveFloors() function declarations to apply to x…
felker Apr 29, 2019
1e42aea
Update eos/general/ 2x implementations of ApplyPrimitiveFloors()
felker Apr 29, 2019
420ec3f
Update all function calls to ApplyPrimitiveFloors()
felker Apr 29, 2019
6e196c9
Use member init lists for EquationOfState ctors
felker Apr 29, 2019
8bfd095
Update eos/general/ EquationOfState ctors
felker Apr 29, 2019
f143710
Enclose hydrogen.cpp free functions and vars in an anonymous namespace
felker Apr 29, 2019
302dd3c
Remove unused #include <limits>
felker Apr 29, 2019
1ae4ba6
Call ApplyPassiveScalarFloors() for 4th order passive scalar fluxes
felker Apr 29, 2019
9ad007d
Delete commented-out flooring steps of reconstruct/*_simple.cpp files
felker Apr 29, 2019
12c5333
Call ApplyPassiveScalarFloors() for midpoint flux calculations
felker Apr 29, 2019
76c9aa9
Comment-out unnecessary flooring due to SwapAthenaArray strategy
felker Apr 29, 2019
4912825
Establish primitive/conserved variable duality in PassiveScalars
felker Apr 30, 2019
12bc452
Update 2x pgen/ files and time_integrator.cpp to use prim/cons Passiv…
felker Apr 30, 2019
2665cb2
Update outputs/ for primitive/conserved passive scalar values
felker Apr 30, 2019
4f34d8b
Rename CON2PRIM to CONS2PRIM
felker Apr 30, 2019
3731adf
Use member init list
felker Apr 30, 2019
26d2c33
Create separate Prim2Cons and Cons2Prim fns for PassiveScalars members
felker Apr 30, 2019
d8e077e
Remove redundant HydroBoundaryVariable var_cc, coarse_buf ptr changes
felker Apr 30, 2019
c8fd9eb
Call PassiveScalars EOS fns in Mesh::Initialize and time_integrator.cpp
felker Apr 30, 2019
5a39d6b
Add eos_scalars.cpp to Makefile.in SRC_FILES variable
felker Apr 30, 2019
b5e7e44
Somehow missed adding PassiveScalars ctor and memcpy to MeshBlock res…
felker Apr 30, 2019
1c718e2
Apply new physID reservation for MPI tag in MeshBlock restart ctor
felker Apr 30, 2019
0b3120d
Add conserved variable HDF5 and .rst output to refined slotted cylinder
felker Apr 30, 2019
0df02af
Merge branch 'master' into feature/passive_scalars
felker Apr 30, 2019
939a7ff
Remove leftover shearing box comments
felker Apr 30, 2019
69c2425
Use updated Hydro::w1, not prim_old=w, for passive scalars EOS
felker Apr 30, 2019
61d0a44
Scalar floor should be multiplied by density when applied to cons Pas…
felker Apr 30, 2019
a470935
Update headers of add_*_flux_divergence.cpp files
felker Apr 30, 2019
153975a
Add long comment to bvals_refine.cpp about complicated ptr changes
felker Apr 30, 2019
86d0fa1
Allocate passive scalar primitive variable coarse array
felker Apr 30, 2019
7e5d1b4
Call PassiveScalars EOS in ApplyPhysicalBoundaries for ghost cells
felker Apr 30, 2019
4d3d947
Make S/AMR enrollment fns return integer index of related vector entry
felker Apr 30, 2019
76c6129
Call PassiveScalars EOS and inverse EOS in bvals_refine.cpp
felker Apr 30, 2019
de7b9fb
Fix typo in input file
felker Apr 30, 2019
3bb2fd5
Flip ternary operator condition in passive scalar floors.
felker Apr 30, 2019
b64a8d8
Begin adding utilities for Gauss-Legendre quadrature
felker May 1, 2019
691e1d5
Join lines of weights and abscissae arrays
felker May 1, 2019
ca053a5
Prepare to call custom implementation of GL quadatrue in slotted cyli…
felker May 1, 2019
438c024
Merge branch 'master' into feature/passive_scalars
felker May 1, 2019
37b3ab7
Fix spacing error
felker May 1, 2019
dc6d855
Avoid illegal zero-length compile-time arrays
felker May 1, 2019
6ddaef9
Build array (64 ct) of structs for collecting GL quadrature weights a…
felker May 1, 2019
8d1a8c1
Avoid compiler narrowing warning; static_cast<int> std::vector<T>::si…
felker May 1, 2019
a9aaf35
Disable HDF5 output for AMR linwave test
felker May 1, 2019
edcd516
Add first draft implementations of 1D, 2D GL quadrature integrate()
felker May 1, 2019
e706e0e
Add 3D version of GaussLegendre::integrate()
felker May 1, 2019
b30601b
Add local compile-time switch for using GL quadrature to slotted_cyli…
felker May 1, 2019
d4cfe26
Remove extra GL weight
felker May 1, 2019
1428680
Add DIFFUSE_SCLR task ID and associated fn, and add to TimeIntTaskList
felker May 1, 2019
eff4e2b
Clean up hydro/hydro_diffusion/
felker May 1, 2019
b328276
Clean up field/field_diffusion
felker May 1, 2019
be5f05a
Update fn call to formerly-named AddHydroDiffusionFlux
felker May 1, 2019
0b28168
Update diffusion fn calls in new_blockdt.cpp
felker May 1, 2019
16dd743
Add notes about future improvements to hydro_diffusion/
felker May 1, 2019
26b4d7d
Add diffusion process to PassiveScalars class
felker May 1, 2019
8c65544
Define DIFFUSE_SCLR task's function
felker May 1, 2019
40db273
Do not use shortened function parameter names
felker May 1, 2019
62f6de1
Fix PassiveScalars::DiffusiveFluxIso
felker May 1, 2019
0220a61
Unlike thermal conduction fluxes, scalar diffusion fluxes are separat…
felker May 1, 2019
84c25dc
Passive scalar diffusion fluxes are stored separately from s_flux
felker May 1, 2019
5a2b962
Add problem/nu_scalar_iso to 2x slotted cylinder input files
felker May 2, 2019
87552a1
Need to clear PassiveScalars::diffusion_flx every stage of time integ…
felker May 2, 2019
9322de0
Adjust dt by passive scalar diffusion explicit stability constraint
felker May 2, 2019
5a404d6
Split passive scalar diffusion code into new file, scalar_diffusion.cpp
felker May 2, 2019
dc18caf
Do not adjust the internal cfl_number by cfl_limit if fluid is static
felker May 2, 2019
48b1dd0
Add 4th order EOS routines for passive scalars
felker May 2, 2019
e006d7f
Call 4th order EOS routines for passive scalars in Initialize(), main…
felker May 2, 2019
4901319
Remove emf comments from calculate_scalar_fluxes.cpp
felker May 3, 2019
b851453
Revert change to EOS flooring routine function signatures
felker May 3, 2019
cbdd1d7
Revert changes to calls to EOS flooring routines in reconstruct/
felker May 3, 2019
3c558ab
Throw error if STS is used with passive scalars
felker May 3, 2019
7546318
Clarify comment on FFTBlock restriction
felker May 3, 2019
447415b
Remove 1x unused 1D temporary AthenaArray from PassiveScalars
felker May 3, 2019
b1126c0
Add passive scalar treatment to STS task list
felker May 4, 2019
947251c
Fix main TimeIntegratorTaskList after changes to STS w/ passive scalars
felker May 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions inputs/hydro/athinput.slotted_cylinder2d
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<comment>
problem = advection of a 2D slotted cylinder passive scalar profile
reference = Zalesak, S.T., JCP 31, 335-362 (1979) (Figure 11, section VII)
reference = Colella, P., et al, JCP 230, 2952–2976 (2011) (Figure 13, section 4.4.5)
configure = --prob=slotted_cylinder --eos=isothermal --nscalars=1

<job>
problem_id = SlottedCylinder # problem ID: basename of output filenames

<output1>
file_type = hst # History data dump
dt = 0.01 # time increment between outputs
data_format = %.17g # round trip conversion: binary64 <-> decimal

<output2>
file_type = vtk # Binary data dump
variable = prim # variables to be output
dt = 0.01 # time increment between outputs

<time>
cfl_number = 0.4 # The Courant, Friedrichs, & Lewy (CFL) Number
nlim = -1 # cycle limit
tlim = 1.0 # time limit
integrator = vl2 # time integration algorithm
xorder = 2 # order of spatial reconstruction
ncycle_out = 1 # interval for stdout summary info
correct_ic = false # correct midpoint assumption in initial condition
correct_err = false # correct midpoint assumption in analytic solution

<mesh>
nx1 = 100 # Number of zones in X1-direction
x1min = -0.5 # minimum value of X1
x1max = 0.5 # maximum value of X1
ix1_bc = periodic # inner-X1 boundary flag
ox1_bc = periodic # outer-X1 boundary flag

nx2 = 100 # Number of zones in X2-direction
x2min = -0.5 # minimum value of X2
x2max = 0.5 # maximum value of X2
ix2_bc = periodic # inner-X2 boundary flag
ox2_bc = periodic # outer-X2 boundary flag

nx3 = 1 # Number of zones in X3-direction
x3min = -0.5 # minimum value of X3
x3max = 0.5 # maximum value of X3
ix3_bc = periodic # inner-X2 boundary flag
ox3_bc = periodic # outer-X2 boundary flag

num_threads = 1 # maximum number of OMP threads
refinement = none

<meshblock>
nx1 = 100 # Number of zones in X1-direction
nx2 = 100 # Number of zones in X2-direction
nx3 = 1 # Number of zones in X3-direction

<hydro>
iso_sound_speed = 1.0 # isothermal sound speed
active = background # compute Hydro fluxes, etc. but do NOT evolve the fluid

<problem>
compute_error = true # set value to 'true' to compute L1 error compared to initial data
radius = 0.15 # Radius of the cylinder
center_x1 = 0.00 # x1 position of cylinder center
center_x2 = 0.25 # x2 position of cylinder center
omega = 1.0 # angular velocity of the advecting cylinder
omega_x1 = 0.00 # x1 position of axis of rotation
omega_x2 = 0.00 # x2 position of axis of rotation
s_width = 0.05 # Width of the slot
s_height = 0.25 # Height of the slot
99 changes: 99 additions & 0 deletions inputs/hydro/athinput.slotted_cylinder2d_refined
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<comment>
problem = advection of a 2D slotted cylinder passive scalar profile (with SMR or AMR)
reference = Zalesak, S.T., JCP 31, 335-362 (1979) (Figure 11, section VII)
reference = Colella, P., et al, JCP 230, 2952–2976 (2011) (Figure 13, section 4.4.5)
configure = --prob=slotted_cylinder --eos=isothermal --nscalars=1 -hdf5

<job>
problem_id = SlottedCylinder # problem ID: basename of output filenames

<output1>
file_type = hst # History data dump
dt = 0.01 # time increment between outputs
data_format = %.17g # round trip conversion: binary64 <-> decimal

<output2>
file_type = hdf5 # HDF5 data dump
variable = prim # variables to be output
dt = 0.01 # time increment between outputs

<time>
cfl_number = 0.4 # The Courant, Friedrichs, & Lewy (CFL) Number
nlim = -1 # cycle limit
tlim = 1.0 # time limit
integrator = vl2 # time integration algorithm
xorder = 2 # order of spatial reconstruction
ncycle_out = 1 # interval for stdout summary info
correct_ic = false # correct midpoint assumption in initial condition
correct_err = false # correct midpoint assumption in analytic solution

<mesh>
nx1 = 100 # Number of zones in X1-direction
x1min = -0.5 # minimum value of X1
x1max = 0.5 # maximum value of X1
ix1_bc = periodic # inner-X1 boundary flag
ox1_bc = periodic # outer-X1 boundary flag

nx2 = 100 # Number of zones in X2-direction
x2min = -0.5 # minimum value of X2
x2max = 0.5 # maximum value of X2
ix2_bc = periodic # inner-X2 boundary flag
ox2_bc = periodic # outer-X2 boundary flag

nx3 = 1 # Number of zones in X3-direction
x3min = -0.5 # minimum value of X3
x3max = 0.5 # maximum value of X3
ix3_bc = periodic # inner-X2 boundary flag
ox3_bc = periodic # outer-X2 boundary flag

num_threads = 1 # maximum number of OMP threads
refinement = none
numlevel = 4
deref_count = 5

<meshblock>
nx1 = 4 # Number of zones in X1-direction
nx2 = 4 # Number of zones in X2-direction
nx3 = 1 # Number of zones in X3-direction

# The following refinement regions are used in regression tests. By default,
# they are ignored. To use, set MeshBlock size to 4x4x1. (or 20x20x1, but then the default
# static refinement regions below will be larger than indicated in the comments)

# enclose the cylinder in a 0.3x0.3 square region (assuming default <problem> parameter values)
<refinement1>
x1min = -0.15
x1max = 0.15
x2min = 0.1
x2max = 0.4
x3min = -0.5
x3max = 0.5
level = 1

# cover the slot with a 0.08x0.3 rectangular region (assuming default <problem> parameter values)
<refinement2>
# for 4x4x1 MeshBlocks with 5 cell slot on root grid, this will refine all blocks wholly
# within slot, +1x on both sides
x1min = -0.040
x1max = 0.040
x2min = 0.1
x2max = 0.4
x3min = -0.5
x3max = 0.5
level = 2

<hydro>
iso_sound_speed = 1.0 # isothermal sound speed
active = background # compute Hydro fluxes, etc. but do NOT evolve the fluid

<problem>
compute_error = true # set value to 'true' to compute L1 error compared to initial data
radius = 0.15 # Radius of the cylinder
center_x1 = 0.00 # x1 position of cylinder center
center_x2 = 0.25 # x2 position of cylinder center
omega = 1.0 # angular velocity of the advecting cylinder
omega_x1 = 0.00 # x1 position of axis of rotation
omega_x2 = 0.00 # x2 position of axis of rotation
s_width = 0.05 # Width of the slot
s_height = 0.25 # Height of the slot
thr = 0.2 # scalar gradient threshold for AMR
4 changes: 3 additions & 1 deletion src/athena.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct LogicalLocation { // aggregate and POD type
//! \struct RegionSize
// \brief physical size and number of cells in a Mesh or a MeshBlock

struct RegionSize {
struct RegionSize { // aggregate and POD type; do NOT reorder member declarations:
Real x1min, x2min, x3min;
Real x1max, x2max, x3max;
Real x1rat, x2rat, x3rat; // ratio of x(i)/x(i-1)
Expand Down Expand Up @@ -158,6 +158,8 @@ enum CoordinateDirection {X1DIR=0, X2DIR=1, X3DIR=2};
enum class BoundaryQuantity {cc, fc, cc_flcor, fc_flcor, mggrav, mggrav_f};
enum class HydroBoundaryQuantity {cons, prim};
enum class BoundaryCommSubset {mesh_init, gr_amr, all};
// TODO(felker): consider generalizing/renaming to QuantityFormulation
enum class FluidFormulation {evolve, background, disabled}; // rename background -> fixed?

//----------------------------------------------------------------------------------------
// function pointer prototypes for user-defined modules set at runtime
Expand Down
2 changes: 1 addition & 1 deletion src/bvals/bvals_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ BoundaryBase::BoundaryBase(Mesh *pm, LogicalLocation iloc, RegionSize isize,
loc = iloc;
block_size_ = isize;
pmy_mesh_ = pm;
if (called_ == false) {
if (!called_) {
int dim = 1;
if (block_size_.nx2 > 1) dim = 2;
if (block_size_.nx3 > 1) dim = 3;
Expand Down
3 changes: 2 additions & 1 deletion src/bvals/bvals_var.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

//========================================================================================
// Athena++ astrophysical MHD code
// Copyright(C) 2014 James M. Stone <jmstone@princeton.edu> and other code contributors
Expand Down Expand Up @@ -223,7 +224,7 @@ bool BoundaryVariable::ReceiveBoundaryBuffers() {
int test;
MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &test, MPI_STATUS_IGNORE);
MPI_Test(&(bd_var_.req_recv[nb.bufid]), &test, MPI_STATUS_IGNORE);
if (static_cast<bool>(test) == false) {
if (!static_cast<bool>(test)) {
bflag = false;
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/bvals/cc/bvals_cc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ void CellCenteredBoundaryVariable::SetupPersistentMPI() {
MeshBlock* pmb = pmy_block_;
int &mylevel = pmb->loc.level;

int f2 = pmy_mesh_->f2_, f3 = pmy_mesh_->f3_;
int f2 = pmy_mesh_->f2, f3 = pmy_mesh_->f3;
int cng, cng1, cng2, cng3;
cng = cng1 = pmb->cnghost;
cng2 = cng*f2;
Expand Down
2 changes: 1 addition & 1 deletion src/bvals/cc/bvals_shear_cc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ bool CellCenteredBoundaryVariable::ReceiveShearingBoxBoundaryBuffers() {
MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &test,
MPI_STATUS_IGNORE);
MPI_Test(&shear_bd_var_[upper].req_recv[n], &test, MPI_STATUS_IGNORE);
if (static_cast<bool>(test) == false) {
if (!static_cast<bool>(test)) {
flag[upper] = false;
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/bvals/cc/flux_correction_cc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ bool CellCenteredBoundaryVariable::ReceiveFluxCorrection() {
MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &test,
MPI_STATUS_IGNORE);
MPI_Test(&(bd_var_flcor_.req_recv[nb.bufid]), &test, MPI_STATUS_IGNORE);
if (static_cast<bool>(test) == false) {
if (!static_cast<bool>(test)) {
bflag = false;
continue;
}
Expand Down
8 changes: 4 additions & 4 deletions src/bvals/cc/mg/bvals_mg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ class MultigridDriver;

MGBoundaryValues::MGBoundaryValues(Multigrid *pmg, BoundaryFlag *input_bcs,
MGBoundaryFunc *MGBoundary)
: BoundaryBase(pmg->pmy_driver_->pmy_mesh_, pmg->loc_, pmg->size_, input_bcs) {
pmy_mg_ = pmg;
: BoundaryBase(pmg->pmy_driver_->pmy_mesh_, pmg->loc_, pmg->size_, input_bcs),
pmy_mg_(pmg) {
#ifdef MPI_PARALLEL
mgcomm_ = pmg->pmy_driver_->MPI_COMM_MULTIGRID;
// currently assuming that Multigrid gravity is the only "int physid" associated with
// the owning MultigridDriver object:
mg_grav_phys_id_ = pmg->pmy_driver_->mg_phys_id_;
#endif
if (pmy_mg_->root_flag_ == true) {
if (pmy_mg_->root_flag_) {
for (int i=0; i<6; i++)
MGBoundaryFunction_[i] = MGBoundary[i];
} else {
Expand Down Expand Up @@ -441,7 +441,7 @@ bool MGBoundaryValues::ReceiveMultigridBoundaryBuffers(AthenaArray<Real> &dst,
int test;
MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, mgcomm_, &test, MPI_STATUS_IGNORE);
MPI_Test(&(pbd->req_recv[nb.bufid]), &test, MPI_STATUS_IGNORE);
if (static_cast<bool>(test) == false) {
if (!static_cast<bool>(test)) {
bflag = false;
continue;
}
Expand Down
10 changes: 5 additions & 5 deletions src/bvals/fc/bvals_fc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ int FaceCenteredBoundaryVariable::ComputeVariableBufferSize(const NeighborIndexe
int nx1 = pmb->block_size.nx1;
int nx2 = pmb->block_size.nx2;
int nx3 = pmb->block_size.nx3;
int f2 = pmy_mesh_->f2_, f3 = pmy_mesh_->f3_;
int f2 = pmy_mesh_->f2, f3 = pmy_mesh_->f3;
int cng1, cng2, cng3;
cng1 = cng;
cng2 = cng*f2;
Expand Down Expand Up @@ -1207,7 +1207,7 @@ void FaceCenteredBoundaryVariable::SetupPersistentMPI() {
int nx3 = pmb->block_size.nx3;
int &mylevel = pmb->loc.level;

int f2 = pmy_mesh_->f2_, f3 = pmy_mesh_->f3_;
int f2 = pmy_mesh_->f2, f3 = pmy_mesh_->f3;
int cng, cng1, cng2, cng3;
cng = cng1 = pmb->cnghost;
cng2 = cng*f2;
Expand Down Expand Up @@ -1331,7 +1331,7 @@ void FaceCenteredBoundaryVariable::SetupPersistentMPI() {
if (nb.snb.level == mylevel) { // the same level
if ((nb.ni.type == NeighborConnect::face)
|| ((nb.ni.type == NeighborConnect::edge)
&& (edge_flag_[nb.eid] == true))) {
&& (edge_flag_[nb.eid]))) {
tag = pbval_->CreateBvalsMPITag(nb.snb.lid, nb.targetid, fc_flx_phys_id_);
if (bd_var_flcor_.req_send[nb.bufid] != MPI_REQUEST_NULL)
MPI_Request_free(&bd_var_flcor_.req_send[nb.bufid]);
Expand Down Expand Up @@ -1416,7 +1416,7 @@ void FaceCenteredBoundaryVariable::StartReceiving(BoundaryCommSubset phase) {
if ((nb.snb.level > mylevel) ||
((nb.snb.level == mylevel) && ((nb.ni.type == NeighborConnect::face)
|| ((nb.ni.type == NeighborConnect::edge)
&& (edge_flag_[nb.eid] == true)))))
&& (edge_flag_[nb.eid])))))
MPI_Start(&(bd_var_flcor_.req_recv[nb.bufid]));
}
}
Expand Down Expand Up @@ -1466,7 +1466,7 @@ void FaceCenteredBoundaryVariable::ClearBoundary(BoundaryCommSubset phase) {
else if ((nb.snb.level == mylevel)
&& ((nb.ni.type == NeighborConnect::face)
|| ((nb.ni.type == NeighborConnect::edge)
&& (edge_flag_[nb.eid] == true))))
&& (edge_flag_[nb.eid]))))
MPI_Wait(&(bd_var_flcor_.req_send[nb.bufid]), MPI_STATUS_IGNORE);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/bvals/fc/bvals_shear_emf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ bool FaceCenteredBoundaryVariable::ReceiveEMFShearingBoxBoundaryCorrection() {
MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &test,
MPI_STATUS_IGNORE);
MPI_Test(&shear_bd_emf_[upper].req_recv[n], &test, MPI_STATUS_IGNORE);
if (static_cast<bool>(test) == false) {
if (!static_cast<bool>(test)) {
flag[upper] = false;
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/bvals/fc/bvals_shear_fc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ bool FaceCenteredBoundaryVariable::ReceiveShearingBoxBoundaryBuffers() {
MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &test,
MPI_STATUS_IGNORE);
MPI_Test(&shear_bd_var_[upper].req_recv[n], &test, MPI_STATUS_IGNORE);
if (static_cast<bool>(test) == false) {
if (!static_cast<bool>(test)) {
flag[upper] = false;
continue;
}
Expand Down
Loading