<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Arnold,<br>
    <br>
    I looked into this issue some when I was trying to calculate the
    curvature of some of my temperature isosurfaces.  Aleks Obabko
    suggested that I tried smoothing the derivatives across the element
    boundaries.   So basically, I tried doing this:<br>
    <br>
    ! Calculate the gradient of the temperature field<br>
    !        This derivative will be continuous within the element, but
    there will be jumps across the element boundaries<br>
    call gradm1(dTdx, dTdy, dTdz, t)  <br>
    <br>
    ! Smooth the derivative (dT/dx) so that it is continuous across the
    element boundaries.<br>
    call col2(dTdx,bm1,n)                    ! collocate with the mass
    matrix<br>
    call dssum(dTdx,nx1,ny1,nz1)       ! smooth<br>
    call col2(dTdx,bintm1,n)                ! collocate with the inverse
    mass matrix<br>
    <br>
    (Note: dssum just returns the sum of the shared GLL points across
    the element boundaries.)<br>
    <br>
    I ran a test case, and I found that, in that case, this procedure
    does generate good first and second derivatives.   The test case was
    basically just an artificial sphere that I set up in Nek5000.  The
    temperature varied with the radius of the sphere, and my goal was to
    calculate smooth first and second derivatives of the temperature so
    that I could accurately calculate the curvature of the sphere.   I
    looked at some comparisons between the calculated first and second
    derivatives and the analytical solution.  Generally, the accuracy
    was good given the pretty low resolution that I was using.  
    (However, in order to find the curvature, I needed to multiply,
    raise to powers, and divide the derivatives, so that ultimately the
    relatively small derivative errors were magnified into unacceptably
    large curvature errors.)  <br>
    <br>
    So, ultimately, I think that this smoothing procedure should
    definitely work well enough for most (but not all) purposes.   If
    you just want smooth derivatives for visualization, or you just want
    to measure just the derivative itself, this will probably work.<br>
    <br>
    In your case of looking at the derivatives of the vorticity, you
    could try doing this two ways and see which one works better.<br>
    <br>
    1) Calculate the vorticity, smooth the vorticity, take the
    derivative, then smooth the derivative <br>
    <br>
    2) Calculate the vorticity, take the derivative, smooth the
    derivative<br>
    <br>
    The first option has more smoothing steps, but the second option
    preserves the representation of the vorticity within the element as
    you take the derivative.   Aleks generally recommends the second
    option.   <br>
    <br>
    What do you need the derivatives of the vorticity for exactly?  
    Depending on your end goal, one of the methods Paul suggested may
    work better than this one.<br>
    <br>
    Elizabeth<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 03/03/2017 06:32 AM,
      <a class="moz-txt-link-abbreviated" href="mailto:nek5000-users@lists.mcs.anl.gov">nek5000-users@lists.mcs.anl.gov</a> wrote:<br>
    </div>
    <blockquote
      cite="mid:mailman.1538.1488544332.2967.nek5000-users@lists.mcs.anl.gov"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <style type="text/css" id="owaParaStyle"></style>
      <div style="direction: ltr;font-family: Tahoma;color:
        #000000;font-size: 10pt;">
        <div><br>
        </div>
        Hi Arnold,
        <div><br>
        </div>
        <div>The velocity is only in C^0, which means it is continuous.
           The first derivative</div>
        <div>is defined everywhere, but is discontinuous, meaning that
          the vorticity is</div>
        <div>discontinuous.</div>
        <div><br>
        </div>
        <div>The derivative of the vorticity involves the second
          derivative of velocity, and this</div>
        <div>is not defined.</div>
        <div><br>
        </div>
        <div>All that being said, the vorticity will converge to a
          continuous function exponentially</div>
        <div>fast with increasing polynomial order.   So if you want to
          differentiate the vorticity</div>
        <div>you have the option of increasing the polynomial order.   </div>
        <div><br>
        </div>
        <div>Alternatively, you can try to regularize the vorticity
          prior to differentiating it.</div>
        <div>A common strategy is to call dsavg( . ) for each component
          of vorticity -- which</div>
        <div>makes it continuous, but this wouldn't necessarily make the
          derivatives better.</div>
        <div>Other alternatives would be to use a combination of dsavg()
          and some type of</div>
        <div>low-pass filtering, e.g., by solving a Helmholtz problem of
          the form  (I-L^2 \nabla^2) vbar = v,</div>
        <div>where L is the filter length.   Another option is to look
          at the context in which</div>
        <div>you want to use your differentiated vorticity.   Perhaps
          this can be recast in a weak</div>
        <div>form, in which one of the derivatives is moved onto the
          (continuous and differentiable)</div>
        <div>test functions, etc.</div>
        <div><br>
        </div>
        <div>hth,</div>
        <div><br>
        </div>
        <div>Paul</div>
        <div><br>
          <div style="font-family: Times New Roman; color: #000000;
            font-size: 16px">
            <hr tabindex="-1">
            <div id="divRpF849118" style="direction: ltr;"><font
                color="#000000" face="Tahoma" size="2"><b>From:</b>
                <a class="moz-txt-link-abbreviated" href="mailto:nek5000-users-bounces@lists.mcs.anl.gov">nek5000-users-bounces@lists.mcs.anl.gov</a>
                [<a class="moz-txt-link-abbreviated" href="mailto:nek5000-users-bounces@lists.mcs.anl.gov">nek5000-users-bounces@lists.mcs.anl.gov</a>] on behalf of
                <a class="moz-txt-link-abbreviated" href="mailto:nek5000-users@lists.mcs.anl.gov">nek5000-users@lists.mcs.anl.gov</a>
                [<a class="moz-txt-link-abbreviated" href="mailto:nek5000-users@lists.mcs.anl.gov">nek5000-users@lists.mcs.anl.gov</a>]<br>
                <b>Sent:</b> Friday, March 03, 2017 6:02 AM<br>
                <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:nek5000-users@lists.mcs.anl.gov">nek5000-users@lists.mcs.anl.gov</a><br>
                <b>Subject:</b> [Nek5000-users] Problem with Spatial
                Derivatives of field<br>
              </font><br>
            </div>
            <div>
              <p>Hi Neks,</p>
              <p>I'm having some problems with computing the gradients
                of vorticity. <br>
              </p>
              <p>So what I do in the usercheck is something like : <br>
              </p>
              <p><br>
              </p>
              <p><br>
              </p>
              <p>call call comp_vort3(vort,work1,work2,vxp,vyp,vzp)   !
                Computing vorticity of perturbations  
                <br>
              </p>
              <p>call gradm1(derivvortx,derivvorty,derivvortz,vort(1,1))
                <br>
              </p>
              <p><br>
              </p>
              <p><br>
              </p>
              <p>However, by doing this I do observe some abnormal
                results when I plot the fields : derivvortx, derivvorty,
                derivvortz.</p>
              <p>Attached you will find a snapshot of the magnitude of
                derivvortx and derivvorty (obtained using paraview)</p>
              <p>I am wondering why I am having extremely high values a
                the boudary of the elements. Has anyone noticed or faced
                such a problem?
                <br>
              </p>
              <p><br>
              </p>
              <p>Even when I increase lx1, reduce dt and reduce the mesh
                size, the problem remains..</p>
              <p><br>
              </p>
              <p>Thank you for your time,</p>
              <p>Best wishes,</p>
              <p><br>
              </p>
              <p>Arnold<br>
              </p>
              <p><br>
              </p>
              <p><br>
              </p>
              <p><br>
              </p>
              <div class="moz-signature">-- <br>
                <style type="text/css">
