Skip to content

Commit

Permalink
Interface builder fix
Browse files Browse the repository at this point in the history
  • Loading branch information
knc6 committed Jul 26, 2020
1 parent 8fe7c3b commit 7f2cb18
Show file tree
Hide file tree
Showing 52 changed files with 943 additions and 386 deletions.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/jarvis.analysis.defects.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/jarvis.analysis.interface.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/jarvis.core.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/jarvis.io.boltztrap.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/jarvis.io.lammps.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/jarvis.io.qe.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/jarvis.io.vasp.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/jarvis.io.wannier.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/jarvis.io.wanniertools.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/jarvis.tasks.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/jarvis.tasks.lammps.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/jarvis.tasks.vasp.doctree
Binary file not shown.
47 changes: 38 additions & 9 deletions docs/build/html/_modules/jarvis/analysis/defects/surface.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ <h1>Source code for jarvis.analysis.defects.surface</h1><div class="highlight"><
<span class="kn">from</span> <span class="nn">jarvis.analysis.structure.spacegroup</span> <span class="kn">import</span> <span class="n">Spacegroup3D</span>
<span class="kn">from</span> <span class="nn">numpy.linalg</span> <span class="kn">import</span> <span class="n">norm</span>
<span class="kn">from</span> <span class="nn">numpy</span> <span class="kn">import</span> <span class="n">gcd</span>
<span class="kn">from</span> <span class="nn">collections</span> <span class="kn">import</span> <span class="n">OrderedDict</span>


<div class="viewcode-block" id="wulff_normals"><a class="viewcode-back" href="../../../../jarvis.analysis.defects.html#jarvis.analysis.defects.surface.wulff_normals">[docs]</a><span class="k">def</span> <span class="nf">wulff_normals</span><span class="p">(</span><span class="n">miller_indices</span><span class="o">=</span><span class="p">[],</span> <span class="n">surface_energies</span><span class="o">=</span><span class="p">[]):</span>
Expand Down Expand Up @@ -95,14 +96,38 @@ <h1>Source code for jarvis.analysis.defects.surface</h1><div class="highlight"><
<span class="sd"> from_conventional_structure: whether to use the conv. atoms</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">indices</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">indices</span><span class="p">)</span>
<span class="k">if</span> <span class="n">from_conventional_structure</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">from_conventional_structure</span> <span class="o">=</span> <span class="n">from_conventional_structure</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">from_conventional_structure</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">atoms</span> <span class="o">=</span> <span class="n">Spacegroup3D</span><span class="p">(</span><span class="n">atoms</span><span class="p">)</span><span class="o">.</span><span class="n">conventional_standard_structure</span>
<span class="k">else</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">atoms</span> <span class="o">=</span> <span class="n">atoms</span>
<span class="bp">self</span><span class="o">.</span><span class="n">tol</span> <span class="o">=</span> <span class="n">tol</span>
<span class="bp">self</span><span class="o">.</span><span class="n">vacuum</span> <span class="o">=</span> <span class="n">vacuum</span>
<span class="bp">self</span><span class="o">.</span><span class="n">layers</span> <span class="o">=</span> <span class="n">layers</span>

