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
Neel Shah
NIFTy
Commits
4459c75b
Commit
4459c75b
authored
Oct 10, 2017
by
Jakob Knollmueller
Browse files
added alpha back to CriticalPowerEnergy
parent
762892f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty/library/critical_filter/critical_power_energy.py
View file @
4459c75b
...
...
@@ -81,6 +81,7 @@ class CriticalPowerEnergy(Energy):
inverter
=
ConjugateGradient
(
preconditioner
=
preconditioner
)
self
.
_inverter
=
inverter
self
.
one
=
Field
(
self
.
position
.
domain
,
val
=
1.
)
self
.
constants
=
self
.
one
/
2.
+
self
.
alpha
-
1
@
property
def
inverter
(
self
):
...
...
@@ -99,7 +100,7 @@ class CriticalPowerEnergy(Energy):
@
memo
def
value
(
self
):
energy
=
self
.
one
.
vdot
(
self
.
_theta
)
energy
+=
self
.
position
.
vdot
(
self
.
on
e
/
2.
)
energy
+=
self
.
position
.
vdot
(
self
.
c
on
stants
)
energy
+=
0.5
*
self
.
position
.
vdot
(
self
.
_Tt
)
return
energy
.
real
...
...
@@ -107,7 +108,7 @@ class CriticalPowerEnergy(Energy):
@
memo
def
gradient
(
self
):
gradient
=
-
self
.
_theta
gradient
+=
(
self
.
on
e
/
2.
)
gradient
+=
(
self
.
c
on
stants
)
gradient
+=
self
.
_Tt
gradient
.
val
=
gradient
.
val
.
real
return
gradient
...
...
@@ -151,10 +152,6 @@ class CriticalPowerEnergy(Energy):
def
_theta
(
self
):
return
exp
(
-
self
.
position
)
*
(
self
.
q
+
self
.
w
/
2.
)
@
property
@
memo
def
_rho_prime
(
self
):
return
self
.
alpha
-
1.
+
self
.
rho
/
2.
@
property
@
memo
...
...
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