Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mrdna
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tbgl
tools
mrdna
Commits
f20a449c
Commit
f20a449c
authored
5 years ago
by
cmaffeo2
Browse files
Options
Downloads
Patches
Plain Diff
Fix to productpotential
parent
4a48abc6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mrdna/arbdmodel/__init__.py
+19
-16
19 additions, 16 deletions
mrdna/arbdmodel/__init__.py
with
19 additions
and
16 deletions
mrdna/arbdmodel/__init__.py
+
19
−
16
View file @
f20a449c
...
...
@@ -157,9 +157,9 @@ class Parent():
# for b in (i,j): assert(b in beads)
self
.
bond_angles
.
append
(
(
i
,
j
,
k
,
l
,
bond_angle
)
)
def
add_product_potential
_angle
(
self
,
potential_list
):
def
add_product_potential
(
self
,
potential_list
):
"""
potential_list: list of tuples of form (particle_i, particle_j,..., TabulatedPotential)
"""
if
len
(
terms
)
<
2
:
raise
ValueError
(
"
Too few potentials
"
)
if
len
(
potential_list
)
<
2
:
raise
ValueError
(
"
Too few potentials
"
)
for
elem
in
potential_list
:
beads
=
elem
[:
-
1
]
pot
=
elem
[
-
1
]
...
...
@@ -1272,20 +1272,23 @@ component "data" value 3
def
_writeArbdProductPotentialFile
(
self
):
if
len
(
self
.
product_potentials
)
>
0
:
with
open
(
self
.
_product_potential_filename
,
'
w
'
)
as
fh
:
for
ijk_tb
in
self
.
get_product_potentials
():
ijk
=
ijk_b
[:
-
1
]
for
pot
in
self
.
get_product_potentials
():
line
=
"
PRODUCTPOTENTIAL
"
for
ijk_tb
in
pot
:
ijk
=
ijk_tb
[:
-
1
]
tb
=
ijk_tb
[
-
1
]
if
not
(
type
(
tb
)
is
tuple
or
type
(
tb
)
is
list
)
:
if
type
(
tb
)
is
tuple
or
type
(
tb
)
is
list
:
if
len
(
tb
)
!=
2
:
raise
ValueError
(
"
Invalid product potential
"
)
type_
,
b
=
tb
if
type
(
type_
)
is
not
str
:
raise
ValueError
(
"
Invalid product potential: unrecognized specification of potential type
"
)
else
:
type_
=
""
b
=
tb
if
type
(
b
)
is
not
str
and
not
isinstance
(
b
,
Path
):
b
.
write_file
()
fh
.
write
(
"
PRODUCTPOTENTIAL
"
+
"
"
.
join
([
str
(
x
)
for
x
in
ijk
+
[
type_
,
b
]
if
x
!=
""
]))
line
=
line
+
"
"
.
join
([
str
(
x
.
idx
)
for
x
in
ijk
])
+
"
"
line
=
line
+
"
"
.
join
([
str
(
x
)
for
x
in
[
type_
,
b
]
if
x
!=
""
])
+
"
"
fh
.
write
(
line
)
def
dimensions_from_structure
(
self
,
padding_factor
=
1.5
,
isotropic
=
False
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment