forked from lijiext/lammps
removing searchindex.js
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15533 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
f94bbc0de0
commit
159d722cc2
|
@ -42,7 +42,9 @@ html: $(OBJECTS)
|
|||
cp -r src/* $(RSTDIR)/ ;\
|
||||
sphinx-build -j 8 -b html -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\
|
||||
deactivate ;\
|
||||
)
|
||||
)
|
||||
-rm html/searchindex.js
|
||||
-rm -rf html/_sources
|
||||
@echo "Build finished. The HTML pages are in doc/html."
|
||||
|
||||
pdf: utils/txt2html/txt2html.exe
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,50 +1,20 @@
|
|||
{#
|
||||
basic/search.html
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Template for the search page.
|
||||
|
||||
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
#}
|
||||
{%- extends "layout.html" %}
|
||||
{% set title = _('Search') %}
|
||||
{% set script_files = script_files + ['_static/searchtools.js'] %}
|
||||
{% block footer %}
|
||||
<script type="text/javascript">
|
||||
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
|
||||
</script>
|
||||
{# this is used when loading the search index using $.ajax fails,
|
||||
such as on Chrome for documents on localhost #}
|
||||
<script type="text/javascript" id="searchindexloader"></script>
|
||||
{{ super() }}
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<noscript>
|
||||
<div id="fallback" class="admonition warning">
|
||||
<p class="last">
|
||||
{% trans %}Please activate JavaScript to enable the search
|
||||
functionality.{% endtrans %}
|
||||
</p>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
{% if search_performed %}
|
||||
<h2>{{ _('Search Results') }}</h2>
|
||||
{% if not search_results %}
|
||||
<p>{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<div id="search-results">
|
||||
{% if search_results %}
|
||||
<ul>
|
||||
{% for href, caption, context in search_results %}
|
||||
<li>
|
||||
<a href="{{ pathto(item.href) }}">{{ caption }}</a>
|
||||
<p class="context">{{ context|e }}</p>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
<script>
|
||||
(function() {
|
||||
var cx = '012685039201307511604:um7if1hinba';
|
||||
var gcse = document.createElement('script');
|
||||
gcse.type = 'text/javascript';
|
||||
gcse.async = true;
|
||||
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
|
||||
var s = document.getElementsByTagName('script')[0];
|
||||
s.parentNode.insertBefore(gcse, s);
|
||||
})();
|
||||
</script>
|
||||
<gcse:searchresults-only></gcse:searchresults-only>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -309,6 +309,9 @@ class OutputCapture(object):
|
|||
|
||||
def __exit__(self, type, value, tracebac):
|
||||
os.dup2(self.stdout, self.stdout_fd)
|
||||
os.close(self.stdout)
|
||||
os.close(self.stdout_pipe_read)
|
||||
os.close(self.stdout_pipe_write)
|
||||
|
||||
# check if we have more to read from the pipe
|
||||
def more_data(self, pipe):
|
||||
|
@ -350,8 +353,11 @@ class AtomList(object):
|
|||
def __init__(self, lammps_wrapper_instance):
|
||||
self.lmp = lammps_wrapper_instance
|
||||
self.natoms = self.lmp.system.natoms
|
||||
self.dimensions = self.lmp.system.dimensions
|
||||
|
||||
def __getitem__(self, index):
|
||||
if self.dimensions == 2:
|
||||
return Atom2D(self.lmp, index + 1)
|
||||
return Atom(self.lmp, index + 1)
|
||||
|
||||
|
||||
|
@ -382,6 +388,12 @@ class Atom(object):
|
|||
self.lmp.eval("y[%d]" % self.index),
|
||||
self.lmp.eval("z[%d]" % self.index))
|
||||
|
||||
@position.setter
|
||||
def position(self, value):
|
||||
self.lmp.set("atom", self.index, "x", value[0])
|
||||
self.lmp.set("atom", self.index, "y", value[1])
|
||||
self.lmp.set("atom", self.index, "z", value[2])
|
||||
|
||||
@property
|
||||
def velocity(self):
|
||||
return (self.lmp.eval("vx[%d]" % self.index),
|
||||
|
@ -399,6 +411,31 @@ class Atom(object):
|
|||
return self.lmp.eval("q[%d]" % self.index)
|
||||
|
||||
|
||||
class Atom2D(Atom):
|
||||
def __init__(self, lammps_wrapper_instance, index):
|
||||
super(Atom2D, self).__init__(lammps_wrapper_instance, index)
|
||||
|
||||
@property
|
||||
def position(self):
|
||||
return (self.lmp.eval("x[%d]" % self.index),
|
||||
self.lmp.eval("y[%d]" % self.index))
|
||||
|
||||
@position.setter
|
||||
def position(self, value):
|
||||
self.lmp.set("atom", self.index, "x", value[0])
|
||||
self.lmp.set("atom", self.index, "y", value[1])
|
||||
|
||||
@property
|
||||
def velocity(self):
|
||||
return (self.lmp.eval("vx[%d]" % self.index),
|
||||
self.lmp.eval("vy[%d]" % self.index))
|
||||
|
||||
@property
|
||||
def force(self):
|
||||
return (self.lmp.eval("fx[%d]" % self.index),
|
||||
self.lmp.eval("fy[%d]" % self.index))
|
||||
|
||||
|
||||
class PyLammps(object):
|
||||
"""
|
||||
More Python-like wrapper for LAMMPS (e.g., for iPython)
|
||||
|
@ -608,6 +645,10 @@ class PyLammps(object):
|
|||
with OutputCapture() as capture:
|
||||
self.lmp.command(' '.join(cmd_args))
|
||||
output = capture.output
|
||||
|
||||
if 'verbose' in kwargs and kwargs['verbose']:
|
||||
print(output)
|
||||
|
||||
lines = output.splitlines()
|
||||
|
||||
if len(lines) > 1:
|
||||
|
@ -662,3 +703,7 @@ class IPyLammps(PyLammps):
|
|||
self.write_dump(*cmd_args)
|
||||
from IPython.core.display import Image
|
||||
return Image('snapshot.png')
|
||||
|
||||
def video(self, filename):
|
||||
from IPython.display import HTML
|
||||
return HTML("<video controls><source src=\"" + filename + "\"></video>")
|
||||
|
|
Loading…
Reference in New Issue