<div dir="ltr">Thanks for all your answers! <div><br></div><div>>>Ah, you don’t have the blockID, I see now. That’s unfortunate. <br></div><div>Unfortunately that is the case. </div><div><br></div><div>I will look into the best way to get it! </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 14 Nov 2023 at 14:16, Reyes, Adam <<a href="mailto:adam.reyes@rochester.edu">adam.reyes@rochester.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Yes you can call Grid_getCellCoords from MagneticResistivity, but the MagneticResistivity subroutine itself has no way of knowing what cell index it’s being called on:<div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>  interface MagneticResistivity</div></div><div><div>  </div></div><div><div>     subroutine MagneticResistivity(temp,dens,xn,magResist)</div></div><div><div>       real, intent(IN)  :: temp, dens</div></div><div><div>       real, intent(IN), dimension(NSPECIES)  :: xn</div></div><div><div>       real, intent(OUT) :: magResist</div></div><div><div>     end subroutine MagneticResistivity</div></div><div><div><br></div></div><div><div>     subroutine MagneticResistivity_fullState(solnVec,resPar,resPerp,resCross)</div></div><div><div>       real, intent(in)  :: solnVec(NUNK_VARS)</div></div><div><div>       real, intent(out) :: resPar</div></div><div><div>       real, OPTIONAL, intent(out) :: resPerp</div></div><div><div>       real, OPTIONAL, intent(out) :: resCross</div></div><div><div>     end subroutine MagneticResistivity_fullState</div></div><div><div><br></div></div><div><div> </div></div><div><div>  end interface</div></div><div><br></div></blockquote><br><div><div><br></div><div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">*********************************************<br>Adam Reyes</div><br><span><img alt="FLASH.jpg" src="cid:ii_18bcee52fe761b414c31"></span><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Code Group Leader, Flash Center for </span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Computational Science</span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"> </span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"> </span><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Research Scientist, Dept. of Physics and </span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Astronomy</span><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">University of Rochester</span><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">River Campus: Bausch and Lomb Hall, </span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">369</span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"> </span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"> </span><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">500 Wilson Blvd. PO Box 270171, </span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Rochester, NY 14627</span><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Email</span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"> </span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"><a href="mailto:adam.reyes@rochester.edu" target="_blank">adam.reyes@rochester.edu</a></span><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Web</span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"> </span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"><a href="https://flash.rochester.edu" target="_blank">https://flash.rochester.edu</a></span><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"> </span><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">(he / him / his)</span><br style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span><img alt="FLASH-pride-sml.png" src="cid:ii_18bcee52fe7b8fa88eb2"></span><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br>*********************************************</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br></div><br>
</div>
<div><br><blockquote type="cite"><div>On Nov 14, 2023, at 6:11 PM, John Zuhone <<a href="mailto:jzuhone@gmail.com" target="_blank">jzuhone@gmail.com</a>> wrote:</div><br><div>
<div>Adam,<div><br></div><div>Sorry, a bit confused—is Grid_getCellCoords not part of the public interface? If so, you can call it from any other module, and get the cell coords that way.  </div><div><br></div><div>John<br id="m_-7187535537462513684lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Nov 14, 2023, at 12:10 PM, Reyes, Adam <<a href="mailto:adam.reyes@rochester.edu" target="_blank">adam.reyes@rochester.edu</a>> wrote:</div><br><div><div>Unfortunately  the MagneticResistivity interface doesn’t pass any information about the grid, blockID or otherwise, only the UNK array at a single cell.<div><br></div><div>Since the cell coordinates vary linearly I think the AMR prolongation should take care of the case of mesh refinement.<br id="m_-7187535537462513684lineBreakAtBeginningOfMessage"><div>
<div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">*********************************************<br>Adam Reyes</div><br><span><span id="m_-7187535537462513684cid:EA5A7E59-94B9-4162-879C-B52E774AEA24"><FLASH.jpg></span></span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Code Group Leader, Flash Center for </span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Computational Science</span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"> </span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"> </span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Research Scientist, Dept. of Physics and </span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Astronomy</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">University of Rochester</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">River Campus: Bausch and Lomb Hall, </span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">369</span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"> </span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"> </span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">500 Wilson Blvd. PO Box 270171, </span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Rochester, NY 14627</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Email</span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"> </span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"><a href="mailto:adam.reyes@rochester.edu" target="_blank">adam.reyes@rochester.edu</a></span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Web</span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"> </span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"><a href="https://flash.rochester.edu" target="_blank">https://flash.rochester.edu</a></span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"> </span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">(he / him / his)</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span><span id="m_-7187535537462513684cid:CE45460D-2261-4A69-865C-5CF7BEACF620"><FLASH-pride-sml.png></span></span><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br>*********************************************</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br></div><br>
</div>
<div><br><blockquote type="cite"><div>On Nov 14, 2023, at 6:01 PM, John Zuhone <<a href="mailto:jzuhone@gmail.com" target="_blank">jzuhone@gmail.com</a>> wrote:</div><br><div>
<div>The solution to put the coordinates in variables is overkill, using up memory, and doesn’t work if you only do it in Simulation_initBlock and then the mesh refines later. <div><br></div><div>You need to use Grid_getCellCoords, which has a public interface and can be called from the MagneticResistivity unit:</div><div><br></div><div><div>use Grid_interface, ONLY: Grid_getCellCoords, Grid_getBlkIndexLimits</div></div><div><br></div><div><div>#include "Flash.h"</div><div><br></div><div>logical :: gcell = .true. ! True if you need the guardcells, false if not</div></div><div>real :: size(3)</div><div>real, dimension(:), allocatable :: xc, yc, zc</div><div><div>integer, dimension(LOW:HIGH,MDIM) :: blkLimits,blkLimitsGC</div></div><div><br></div><div>! for a given blockId: </div><div><br></div><div>call Grid_getBlkIndexLimits(blockID,blkLimits,blkLimitsGC)</div><div><br></div><div>if (gcell) then</div><div><div>  size(1) = blkLimitsGC(HIGH,IAXIS) - blkLimitsGC(LOW,IAXIS) + 1</div><div>  size(2) = blkLimitsGC(HIGH,JAXIS) - blkLimitsGC(LOW,JAXIS) + 1</div><div>  size(3) = blkLimitsGC(HIGH,KAXIS) - blkLimitsGC(LOW,KAXIS) + 1</div></div><div>else</div><div><div><div>  size(1) = blkLimits(HIGH,IAXIS) - blkLimits(LOW,IAXIS) + 1</div><div>  size(2) = blkLimits(HIGH,JAXIS) - blkLimits(LOW,JAXIS) + 1</div><div>  size(3) = blkLimits(HIGH,KAXIS) - blkLimits(LOW,KAXIS) + 1</div></div></div><div>endif</div><div><br></div><div><div>call Grid_getCellCoords(KAXIS, blockId, CENTER, gcell, zc, size(3))</div><div>call Grid_getCellCoords(JAXIS, blockId, CENTER, gcell, yc, size(2))</div><div>call Grid_getCellCoords(IAXIS, blockId, CENTER, gcell, xc, size(1))</div></div><div><br></div><div>The xc, yc, zc now contain the cell coordinates for the block. </div><div><br id="m_-7187535537462513684lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Nov 14, 2023, at 11:29 AM, Leland Ellison <lee@pacificfusion.energy> wrote:</div><br><div><div dir="ltr">Hi Ernesto,<div><br></div><div>To make a custom magnetic resistivity model that depends on spatial coordinates, I'd do this by customizing the MagneticResitivity_fullState.f90 file in your problem directory. Notice that the fullState version gets passed in the full vector of unknowns and not just the density and temperature. If you look carefully at e.g. diff_advanceMag, it's actually calling the fullState version by passing in the solnVec so this is the one you want to customize. Next, as you noticed, you don't typically have the spatial coordinates available in your solnVec, but it's quite straightforward to add them. For instance, you can add:</div><div><br></div><div>VARIABLE XCTR</div><div>VARIABLE YCTR</div><div>VARIABLE ZCTR </div><div><br></div><div>in the Config file for your problem, and then in your Simulation_initBlock you can populate these mesh variables with cell centered coordinates, e.g.:</div><div><br></div><div>! inside your i,j,k mesh loop after you've fetched the spatial coordinates</div><div>#ifdef XCTR_VAR<br>        solnData(XCTR_VAR, i,j,k) = xCoord(i)<br>#endif<br></div><div><br></div><div>Then these coordinates will be present in your solnVec for use inside of your customized MagneticResistivity_fullState routine. </div><div><br></div><div>Hope this helps!</div><div>Lee</div><br clear="all"><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><span style="color:rgb(34,34,34)">________________</span><div style="color:rgb(34,34,34)">Leland Ellison PhD<div><br></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 14, 2023 at 7:56 AM Ernesto Zurbriggen <<a href="mailto:ezurbriggen@unc.edu.ar" target="_blank">ezurbriggen@unc.edu.ar</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all! <br>I'm carrying out some single fluid resistive MHD runs with constant resistivity using the <i>/MagneticResistivity/MagneticResistivityMain/Constant</i> unit. <br>Now I would like to implement a spatially dependent resistivity, but I'm not sure which is the easiest way without modifying different subroutines in different units.  <br><br>The optimal implementation would be to create a new unit that keeps the structure of the <i>/MagneticResistivity/MagneticResistivityMain/Constant</i> unit, <br>so I didn't have to change anything else in other units. But the problem with this idea is that the <i>MagneticResistivity subroutine</i>, <br>which calculates the resistivity, has no notion of spatial coordinates. And to provide this subroutine with the spatial coordinates doesn't seem obvious. <br><br>Another possibility might be to save the resistivity in a scratchcenter variable, but in this case I couldn't take advantage of the structure of the <i>/MagneticResistivity/MagneticResistivityMain/Constant</i> unit. <br><br>Any ideas or suggestions will be appreciated!<br></div><div><br></div><div>Thanks in advance! </div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div dir="ltr" style="font-style:inherit;font-variant:inherit;font-weight:inherit;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline"><font face="monospace" color="#666666"><font style="background-color:rgb(234,209,220)"><font><span style="font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;margin:0px;padding:0px;border:0px;vertical-align:baseline"><div style="font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;margin:0px;padding:0px;border:0px;vertical-align:baseline"><i style="background-color:rgb(255,255,255);line-height:normal">PhD Ernesto Zurbriggen,<br></i></div><div style="font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;margin:0px;padding:0px;border:0px;vertical-align:baseline"><i style="background-color:rgb(255,255,255);line-height:normal">Assistant researcher (CONICET)</i><i><br></i></div></span></font></font><font style="background-color:rgb(234,209,220)"><span style="font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;margin:0px;padding:0px;border:0px;vertical-align:baseline"><div style="font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;margin:0px;padding:0px;border:0px;vertical-align:baseline"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;vertical-align:baseline;background-color:rgb(255,255,255)"><i></i></span></div></span></font></font></div><div dir="ltr" style="font-style:inherit;font-variant:inherit;font-weight:inherit;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline"><div style="margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:normal;vertical-align:baseline"><i style="line-height:normal"><font face="monospace" color="#666666"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;vertical-align:baseline"><i style="background-color:rgb(234,209,220)"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;vertical-align:baseline"><div style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;vertical-align:baseline"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:normal;vertical-align:baseline;background-color:rgb(255,255,255)">Email:</span><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:normal;vertical-align:baseline;background-color:rgb(255,255,255)"><i style="line-height:normal"> <a href="mailto:ernesto.zurbriggen@craam.mackenzie.br" target="_blank">ezurbriggen@</a><a href="https://urldefense.com/v3/__http://unc.edu.ar/__;!!CGUSO5OYRnA7CQ!Z9YCiJHBssBZJagnXHnn5cYcZHFWoOZxeO1cLs7SMJLnhDzEj7NCGwrIMuXz8CxNEQC2zOux3VHexkMG0gMC$" target="_blank">unc.edu.ar</a></i></span><i><br></i></div><div style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;vertical-align:baseline"><i><span style="font-size:12.8px">IP phone: (+54) 351-535 3776</span> (int. 75601)<br></i></div></span></i></span><br></font></i></span></div><div style="margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:normal;vertical-align:baseline"><i style="line-height:normal"><font face="monospace" color="#666666">Instituto de Astronomía Teórica y Experimental (IATE-CONICET), </font></i></span></div><div style="margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline"><font face="monospace" color="#666666"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:normal;vertical-align:baseline"><i style="line-height:normal"><i style="font-weight:inherit;line-height:normal">Francisco Laprida sth 922</i></i></span><i style="font-weight:inherit;line-height:normal">, X5000BGR, </i><i style="font-weight:inherit;line-height:normal">Córdoba, </i><i style="font-weight:inherit;line-height:normal">Argentina. </i></font></div></div></div></div></div>
_______________________________________________<br>
flash-users mailing list<br>
<a href="mailto:flash-users@flash.rochester.edu" target="_blank">flash-users@flash.rochester.edu</a><br>
<br>
For list info, including unsubscribe:<br>
<a href="https://flash.rochester.edu/mailman/listinfo/flash-users" rel="noreferrer" target="_blank">https://flash.rochester.edu/mailman/listinfo/flash-users</a><br>
</blockquote></div>
_______________________________________________<br>flash-users mailing list<br><a href="mailto:flash-users@flash.rochester.edu" target="_blank">flash-users@flash.rochester.edu</a><br><br>For list info, including unsubscribe:<br><a href="https://flash.rochester.edu/mailman/listinfo/flash-users" target="_blank">https://flash.rochester.edu/mailman/listinfo/flash-users</a><br></div></blockquote></div><br></div></div>_______________________________________________<br>flash-users mailing list<br><a href="mailto:flash-users@flash.rochester.edu" target="_blank">flash-users@flash.rochester.edu</a><br><br>For list info, including unsubscribe:<br><a href="https://flash.rochester.edu/mailman/listinfo/flash-users" target="_blank">https://flash.rochester.edu/mailman/listinfo/flash-users</a><br></div></blockquote></div><br></div></div></div></blockquote></div><br></div></div></div></blockquote></div><br></div></div>_______________________________________________<br>
flash-users mailing list<br>
<a href="mailto:flash-users@flash.rochester.edu" target="_blank">flash-users@flash.rochester.edu</a><br>
<br>
For list info, including unsubscribe:<br>
<a href="https://flash.rochester.edu/mailman/listinfo/flash-users" rel="noreferrer" target="_blank">https://flash.rochester.edu/mailman/listinfo/flash-users</a><br>
</blockquote></div>