<div class="viewcode-block" id="Surface.to_dict"><a class="viewcode-back" href="../../../../jarvis.analysis.defects.html#jarvis.analysis.defects.surface.Surface.to_dict">[docs]</a> <span class="k">def</span> <span class="nf">to_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Convert to a dictionary.&quot;&quot;&quot;</span>
<span class="n">d</span> <span class="o">=</span> <span class="n">OrderedDict</span><span class="p">()</span>
<span class="n">d</span><span class="p">[</span><span class="s2">&quot;atoms&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">atoms</span><span class="o">.</span><span class="n">to_dict</span><span class="p">()</span>
<span class="n">d</span><span class="p">[</span><span class="s2">&quot;indices&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">indices</span>
<span class="n">d</span><span class="p">[</span><span class="s2">&quot;tol&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">tol</span>
<span class="n">d</span><span class="p">[</span><span class="s2">&quot;vacuum&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">vacuum</span>
<span class="n">d</span><span class="p">[</span><span class="s2">&quot;layers&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">layers</span>
<span class="n">d</span><span class="p">[</span><span class="s2">&quot;from_conventional_structure&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">from_conventional_structure</span>
<span class="k">return</span> <span class="n">d</span></div>

<div class="viewcode-block" id="Surface.from_dict"><a class="viewcode-back" href="../../../../jarvis.analysis.defects.html#jarvis.analysis.defects.surface.Surface.from_dict">[docs]</a> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">from_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">d</span><span class="o">=</span><span class="p">{}):</span>
<span class="sd">&quot;&quot;&quot;Construct class from a dictionary.&quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">Surface</span><span class="p">(</span>
<span class="n">atoms</span><span class="o">=</span><span class="n">Atoms</span><span class="o">.</span><span class="n">from_dict</span><span class="p">(</span><span class="n">d</span><span class="p">[</span><span class="s2">&quot;atoms&quot;</span><span class="p">]),</span>
<span class="n">indices</span><span class="o">=</span><span class="n">d</span><span class="p">[</span><span class="s2">&quot;indices&quot;</span><span class="p">],</span>
<span class="n">tol</span><span class="o">=</span><span class="n">d</span><span class="p">[</span><span class="s2">&quot;tol&quot;</span><span class="p">],</span>
<span class="n">vacuum</span><span class="o">=</span><span class="n">d</span><span class="p">[</span><span class="s2">&quot;vacuum&quot;</span><span class="p">],</span>
<span class="n">layers</span><span class="o">=</span><span class="n">d</span><span class="p">[</span><span class="s2">&quot;layers&quot;</span><span class="p">],</span>
<span class="n">from_conventional_structure</span><span class="o">=</span><span class="n">d</span><span class="p">[</span><span class="s2">&quot;from_conventional_structure&quot;</span><span class="p">],</span>
<span class="p">)</span></div>

<div class="viewcode-block" id="Surface.make_surface"><a class="viewcode-back" href="../../../../jarvis.analysis.defects.html#jarvis.analysis.defects.surface.Surface.make_surface">[docs]</a> <span class="k">def</span> <span class="nf">make_surface</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Generate specified surface. Modified from ase package.&quot;&quot;&quot;</span>
<span class="n">atoms</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">atoms</span>
Expand All @@ -121,12 +146,16 @@ <h1>Source code for jarvis.analysis.defects.surface</h1><div class="highlight"><

<span class="c1"># constants describing the dot product of basis c1 and c2:</span>
<span class="c1"># dot(c1,c2) = k1+i*k2, i in Z</span>
<span class="n">k1</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">p</span> <span class="o">*</span> <span class="p">(</span><span class="n">k_index</span> <span class="o">*</span> <span class="n">a1</span> <span class="o">-</span> <span class="n">h_index</span> <span class="o">*</span> <span class="n">a2</span><span class="p">)</span>
<span class="o">+</span> <span class="n">q</span> <span class="o">*</span> <span class="p">(</span><span class="n">l_index</span> <span class="o">*</span> <span class="n">a1</span> <span class="o">-</span> <span class="n">h_index</span> <span class="o">*</span> <span class="n">a3</span><span class="p">),</span>
<span class="n">l_index</span> <span class="o">*</span> <span class="n">a2</span> <span class="o">-</span> <span class="n">k_index</span> <span class="o">*</span> <span class="n">a3</span><span class="p">)</span>
<span class="n">k2</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="n">l_index</span> <span class="o">*</span> <span class="p">(</span><span class="n">k_index</span> <span class="o">*</span> <span class="n">a1</span> <span class="o">-</span> <span class="n">h_index</span> <span class="o">*</span> <span class="n">a2</span><span class="p">)</span>
<span class="o">-</span> <span class="n">k_index</span> <span class="o">*</span> <span class="p">(</span><span class="n">l_index</span> <span class="o">*</span> <span class="n">a1</span> <span class="o">-</span> <span class="n">h_index</span> <span class="o">*</span> <span class="n">a3</span><span class="p">),</span>
<span class="n">l_index</span> <span class="o">*</span> <span class="n">a2</span> <span class="o">-</span> <span class="n">k_index</span> <span class="o">*</span> <span class="n">a3</span><span class="p">)</span>
<span class="n">k1</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span>
<span class="n">p</span> <span class="o">*</span> <span class="p">(</span><span class="n">k_index</span> <span class="o">*</span> <span class="n">a1</span> <span class="o">-</span> <span class="n">h_index</span> <span class="o">*</span> <span class="n">a2</span><span class="p">)</span>
<span class="o">+</span> <span class="n">q</span> <span class="o">*</span> <span class="p">(</span><span class="n">l_index</span> <span class="o">*</span> <span class="n">a1</span> <span class="o">-</span> <span class="n">h_index</span> <span class="o">*</span> <span class="n">a3</span><span class="p">),</span>
<span class="n">l_index</span> <span class="o">*</span> <span class="n">a2</span> <span class="o">-</span> <span class="n">k_index</span> <span class="o">*</span> <span class="n">a3</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">k2</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span>
<span class="n">l_index</span> <span class="o">*</span> <span class="p">(</span><span class="n">k_index</span> <span class="o">*</span> <span class="n">a1</span> <span class="o">-</span> <span class="n">h_index</span> <span class="o">*</span> <span class="n">a2</span><span class="p">)</span>
<span class="o">-</span> <span class="n">k_index</span> <span class="o">*</span> <span class="p">(</span><span class="n">l_index</span> <span class="o">*</span> <span class="n">a1</span> <span class="o">-</span> <span class="n">h_index</span> <span class="o">*</span> <span class="n">a3</span><span class="p">),</span>
<span class="n">l_index</span> <span class="o">*</span> <span class="n">a2</span> <span class="o">-</span> <span class="n">k_index</span> <span class="o">*</span> <span class="n">a3</span><span class="p">,</span>
<span class="p">)</span>

<span class="k">if</span> <span class="nb">abs</span><span class="p">(</span><span class="n">k2</span><span class="p">)</span> <span class="o">&gt;</span> <span class="bp">self</span><span class="o">.</span><span class="n">tol</span><span class="p">:</span>
<span class="n">i</span> <span class="o">=</span> <span class="o">-</span><span class="nb">int</span><span class="p">(</span><span class="nb">round</span><span class="p">(</span><span class="n">k1</span> <span class="o">/</span> <span class="n">k2</span><span class="p">))</span>
Expand Down Expand Up @@ -154,7 +183,7 @@ <h1>Source code for jarvis.analysis.defects.surface</h1><div class="highlight"><
<span class="n">cartesian</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="p">)</span>

