<div dir="ltr">Hi Souqing,<div><br></div><div>I think the code lines are correct. Please first note that the filed loop is rotated about the y-axis, following the transformation rule:</div><div><br></div><div><div> x1 = x*cos(ang) - z*sin(ang)</div><div> x2 = y</div><div> x3 = x*sin(ang) + z*cos(ang)</div></div><div> </div><div>Now, you want to define vector potentials to define divergence-free face magnetic fields using the following rules:</div><div><br></div><div><div> Bx = dAz/dy - dAy/dz</div><div> By = dAx/dz - dAz/dx</div><div> Bz = dAy/dx - dAx/dy</div></div><div><br></div><div>When considering Ax in this case, you want to stagger (i.e., use coordinates at faces, rather than centers) y and z coordinates for the straightforward differencing. Since y is not rotated, you just need to stagger z-coordinate, leaving x-coordinate at cell-centers.</div><div><br></div><div>Likewise, you would need to stagger x-y for Az, for which you just need x-staggering only, keeping z-coordinates at cell-centers.</div><div><br></div><div>I double checked this with the code implementations in the ATHENA code setup, and they look the same as the FLASH implementation.</div><div><br></div><div>Hope this helps.</div><div><br></div><div>Best,</div><div>Dongwook</div><div><br></div><div><div><font color="#000000" size="2" face="arial, helvetica, sans-serif">=========================================</font></div><div><font color="#000000" size="2" face="arial, helvetica, sans-serif">Dongwook Lee, Ph.D., Assistant Professor</font></div><div><font color="#000000" size="2" face="arial, helvetica, sans-serif">Applied Mathematics and Statistics<br></font></div><div><font color="#000000" size="2" face="arial, helvetica, sans-serif">University of California, Santa Cruz</font></div><div><font color="#000000" size="2" face="arial, helvetica, sans-serif">Baskin Engineering, Room 353C</font></div><div><font color="#000000" size="2" face="arial, helvetica, sans-serif">1156 High Street, Santa Cruz, CA 95064</font></div><div><a href="https://users.soe.ucsc.edu/~dongwook/" target="_blank"><font color="#000000" size="2" face="arial, helvetica, sans-serif">https://users.soe.ucsc.edu/~dongwook/</font></a></div><div><br></div></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 21, 2017 at 12:57 AM, Suoqing Ji <span dir="ltr"><<a href="mailto:suoqing@physics.ucsb.edu" target="_blank">suoqing@physics.ucsb.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div name="messageBodySection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif">Hi,
<div><br></div>
<div>I would like to report a very minor bug in magnetoHD/FieldLoop/<wbr>Simulation_initBlock.F90: in line 253 and 273, the variable xCoord(i) and zCoord(k) should be replaced by xx and zz.</div>
<div><br></div>
<div>With current code, depending on platforms and ways of setup, the simulation has a certain possibility of hanging forever at initialization stage without any error output (sometimes it can run successfully). I encounter this issue when I use FieldLoop for performance tests on Stampede.</div>
<div><br></div>
<div>Thanks!</div>
</div>
<div name="messageSignatureSection" style="font-size:14px;font-family:-apple-system,BlinkMacSystemFont,sans-serif"><br>
Best wishes,
<div>—</div><span class="gmail-HOEnZb"><font color="#888888">
<div>Suoqing Ji</div>
<div>Ph.D Candidate</div>
<div>Department of Physics</div>
<div>University of California, Santa Barbara</div>
<div><a href="http://physics.ucsb.edu/~suoqing" target="_blank">http://physics.ucsb.edu/~<wbr>suoqing</a></div>
</font></span></div>
</div>
</blockquote></div><br></div></div>