<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi, </p>
<p><br>
</p>
<p>I implemented a PETSc code to solve Maxwell's equations for the magnetic and electric fields (B and E) in a cylinder: </p>
<p>0 < r_min <= r <= r_max; with <span style="font-size: 12pt;">r_max</span><span style="font-size: 12pt;"> > r_min</span></p>
<p>phi_min = 0 <span style="font-size: 12pt;"><= r <= phi_max</span><span style="font-size: 12pt;"> = 2 </span><span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">ð</span></p>
<p><span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">z_min <= z =< z_max; </span><span style="font-size: 12pt;">with </span><span style="font-size: 12pt;">z_max</span><span style="font-size: 12pt;"> >
z_min.</span></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><font size="3">I am using a PETSc staggered grid with the electric field E defined on edge centers and the magnetic field B </font>defined<font size="3"> on face centers. (</font><span style="font-size: 12pt;">dof0 = 0, dof1 = 1,dof2 = 1, dof3 = 0;</span><font size="3">). </font><font size="3"> </font></p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;"><br>
</span></p>
<p><span style="font-size: 12pt;"></span><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">I have two versions of my code: </span></p>
<p><font face="Calibri, Helvetica, sans-serif" size="3">1 - A first version </font>
<font face="Calibri, Helvetica, sans-serif">in which I set the boundary type to DM_BOUNDARY_NONE in the three directions r, phi and z</font></p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">2- A second version in which I set </span><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;">the boundary type to DM_BOUNDARY_NONE in
the r and z directions</span><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;">, </span><font face="Calibri, Helvetica, sans-serif" size="3">and DM_BOUNDARY_PERIODIC in the phi di</font><font face="Calibri, Helvetica, sans-serif">rection.</font><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;"> </span></p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;"><br>
</span></p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">When I print the solution vector X, which contains both E and B components, I notice that the vector is shorter with the second version compared to the first one. </span></p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">Is it normal? </span></p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;"><br>
</span></p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">Besides, I was wondering if I have to change the way I define the value of the solution on the boundary. What I am doing so far in both versions is something like:</span></p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">B_phi [phi = 0] = 1.0;</span></p>
<p><span style="font-family: Calibri, Helvetica, sans-serif;">B_phi </span><span style="font-family: Calibri, Helvetica, sans-serif;">[phi = 2</span><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">ð</span><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">]
= 1.0;</span></p>
<p><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;">E_z [r, phi = 0</span><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;">] = 1/r;</span><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;"><br>
</span></p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">E_z [r, phi = 2</span><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">ð</span><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">]
= 1/r;</span></p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;"><br>
</span></p>
<p><font face="Calibri, Helvetica, sans-serif">Assuming that values at phi = 0 should be the same as at phi=2</font><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">ð with the periodic boundary conditions, </span><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">is
it sufficient for example </span><font face="Calibri, Helvetica, sans-serif" size="3">to </font><font face="Calibri, Helvetica, sans-serif">have</font><font face="Calibri, Helvetica, sans-serif" size="3"> only the following boundary conditions</font><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">:</span></p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">B_phi [phi = 0] = 1.0;</span></p>
<p><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;"></span></p>
<p><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;">E_z [r, phi = 0</span><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;">] = 1/r ? </span><span style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;"><br>
</span></p>
<div><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;"><br>
</span></div>
<div><span style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;">Thank you.</span></div>
<div><font face="Calibri, Helvetica, sans-serif">Best regards,</font></div>
<div><font face="Calibri, Helvetica, sans-serif"><br>
</font></div>
<div><font face="Calibri, Helvetica, sans-serif">Zakariae Jorti</font></div>
</div>
</body>
</html>