<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><tt>I think the code does what you ask for</tt></p>
    <p><tt>it set the dipole double layer stating al 95% (emaxpos =
        0.95) of you cell extending for 5% up to 100% (eopreg = 0.05 )</tt></p>
    <p><tt>the slope from 95% to 100$% is just the internal potential
        drop in the double layer...</tt></p>
    <p><tt>stefano</tt><br>
    </p>
    <div class="moz-cite-prefix">On 01/05/20 16:57, Pacome NGUIMEYA
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAAn30EAentGqgfB9rhj1i2XOT-EsMauocEe87fO0wc0446s2dg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div class="gmail_default"
          style="font-family:monospace,monospace;font-size:small;color:#000000">Dear
          QE users,<br>
          <br>
          I generated a (1x1) surface slab ( with 20-angstroms vacuum)
          of the (001) surface using a 5-layer slab model. </div>
        <div class="gmail_default"
          style="font-family:monospace,monospace;font-size:small;color:#000000">I
          included the dipole correction to cancel the artificial field
          as my slab is asymmetric. </div>
        <div class="gmail_default"
          style="font-family:monospace,monospace;font-size:small;color:#000000"><br>
          As you can see in the picture here attached, the correction
          did not work on both sides. In fact, I got a perfectly </div>
        <div class="gmail_default"
          style="font-family:monospace,monospace;font-size:small;color:#000000">flat
          potential in the vacuum region to the left of the slab but not
          to the right.<br>
          <br>
          I tried different values for emaxpos and eopreg following the
          example on this blog <a
