<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-4">
</head>
<body>
<div dir="auto">Hi Erik,</div>
<div dir="auto"><br>
</div>
<div dir="auto">Thanks for your quick response!</div>
<div dir="auto"><br>
</div>
<div dir="auto">I use the none bc type for now, rather than the more complicated radiative bc. I use a stencil that leans over as you approach the boundary. Currently this is a 4th order interior 3rd order sbp fd operator of Strand.</div>
<div dir="auto"><br>
</div>
<div dir="auto">By looking at the output on the boundary in both codes, there are round off level numbers appearing after the first Euler step in multiple variables. There is no use comparing these exactly as they're so small but note that the same variables
have these in both codes. These come from taking spatial derivatives.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Sorry, the lapse is initially one.</div>
<div dir="auto"><br>
</div>
<div dir="auto">I have compared output by saving the data in both codes. It seems like, since the first few time steps everything is round off errors, it is hard to see exactly where things start to go wrong.</div>
<div dir="auto"><br>
</div>
<div dir="auto">I will try your small grid and see if that yields anything more obvious.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Thanks,</div>
<div dir="auto"><br>
</div>
<div dir="auto">Chris </div>
<div dir="auto"><br>
</div>
<div dir="auto"><br>
</div>
<div><br>
</div>
<div id="ms-outlook-mobile-signature" dir="auto">
<div style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);" dir="auto">
<div style="font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif; line-height: 1.5; color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);" dir="auto">
</div>
<br>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Erik Schnetter <schnetter@gmail.com><br>
<b>Sent:</b> Saturday, May 14, 2022 3:09:17 PM<br>
<b>To:</b> Chris Stevens <chris.stevens@canterbury.ac.nz><br>
<b>Cc:</b> Einstein Toolkit Users <users@einsteintoolkit.org><br>
<b>Subject:</b> Re: [Users] Implementing a simple 1+1 BSSN in Python</font>
<div> </div>
</div>
<div>
<div dir="ltr">Chris
<div><br>
</div>
<div>What do you mean by "Boundary conditions are not applied"? What do you do at the boundaries? Are you using one-sided differencing there?</div>
<div><br>
</div>
<div>Given your description, I assume that all derivatives would be identically zero, that there would not even be a floating-point round-off error. Is that so? If not, why not?</div>
<div><br>
</div>
<div>Are you really setting the lapse to zero initially? It should be one for Minkowski, same as e.g. g_xx.</div>
<div><br>
</div>
<div>What happens if you choose a very small grid size (e.g. just 10 points) and compare the initial conditions between the Einstein Toolkit and the Python code? Are they identical? You would need to compare ASCII output and compare all the digits.</div>
<div><br>
</div>
<div>What happens if you take a single Euler time step? Are the values still all identical? Try to find out and which iteration the first grid point differs between the two codes.</div>
<div><br>
</div>
<div>-erik</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Fri, May 13, 2022 at 9:59 PM Chris Stevens <<a href="mailto:chris.stevens@canterbury.ac.nz">chris.stevens@canterbury.ac.nz</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-style:solid; border-left-color:rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Hi all,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
I've been having trouble implementing the BSSN equations, as given by CTGamma, in Python using the package COFFEE, which I am very familiar with:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<a href="https://gitlab.com/thebarista/coffee" id="x_gmail-m_5984039251753474632LPNoLPOWALinkPreview" target="_blank">https://gitlab.com/thebarista/coffee</a><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<a href="https://doi.org/10.1016/j.softx.2019.100283" rel="noreferrer noopener" title="Persistent link using digital object identifier" id="x_gmail-m_5984039251753474632LPNoLPOWALinkPreview_1" target="_blank" style="box-sizing:border-box; margin:0px; text-decoration:underline; color:rgb(255,108,0); word-break:break-word; font-family:NexusSans,Arial,Helvetica,"Lucida Sans Unicode","Microsoft Sans Serif","Segoe UI Symbol",STIXGeneral,"Cambria Math","Arial Unicode MS",sans-serif; font-size:14px">https://doi.org/10.1016/j.softx.2019.100283</a><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
The main comments are:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
-- For simplicity, I am starting with a 1+1 code (set 2/3 spatial derivatives to be exactly zero).</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
-- The 1+log slicing for the lapse and a zero shift.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
-- The "phi" conformal factor type </div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
-- <span style="color:rgb(0,0,0); background-color:rgb(255,255,255); display:inline">The evolution equations are written to Python by a very slight modification of the .m file in CTGEvolution. I've confirmed this .m file outputs the same file that is in the
src directory.</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<span style="color:rgb(0,0,0); background-color:rgb(255,255,255); display:inline">-- The vanishing of the trace of A is enforced after each full timestep in the same way as CTGamma.</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<span style="color:rgb(0,0,0); background-color:rgb(255,255,255); display:inline">-- Boundary conditions are not applied.</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<span style="color:rgb(0,0,0); background-color:rgb(255,255,255); display:inline">-- Fourth order SBP operators that lean over toward the boundaries are used.</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<span style="color:rgb(0,0,0); background-color:rgb(255,255,255); display:inline">-- Minkowski initial data with all fields zero except \gamma11/22/33.</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<span style="color:rgb(0,0,0); background-color:rgb(255,255,255); display:inline">-- Euler step is used for time integration to easier compare between Python and the Einstein toolkit.</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<span style="color:rgb(0,0,0); background-color:rgb(255,255,255); display:inline"><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<span style="color:rgb(0,0,0); background-color:rgb(255,255,255); display:inline">This leads to a stable evolution in the Einstein toolkit with the attached .par file using a simple one patch Cartesian grid. However, in Python, I get that fields diverge, starting
at the boundaries and then propagating inward (including with RK4). This behaviour does not go away with higher resolution or reduced CFL. It is however, fixed completely by setting the second spatial derivative of \alpha to be exactly zero. Trying many different
SBP FD operators that have proved successful for other projects has not changed the behaviour. </span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<span style="color:rgb(0,0,0); background-color:rgb(255,255,255); display:inline"><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
The COFFEE code has been used and tested in a variety of projects and so there should not be a problem here. Thus, the only thing I can think of, is that the Einstein toolkit is doing something that I am not realizing, that is helping it remain stable. Hopefully,
somebody on this mailing list might have an idea?<br>
<br>
Thanks in advance,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
Chris</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<div></div>
<br>
</div>
<div>
<div id="x_gmail-m_5984039251753474632Signature">
<div>
<div></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<table width="614">
<colgroup><col width="35"><col width="196"><col width="377"></colgroup>
<tbody>
<tr valign="top">
</tr>
</tbody>
</table>
<table width="614">
<tbody>
<tr valign="top">
<td width="35" height="252" style="background-color:rgb(204,0,17)">
<div style="margin-bottom:9.44882px; line-height:115%; background-color:transparent; margin-top:16px">
<img width="34" height="223" src="cid:180c08545639cddf49f1" style="width:34px; height:223px; max-width:100%"><br>
</div>
</td>
<td width="196" style="background-color:rgb(204,0,17)">
<p style="margin-bottom:0.03cm; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:0.03cm">
</p>
<p style="margin-bottom:0.03cm; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:0.03cm">
</p>
<div style="text-align:center; margin-bottom:1.13386px; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:1.13386px">
<br>
</div>
<div style="text-align:center; margin-bottom:1.13386px; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:1.13386px">
<br>
</div>
<div style="text-align:center; margin-bottom:1.13386px; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:1.13386px">
<img width="133" height="101" src="cid:180c085456481d7e37e2" style="width:133px; height:101px; max-width:100%"><br>
</div>
<p style="margin-bottom:0.25cm; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:0.03cm">
<br>
</p>
</td>
<td width="377" style="background-color:rgb(231,230,230)">
<p style="margin-bottom:0.03cm; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:0.03cm">
<br>
</p>
<p style="margin-bottom:0.03cm; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:0.03cm">
<font face="Helvetica, serif"><span style="font-size:12px"><b>Dr Chris Stevens</b></span></font></p>
<p style="margin-bottom:0.03cm; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:0.03cm">
<font face="Helvetica, serif"><font size="2" style="font-size:9pt"><b>Lecturer in Applied Mathematics</b></font></font></p>
<p style="margin-bottom:0.03cm; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:0.03cm">
<font face="Helvetica, serif"><span style="font-size:12px">Rm 602, Jack Erskine building</span></font></p>
<p style="margin-bottom:0.03cm; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:0.03cm">
<font face="Helvetica, serif"><font size="2" style="font-size:9pt">School of Mathematics and Statistics</font></font></p>
<p style="margin-bottom:0.03cm; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:0.03cm">
<font face="Helvetica, serif"><font size="2" style="font-size:9pt">T: +64 3 369 0396 (Internal 90396)</font></font></p>
<p style="margin-bottom:0.03cm; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:0.03cm">
<font face="Helvetica, serif"><font size="2" style="font-size:9pt">University of Canterbury | Te Whare Wànanga o Waitaha</font></font></p>
<p style="margin-bottom:0.03cm; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:0.03cm">
<font face="Helvetica, serif"><font size="2" style="font-size:9pt">Private Bag 4800, Christchurch 8140, New Zealand</font></font></p>
<p align="left" style="margin-bottom:0.03cm; line-height:115%; background-color:transparent; margin-right:0.03cm; margin-top:0.03cm">
<font face="Helvetica, serif"><font size="2" style="font-size:9pt"><a href="http://www.chrisdoesmaths.com/" target="_blank">http://www.chrisdoesmaths.com</a><br>
<br>
</font></font></p>
<p style="margin-bottom:0cm; line-height:115%; background-color:transparent"><span style="font-size:9pt; font-family:Helvetica,sans-serif; background-color:transparent; color:rgb(0,0,0)"><b>Director</b><br>
</span><span style="background-color:transparent; font-family:Helvetica,sans-serif; font-size:9pt">SCRI Ltd<br>
</span><a href="http://www.scri.co.nz/" target="_blank" style="background-color:transparent"><font face="Helvetica, sans-serif"><font style="font-size:9pt">http://www.scri.co.nz</font></font></a></p>
</td>
</tr>
</tbody>
</table>
<br>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@einsteintoolkit.org" target="_blank">Users@einsteintoolkit.org</a><br>
<a href="http://lists.einsteintoolkit.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.einsteintoolkit.org/mailman/listinfo/users</a><br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>Erik Schnetter <<a href="mailto:schnetter@gmail.com" target="_blank">schnetter@gmail.com</a>></div>
<div><a href="http://www.perimeterinstitute.ca/personal/eschnetter/" target="_blank">http://www.perimeterinstitute.ca/personal/eschnetter/</a><br>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>