Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Malthe Kjær Bisbo
GOFEE
Commits
b18a63a1
Commit
b18a63a1
authored
Feb 06, 2020
by
Malthe Kjær Bisbo
Browse files
added traceback to bfgslinesearch_constrainted
parent
3de1629c
Changes
5
Hide whitespace changes
Inline
Side-by-side
__pycache__/gofee.cpython-36.pyc
View file @
b18a63a1
No preview for this file type
bfgslinesearch_constrained.py
View file @
b18a63a1
...
...
@@ -6,6 +6,8 @@ from ase.ga.utilities import get_mic_distance
from
utils
import
check_valid_bondlengths
import
traceback
class
BFGSLineSearch_constrained
(
BFGSLineSearch
):
def
__init__
(
self
,
atoms
,
pos_init
=
None
,
restart
=
None
,
logfile
=
'-'
,
maxstep
=
.
2
,
...
...
gofee.py
View file @
b18a63a1
...
...
@@ -185,6 +185,7 @@ class GOFEE():
self
.
comm
.
barrier
()
def
initialize
(
self
):
self
.
get_initial_structures
()
self
.
steps
=
0
def
get_initial_structures
(
self
):
...
...
@@ -198,22 +199,14 @@ class GOFEE():
they are generated by heavily rattling the supplied structures.
"""
# Collect potentially supplied structures and evaluate
# energies and forces if not present.
structures_init
=
[]
# Collect potentially supplied structures.
if
self
.
structures
is
not
None
:
for
a
in
self
.
structures
:
a
.
info
=
{
'origin'
:
'PreSupplied'
}
calc
=
a
.
get_calculator
()
if
isinstance
(
calc
,
SinglePointCalculator
):
if
'energy'
in
calc
.
results
and
'forces'
in
calc
.
results
:
# Add without evaluating.
structures_init
.
append
(
a
)
continue
a
=
self
.
evaluate
(
a
)
structures_init
.
append
(
a
)
else
:
self
.
structures
=
[]
Nremaining
=
self
.
Ninit
-
len
(
structures
_init
)
Nremaining
=
self
.
Ninit
-
len
(
self
.
structures
)
if
Nremaining
>
0
and
self
.
startgenerator
is
None
:
# Initialize rattle-mutation for all atoms.
...
...
@@ -227,21 +220,33 @@ class GOFEE():
a
=
self
.
startgenerator
.
get_new_candidate
()
else
:
# Perform two times rattle of all atoms.
a0
=
structures
_init
[
i
%
len
(
structures
_init
)]
a0
=
self
.
structures
[
i
%
len
(
self
.
structures
)]
a
=
rattle
.
get_new_candidate
([
a
])
a
=
rattle
.
get_new_candidate
([
a
])
self
.
structures
.
append
(
a
)
def
evaluate_initial_structures
(
self
):
structures_init
=
[]
for
a
in
self
.
structures
:
calc
=
a
.
get_calculator
()
if
isinstance
(
calc
,
SinglePointCalculator
):
if
'energy'
in
calc
.
results
and
'forces'
in
calc
.
results
:
# Write without evaluating.
structures_init
.
append
(
a
)
continue
a
=
self
.
evaluate
(
a
)
structures_init
.
append
(
a
)
for
a
in
structures_init
:
self
.
write
(
a
)
self
.
gpr
.
memory
.
save_data
(
structures_init
)
self
.
population
.
add
(
structures_init
)
def
run
(
self
):
""" Method to run the search.
"""
self
.
get_initial_structures
()
if
self
.
steps
==
0
:
self
.
evaluate_initial_structures
()
while
self
.
steps
<
self
.
max_steps
:
self
.
print_master
(
'
\n
### steps: {} ###
\n
'
.
format
(
self
.
steps
))
...
...
surrogate/__pycache__/gpr.cpython-36.pyc
View file @
b18a63a1
No preview for this file type
surrogate/gpr.py
View file @
b18a63a1
...
...
@@ -80,7 +80,7 @@ class GPR():
if
kernel
is
'single'
:
self
.
kernel
=
gauss_kernel
()
elif
kernel
is
'double'
:
self
.
kernel
=
double_gauss_kernel
(
Nsplit_eta
=
self
.
descriptor
.
Nelements_2body
)
self
.
kernel
=
double_gauss_kernel
()
else
:
self
.
kernel
=
kernel
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment