sync with GH
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15668 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -2123,7 +2123,7 @@ thermo_style custom step temp press v_pxy v_pxz v_pyz v_v11 v_v22 v_v33
|
||||
run 100000
|
||||
variable v equal (v_v11+v_v22+v_v33)/3.0
|
||||
variable ndens equal count(all)/vol
|
||||
print "average viscosity: $v \[Pa.s/] @ $T K, $\{ndens\} /A^3" :pre
|
||||
print "average viscosity: $v \[Pa.s\] @ $T K, $\{ndens\} /A^3" :pre
|
||||
|
||||
The fifth method is related to the above Green-Kubo method,
|
||||
but uses the Einstein formulation, analogous to the Einstein
|
||||
|
||||
@ -845,7 +845,7 @@ PYTHON package :link(PYTHON),h5
|
||||
Contents: A "python"_python.html command which allow you to execute
|
||||
Python code from a LAMMPS input script. The code can be in a separate
|
||||
file or embedded in the input script itself. See "Section
|
||||
11.2"_Section_python.html#py-2 for an overview of using Python from
|
||||
11.2"_Section_python.html#py_2 for an overview of using Python from
|
||||
LAMMPS and for other ways to use LAMMPS and Python together.
|
||||
|
||||
Building with the PYTHON package assumes you have a Python shared
|
||||
|
||||
@ -56,7 +56,7 @@ CMAP :pre
|
||||
|
||||
1 1 8 10 12 18 20
|
||||
2 5 18 20 22 25 27
|
||||
...
|
||||
\[...\]
|
||||
N 3 314 315 317 318 330 :pre
|
||||
|
||||
The first column is an index from 1 to N to enumerate the CMAP terms;
|
||||
@ -66,7 +66,7 @@ remaining 5 columns are the atom IDs of the atoms in the two 4-atom
|
||||
dihedrals that overlap to create the CMAP 5-body interaction. Note
|
||||
that the "crossterm" and "CMAP" keywords for the header and body
|
||||
sections match those specified in the read_data command following the
|
||||
data file name; see the "read_data"_doc/read_data.html doc page for
|
||||
data file name; see the "read_data"_read_data.html doc page for
|
||||
more details.
|
||||
|
||||
A data file containing CMAP crossterms can be generated from a PDB
|
||||
@ -124,9 +124,9 @@ LAMMPS"_Section_start.html#start_3 section for more info on packages.
|
||||
|
||||
:line
|
||||
|
||||
(Buck)
|
||||
Buck, Bouguet-Bonnet, Pastor, MacKerell Jr., Biophys J, 90, L36
|
||||
:link(Buck)
|
||||
[(Buck)] Buck, Bouguet-Bonnet, Pastor, MacKerell Jr., Biophys J, 90, L36
|
||||
(2006).
|
||||
|
||||
(Brooks)
|
||||
Brooks, Brooks, MacKerell Jr., J Comput Chem, 30, 1545 (2009).
|
||||
:link(Brooks)
|
||||
[(Brooks)] Brooks, Brooks, MacKerell Jr., J Comput Chem, 30, 1545 (2009).
|
||||
|
||||
@ -24,6 +24,7 @@ Fixes :h1
|
||||
fix_bond_create
|
||||
fix_bond_swap
|
||||
fix_box_relax
|
||||
fix_cmap
|
||||
fix_colvars
|
||||
fix_controller
|
||||
fix_deform
|
||||
|
||||
@ -147,6 +147,7 @@ fix_bond_break.html
|
||||
fix_bond_create.html
|
||||
fix_bond_swap.html
|
||||
fix_box_relax.html
|
||||
fix_cmap.html
|
||||
fix_colvars.html
|
||||
fix_controller.html
|
||||
fix_deform.html
|
||||
|
||||
@ -90,3 +90,24 @@ def promote_doc_keywords(content):
|
||||
|
||||
def filter_multiple_horizontal_rules(content):
|
||||
return re.sub(r"----------[\s\n]+----------", '', content)
|
||||
|
||||
|
||||
def merge_preformatted_sections(content):
|
||||
mergable_section_pattern = re.compile(r"\.\. parsed-literal::\n"
|
||||
r"\n"
|
||||
r"(?P<listingA>(( [^\n]+\n)|(^\n))+)\n\s*"
|
||||
r"^\.\. parsed-literal::\n"
|
||||
r"\n"
|
||||
r"(?P<listingB>(( [^\n]+\n)|(^\n))+)\n", re.MULTILINE | re.DOTALL)
|
||||
|
||||
m = mergable_section_pattern.search(content)
|
||||
|
||||
while m:
|
||||
content = mergable_section_pattern.sub(r".. parsed-literal::\n"
|
||||
r"\n"
|
||||
r"\g<listingA>"
|
||||
r"\g<listingB>"
|
||||
r"\n", content)
|
||||
m = mergable_section_pattern.search(content)
|
||||
|
||||
return content
|
||||
|
||||
@ -73,10 +73,13 @@ class RSTMarkup(Markup):
|
||||
def unescape_rst_chars(self, text):
|
||||
text = text.replace('\\*', '*')
|
||||
text = text.replace('\\^', '^')
|
||||
text = text.replace('\\_', '_')
|
||||
text = self.unescape_underscore(text)
|
||||
text = text.replace('\\|', '|')
|
||||
return text
|
||||
|
||||
def unescape_underscore(self, text):
|
||||
return text.replace('\\_', '_')
|
||||
|
||||
def inline_math(self, text):
|
||||
start_pos = text.find("\\(")
|
||||
end_pos = text.find("\\)")
|
||||
@ -136,6 +139,7 @@ class RSTFormatting(Formatting):
|
||||
return content.strip()
|
||||
|
||||
def preformat(self, content):
|
||||
content = self.markup.unescape_underscore(content)
|
||||
if self.indent_level > 0:
|
||||
return self.list_indent("\n.. parsed-literal::\n\n" + self.indent(content.rstrip()), self.indent_level)
|
||||
return "\n.. parsed-literal::\n\n" + self.indent(content.rstrip())
|
||||
@ -355,6 +359,7 @@ class Txt2Rst(TxtParser):
|
||||
self.document_filters.append(lammps_filters.detect_and_add_command_to_index)
|
||||
self.document_filters.append(lammps_filters.filter_multiple_horizontal_rules)
|
||||
self.document_filters.append(lammps_filters.promote_doc_keywords)
|
||||
self.document_filters.append(lammps_filters.merge_preformatted_sections)
|
||||
|
||||
def is_ignored_textblock_begin(self, line):
|
||||
return line.startswith('<!-- HTML_ONLY -->')
|
||||
|
||||
@ -169,6 +169,13 @@ class TestFormatting(unittest.TestCase):
|
||||
" Hello\n"
|
||||
" World\n\n", s)
|
||||
|
||||
def test_preformat_formatting_with_underscore(self):
|
||||
s = self.txt2rst.convert("if MPI.COMM_WORLD.rank == 0:\n"
|
||||
" print(\"Potential energy: \", L.eval(\"pe\")) :pre\n")
|
||||
self.assertEqual("\n.. parsed-literal::\n\n"
|
||||
" if MPI.COMM_WORLD.rank == 0:\n"
|
||||
" print(\"Potential energy: \", L.eval(\"pe\"))\n\n", s)
|
||||
|
||||
def test_header_formatting(self):
|
||||
s = self.txt2rst.convert("Level 1 :h1\n"
|
||||
"Level 2 :h2\n"
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user