<!--
p
        {color:#000000}
-->
</style>
                <p><img src="cid:part1.03050907.09020004@columbia.edu"
                    name="Image1" align="left" border="0" height="35"
                    width="70"><strong><font color="#0668b3"><font
                        face="Arial, Helvetica, sans-serif"><font
                          style="font-size:9pt" size="2">Arnold Wakim</font></font></font></strong><font
                    color="#0668b3"><font face="Arial, Helvetica,
                      sans-serif"><font style="font-size:9pt" size="2"><br>
                        Doctorant,<br>
                        Département d´</font></font></font><font
                    color="#0668b3"><font face="Arial, Helvetica,
                      sans-serif"><font style="font-size:9pt" size="2">A</font></font></font><font
                    color="#0668b3"><font face="Arial, Helvetica,
                      sans-serif"><font style="font-size:9pt" size="2">érodynamique
                      </font></font></font><font color="#0668b3"><font
                      face="Arial, Helvetica, sans-serif"><font
                        style="font-size:9pt" size="2">F</font></font></font><font
                    color="#0668b3"><font face="Arial, Helvetica,
                      sans-serif"><font style="font-size:9pt" size="2">ondamentale

                        et </font></font></font><font color="#0668b3"><font
                      face="Arial, Helvetica, sans-serif"><font
                        style="font-size:9pt" size="2">E</font></font></font><font
                    color="#0668b3"><font face="Arial, Helvetica,
                      sans-serif"><font style="font-size:9pt" size="2">xpérimentale<br>
                        Tél: +33 1 46 23 51 83</font></font></font></p>
                <p class="paraph"><font color="#000000"><span
                      style="text-decoration:none"><font face="Arial,
                        Helvetica, sans-serif"><font
                          style="font-size:8pt" size="1"><span
                            style="font-weight:normal"><br>
                            ONERA - The French Aerospace Lab -Centre de
                            Meudon<br>
                            8, rue des Vertugadins - 92190 MEUDON<br>
                            <br>
                            Nous suivre sur : </span></font></font></span></font><a
                    moz-do-not-send="true" href="http://www.onera.fr/"
                    target="_blank"><font color="#0668b3"><span
                        style="text-decoration:none"><font face="Arial,
                          Helvetica, sans-serif"><font
                            style="font-size:8pt" size="1"><span
                              style="font-weight:normal">www.onera.fr</span></font></font></span></font></a><font
                    color="#000000"><span style="text-decoration:none"><font
                        face="Arial, Helvetica, sans-serif"><font
                          style="font-size:8pt" size="1"><span
                            style="font-weight:normal"> | </span></font></font></span></font><a
                    moz-do-not-send="true"
                    href="http://www.twitter.com/@onera_fr"
                    target="_blank"><font color="#0668b3"><span
                        style="text-decoration:none"><font face="Arial,
                          Helvetica, sans-serif"><font
                            style="font-size:8pt" size="1"><span
                              style="font-weight:normal">Twitter</span></font></font></span></font></a><font
                    color="#000000"><span style="text-decoration:none"><font
                        face="Arial, Helvetica, sans-serif"><font
                          style="font-size:8pt" size="1"><span
                            style="font-weight:normal"> | </span></font></font></span></font><a
                    moz-do-not-send="true"
                    href="http://www.linkedin.com/company/onera"
                    target="_blank"><font color="#0668b3"><span
                        style="text-decoration:none"><font face="Arial,
                          Helvetica, sans-serif"><font
                            style="font-size:8pt" size="1"><span
                              style="font-weight:normal"> LinkedIn</span></font></font></span></font></a><font
                    color="#000000"><span style="text-decoration:none"><font
                        face="Arial, Helvetica, sans-serif"><font
                          style="font-size:8pt" size="1"><span
                            style="font-weight:normal"> | </span></font></font></span></font><a
                    moz-do-not-send="true"
                    href="http://www.facebook.fr/thefrenchaerospacelab"
                    target="_blank"><font color="#0668b3"><span
                        style="text-decoration:none"><font face="Arial,
                          Helvetica, sans-serif"><font
                            style="font-size:8pt" size="1"><span
                              style="font-weight:normal">Facebook</span></font></font></span></font></a></p>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Nek5000-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nek5000-users@lists.mcs.anl.gov">Nek5000-users@lists.mcs.anl.gov</a>
<a class="moz-txt-link-freetext" href="https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users">https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>