<span class="n">surf_atoms</span> <span class="o">=</span> <span class="n">new_atoms</span><span class="o">.</span><span class="n">make_supercell</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">layers</span><span class="p">])</span>
<span class="n">surf_atoms</span> <span class="o">=</span> <span class="n">new_atoms</span><span class="o">.</span><span class="n">make_supercell_matrix</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">layers</span><span class="p">])</span>
<span class="c1"># print(&quot;supercell_cart_coords&quot;, surf_atoms.frac_coords)</span>

<span class="n">new_lat</span> <span class="o">=</span> <span class="n">surf_atoms</span><span class="o">.</span><span class="n">lattice_mat</span> <span class="c1"># lat_lengths()</span>
Expand Down Expand Up @@ -202,7 +231,7 @@ <h1>Source code for jarvis.analysis.defects.surface</h1><div class="highlight"><
<span class="n">elements</span><span class="o">=</span><span class="n">surf_atoms</span><span class="o">.</span><span class="n">elements</span><span class="p">,</span>
<span class="n">coords</span><span class="o">=</span><span class="n">new_coords</span><span class="p">,</span>
<span class="n">cartesian</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="p">)</span>
<span class="p">)</span><span class="o">.</span><span class="n">center_around_origin</span><span class="p">()</span>

<span class="n">frac_coords</span> <span class="o">=</span> <span class="n">new_atoms</span><span class="o">.</span><span class="n">frac_coords</span>

Expand Down
Loading

0 comments on commit 7f2cb18

Please sign in to comment.