Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
usadelndsoc
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JYU Condensed Matter Theory
usadelndsoc
Commits
f99e3256
Commit
f99e3256
authored
2 years ago
by
patavirt
Browse files
Options
Downloads
Patches
Plain Diff
Fixup some branch checks
parent
fd03eb41
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
usadelndsoc/solver.py
+20
-10
20 additions, 10 deletions
usadelndsoc/solver.py
with
20 additions
and
10 deletions
usadelndsoc/solver.py
+
20
−
10
View file @
f99e3256
...
...
@@ -322,19 +322,26 @@ class Solver:
do_restart
=
False
if
not
check_step
(
Phi
,
dx
):
if
frozen_M
and
not
update_skipped
:
_log_solve
.
info
(
"
Bad step: force Jacobian update
"
)
update_skipped
=
True
continue
elif
restart
==
0
:
do_restart
=
True
else
:
for
k
in
range
(
1
,
5
):
if
check_step
(
Phi
,
dx
/
5
**
k
):
dx
/=
5
**
k
s
/=
5
**
k
_log_solve
.
debug
(
f
"
bad step, reduced by
{
5
**
k
}
"
)
break
else
:
_log_solve
.
debug
(
f
"
bad step, nothing helped
"
)
if
s
>=
0.75
:
M
=
None
dx
*=
0.75
/
s
if
not
check_step
(
Phi
,
dx
):
_log_solve
.
debug
(
"
bad step
"
)
if
frozen_M
and
not
update_skipped
:
_log_solve
.
info
(
"
Bad step: force Jacobian update
"
)
update_skipped
=
True
continue
elif
restart
==
0
:
do_restart
=
True
tiny_count
=
0
elif
s
==
0
:
if
restart
==
0
:
...
...
@@ -375,6 +382,9 @@ class Solver:
_log_solve
.
error
(
"
Failed to solve (maxiter)
"
)
Phi
[...]
=
np
.
nan
M
=
None
import
pdb
pdb
.
set_trace
()
self
.
_M
=
M
...
...
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