href="https://christoph-wolf.at/2018/05/02/dipole-correction-in-quantum-espresso/"
            moz-do-not-send="true">https://christoph-wolf.at/2018/05/02/dipole-correction-in-quantum-espresso/</a>,
          but only those in the input file below could give something
          close to the expected result.<br>
          <br>
          PS: My slab is centered at the center of the cell.<br>
          <br>
          Can you please advise how I can get this fixed?<br>
          <br>
          Thanks in advance for your help<br>
          <br>
        </div>
        <div class="gmail_default"
          style="font-family:monospace,monospace;font-size:small;color:#000000">&CONTROL<br>
                           calculation = 'scf',<br>
                                prefix = 'TaAs',<br>
                          restart_mode = 'from_scratch',<br>
                            pseudo_dir = './',<br>
                                outdir = './', <br>
                         etot_conv_thr = 1.0e-5,<br>
                            wf_collect = .true.,<br>
                             verbosity = 'high',<br>
                               tefield = .true.,<br>
                              dipfield = .true.<br>
          /<br>
          &SYSTEM<br>
                                 ibrav = 0,<br>
                                   nat = 40,<br>
                                  ntyp = 2,<br>
                               ecutwfc = 60,<br>
                               ecutrho = 480,<br>
                           occupations = 'smearing',<br>
                              smearing = 'm-p',<br>
                               degauss = 0.03,<br>
                                  eamp = 0,<br>
                                  edir = 3,<br>
                               emaxpos = 0.95,   <br>
                                eopreg = 0.05    <br>
          /<br>
          &ELECTRONS<br>
                       diagonalization = 'david',<br>
                           mixing_mode = 'local-TF',<br>
                           mixing_beta = 0.7,<br>
                              conv_thr = 1.0e-6,<br>
                      electron_maxstep = 300<br>
          /<br>
          ATOMIC_SPECIES<br>
           Ta  180.9480000000    Ta.pbe-spn-kjpaw_psl.1.0.0.UPF <br>
           As   74.9216000000    As.pbe-n-kjpaw_psl.1.0.0.UPF <br>
          CELL_PARAMETERS {angstrom}<br>
           3.469828240000000       0.000000000000000      
          0.000000000000000<br>
           0.000000000000000       3.469828240000000      
          0.000000000000000<br>
           0.000000000000000       0.000000000000000    
           76.718787642331264<br>
          ATOMIC_POSITIONS {angstrom}<br>
            As  0.0000000000000000  1.7349141199999991
           63.3017546359999841<br>
            As  0.0000000000000000  1.7349141199999991
           51.5641730759999888<br>
            As  0.0000000000000000  1.7349141199999991
           39.8265915159999935<br>
            As  0.0000000000000000  1.7349141199999991
           28.0890099560000053<br>
            As  0.0000000000000000  1.7349141199999991
           16.3514283959999887<br>
            As  0.0000000000000000  0.0000000000000000
           66.2361500259999900<br>
            As  0.0000000000000000  0.0000000000000000
           54.4985684659999947<br>
            As  0.0000000000000000  0.0000000000000000
           42.7609869059999994<br>
            As  0.0000000000000000  0.0000000000000000
           31.0234053459999899<br>
            As  0.0000000000000000  0.0000000000000000
           19.2858237859999946<br>
            As  1.7349141199999991  0.0000000000000000
           57.4329638559999935<br>
            As  1.7349141199999991  0.0000000000000000
           45.6953822959999911<br>
            As  1.7349141199999991  0.0000000000000000
           33.9578007359999958<br>
            As  1.7349141199999991  0.0000000000000000
           22.2202191759999934<br>
            As  1.7349141199999991  0.0000000000000000
           10.4826376159999981<br>
            As  1.7349141199999991  1.7349141199999991
           60.3673592459999924<br>
            As  1.7349141199999991  1.7349141199999991
           48.6297776859999971<br>
            As  1.7349141199999991  1.7349141199999991
           36.8921961259999875<br>
            As  1.7349141199999991  1.7349141199999991
           25.1546145659999922<br>
            As  1.7349141199999991  1.7349141199999991
           13.4170330059999898<br>
            Ta  1.7349141199999991  0.0000000000000000
           62.3364794036686973<br>
            Ta  1.7349141199999991  0.0000000000000000
           50.5988978436687091<br>
            Ta  1.7349141199999991  0.0000000000000000
           38.8613162836686996<br>
            Ta  1.7349141199999991  0.0000000000000000
           27.1237347236686972<br>
            Ta  1.7349141199999991  0.0000000000000000
           15.3861531636687161<br>
            Ta  1.7349141199999991  1.7349141199999991
           65.2708747936686962<br>
            Ta  1.7349141199999991  1.7349141199999991
           53.5332932336687009<br>
            Ta  1.7349141199999991  1.7349141199999991
           41.7957116736687126<br>
            Ta  1.7349141199999991  1.7349141199999991
           30.0581301136687102<br>
            Ta  1.7349141199999991  1.7349141199999991
           18.3205485536687149<br>
            Ta  0.0000000000000000  1.7349141199999991
           56.4676886236687139<br>
            Ta  0.0000000000000000  1.7349141199999991
           44.7301070636687257<br>
            Ta  0.0000000000000000  1.7349141199999991
           32.9925255036687162<br>
            Ta  0.0000000000000000  1.7349141199999991
           21.2549439436687280<br>
            Ta  0.0000000000000000  1.7349141199999991  
          9.5173623836687113<br>
            Ta  0.0000000000000000  0.0000000000000000
           59.4020840136687056<br>
            Ta  0.0000000000000000  0.0000000000000000
           47.6645024536687103<br>
            Ta  0.0000000000000000  0.0000000000000000
           35.9269208936687150<br>
            Ta  0.0000000000000000  0.0000000000000000
           24.1893393336687126<br>
            Ta  0.0000000000000000  0.0000000000000000
           12.4517577736687173<br>
          K_POINTS {automatic}<br>
           9 9 1  1 1 1<br>
        </div>
        <div class="gmail_default"
          style="font-family:monospace,monospace;font-size:small;color:#000000"><br>
        </div>
        <div class="gmail_default"
          style="font-family:monospace,monospace;font-size:small;color:#000000">
          <div class="gmail_default">Regards,<br>
            Pacome</div>
          <div class="gmail_default">
            <div style="font-size:12.8px"><font face="georgia, serif"
                color="#073763">Ph.D. Candidate</font></div>
            <div style="font-size:12.8px"><font face="georgia, serif"
                color="#073763">Computational Condensed Matter Physics</font></div>
            <div style="font-size:12.8px"><font face="georgia, serif"
                color="#073763">University of Cape Town (UCT), South
                Africa</font></div>
          </div>
        </div>
        <div class="gmail_default"
          style="font-family:monospace,monospace;font-size:small;color:#000000"><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Quantum ESPRESSO is supported by MaX (<a class="moz-txt-link-abbreviated" href="http://www.max-centre.eu/quantum-espresso">www.max-centre.eu/quantum-espresso</a>)
users mailing list <a class="moz-txt-link-abbreviated" href="mailto:users@lists.quantum-espresso.org">users@lists.quantum-espresso.org</a>
<a class="moz-txt-link-freetext" href="https://lists.quantum-espresso.org/mailman/listinfo/users">https://lists.quantum-espresso.org/mailman/listinfo/users</a></pre>
    </blockquote>
  </body>
</html>