<div dir="ltr"><div><div><div><div><div><div>Dear users<br><br></div>    I've been attempting to do a mixed boundary simulation that has different numbers of root grids in each direction. I think this can be accomplished with the multigrid solver combined with the top level PFFT solver (Hybrid I think its called in the user guide). But I've noticed in Gravity_getPotentialListOfBlocks for the MG solver that it sets all the boundary types equal to the type which grav_boundary_type is set to in the par file:<br><br>  if(.not.useGravity) return<br>  <br>  if(.not.updateGravity) return<br><br>  call Timers_start("gravity Barrier")<br>  call MPI_Barrier (grv_meshComm, ierr)<br>  call Timers_stop("gravity Barrier")<br><br>  call Timers_start("gravity")<br><br>  bcTypes = grav_boundary<br>  where (bcTypes == PERIODIC)<br>     bcTypes = GRID_PDE_BND_PERIODIC<br>  elsewhere (bcTypes == ISOLATED)<br>     bcTypes = GRID_PDE_BND_ISOLATED<br>  elsewhere (bcTypes == DIRICHLET)<br>     bcTypes = GRID_PDE_BND_DIRICHLET<br>  elsewhere (bcTypes == OUTFLOW)<br>     bcTypes = GRID_PDE_BND_NEUMANN<br>  end where<br>  bcValues = 0.<br>     <br><br><br></div>Then later on in hgSolve it compares the boundary type thats passed with the type initialized from hgPFFTinit.F90 (which reads xl_mg_boundary_type, xr, yl, yr, etc). When it sees these are different, it throws an error:<br><br><br>  do eachBoundary = 1, 2*NDIM<br>!!$     if (bndTypes(eachBoundary) == gr_hgbcTypes(eachBoundary) .OR. suppressPfft) then<br>!!$        gr_hgBndTypes(eachBoundary) = bndTypes(eachBoundary)<br>     if (bndTypes(eachBoundary) == gr_hgbcTypes(eachBoundary) .OR. suppressPfft .OR. &<br>          (bndTypes(eachBoundary)==MG_BND_GIVENVAL .AND. gr_hgbcTypes(eachBoundary)==MG_BND_DIRICHLET) ) then<br>        gr_hgBndTypes(eachBoundary) = bndTypes(eachBoundary)<br>     else<br>        if (gr_meshMe .eq. 0) then<br>           write(*,*) 'gr_hgSolve Error: Boundary Conditions for Poisson Solver is inconsistent.'<br>           write(*,*) 'gr_hgSolve Error: direction=',eachBoundary<br>           write(*,*) 'gr_hgSolve Error: gr_hgbcTypes(direction) =',gr_hgbcTypes(eachBoundary)<br>           write(*,*) 'gr_hgSolve Error: bndTypes(direction)     =',bndTypes(eachBoundary)<br>        endif<br>        call Driver_abortFlash('gr_hgSolve Error: BC type argument inconsistent')<br>     end if<br>  end do<br><br></div>So my question is can I safely change the setting in Gravity_getPotentialListOfBlocks to read the six different boundaries used by hgSolve and read by hgPFFTinit, since it appears it should be alright to solve using different ones (and its mentioned in the user guide that it can do mixed boundaries)? I ask because it seems almost as if someone changed it to only do one type of boundary because there may have been an error before, and I'm always a bit cautious to change such a integral piece of code as this.<br><br></div>For clarity, here's my par file settings for the domain and gravity for what I'd like to do:<br> <br><br> 27 xmin        = -1.29093e+17 # effective resolution 32^3<br> 28 xmax        =  1.29093e+17<br> 29 ymin        = -1.29093e+17<br> 30 ymax        =  1.29093e+17<br> 31 zmin        = -1.9364e17 #-1.29093e+17<br> 32 zmax        =  1.9364e17 #1.29093e+17<br> 33 <br> 34 nblockx = 1<br> 35 nblocky = 1<br> 36 nblockz = 2<br> 37 <br> 38 geometry = "cartesian"<br> 39 xl_boundary_type  = "periodic" # "reflecting"<br> 40 xr_boundary_type  = "periodic" # "reflecting"<br> 41 yl_boundary_type  = "periodic" # "reflecting"<br> 42 yr_boundary_type  = "periodic" # "reflecting"<br> 43 zl_boundary_type  = "outflow" #"periodic" # "reflecting"<br> 44 zr_boundary_type  = "outflow" #"periodic" # "reflecting"<br><br>...<br><br>141 useGravity         = .true.<br>142 grav_boundary_type = "periodic" # "isolated"<br>143 mg_maxResidualNorm = 1.0e-6<br>144 mg_printNorm       = .false.<br>145 <br>146 xl_mg_boundary_type  = "periodic" <br>147 xr_mg_boundary_type  = "periodic"<br>148 yl_mg_boundary_type  = "periodic"<br>149 yr_mg_boundary_type  = "periodic"<br>150 zl_mg_boundary_type  = "outflow" #"periodic" <br>151 zr_mg_boundary_type  = "outflow" #"periodic" <br><br></div>Thanks for the assistance,<br><br></div>Joshua Wall<br></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div><div><div><div>Joshua Wall<br></div>Doctoral Candidate<br></div>Department of Physics<br></div>Drexel University<br></div>3141 Chestnut Street<br></div>Philadelphia, PA 19104<br></div></div>