Skip to content

Commit 44cf12c

Browse files
committed
renamed make_PD
1 parent 94d5746 commit 44cf12c

23 files changed

Lines changed: 27 additions & 27 deletions

1_mass_spring/MassSpringEnergy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def hess(x, e, l2, k):
2222
for i in range(0, len(e)):
2323
diff = x[e[i][0]] - x[e[i][1]]
2424
H_diff = 2 * k[i] / l2[i] * (2 * np.outer(diff, diff) + (diff.dot(diff) - l2[i]) * np.identity(2))
25-
H_local = utils.make_PD(np.block([[H_diff, -H_diff], [-H_diff, H_diff]]))
25+
H_local = utils.make_PSD(np.block([[H_diff, -H_diff], [-H_diff, H_diff]]))
2626
# add to global matrix
2727
for nI in range(0, 2):
2828
for nJ in range(0, 2):

1_mass_spring/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
import numpy.linalg as LA
33

4-
def make_PD(hess):
4+
def make_PSD(hess):
55
[lam, V] = LA.eigh(hess) # Eigen decomposition on symmetric matrix
66
# set all negative Eigenvalues to 0
77
for i in range(0, len(lam)):

2_dirichlet/MassSpringEnergy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def hess(x, e, l2, k):
2222
for i in range(0, len(e)):
2323
diff = x[e[i][0]] - x[e[i][1]]
2424
H_diff = 2 * k[i] / l2[i] * (2 * np.outer(diff, diff) + (diff.dot(diff) - l2[i]) * np.identity(2))
25-
H_local = utils.make_PD(np.block([[H_diff, -H_diff], [-H_diff, H_diff]]))
25+
H_local = utils.make_PSD(np.block([[H_diff, -H_diff], [-H_diff, H_diff]]))
2626
# add to global matrix
2727
for nI in range(0, 2):
2828
for nJ in range(0, 2):

2_dirichlet/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
import numpy.linalg as LA
33

4-
def make_PD(hess):
4+
def make_PSD(hess):
55
[lam, V] = LA.eigh(hess) # Eigen decomposition on symmetric matrix
66
# set all negative Eigenvalues to 0
77
for i in range(0, len(lam)):

3_contact/MassSpringEnergy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def hess(x, e, l2, k):
2222
for i in range(0, len(e)):
2323
diff = x[e[i][0]] - x[e[i][1]]
2424
H_diff = 2 * k[i] / l2[i] * (2 * np.outer(diff, diff) + (diff.dot(diff) - l2[i]) * np.identity(2))
25-
H_local = utils.make_PD(np.block([[H_diff, -H_diff], [-H_diff, H_diff]]))
25+
H_local = utils.make_PSD(np.block([[H_diff, -H_diff], [-H_diff, H_diff]]))
2626
# add to global matrix
2727
for nI in range(0, 2):
2828
for nJ in range(0, 2):

3_contact/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
import numpy.linalg as LA
33

4-
def make_PD(hess):
4+
def make_PSD(hess):
55
[lam, V] = LA.eigh(hess) # Eigen decomposition on symmetric matrix
66
# set all negative Eigenvalues to 0
77
for i in range(0, len(lam)):

4_friction/FrictionEnergy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def hess(v, mu_lambda, hhat, n):
5151
inner_term = f1_div_vbarnorm(vbarnorm, epsv) * np.identity(2)
5252
if vbarnorm != 0:
5353
inner_term += f_hess_term(vbarnorm, epsv) / vbarnorm * np.outer(vbar, vbar)
54-
local_hess = mu_lambda[i] * T.dot(utils.make_PD(inner_term)).dot(np.transpose(T)) / hhat
54+
local_hess = mu_lambda[i] * T.dot(utils.make_PSD(inner_term)).dot(np.transpose(T)) / hhat
5555
for c in range(0, 2):
5656
for r in range(0, 2):
5757
IJV[0].append(i * 2 + r)

4_friction/MassSpringEnergy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def hess(x, e, l2, k):
2222
for i in range(0, len(e)):
2323
diff = x[e[i][0]] - x[e[i][1]]
2424
H_diff = 2 * k[i] / l2[i] * (2 * np.outer(diff, diff) + (diff.dot(diff) - l2[i]) * np.identity(2))
25-
H_local = utils.make_PD(np.block([[H_diff, -H_diff], [-H_diff, H_diff]]))
25+
H_local = utils.make_PSD(np.block([[H_diff, -H_diff], [-H_diff, H_diff]]))
2626
# add to global matrix
2727
for nI in range(0, 2):
2828
for nJ in range(0, 2):

4_friction/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
import numpy.linalg as LA
33

4-
def make_PD(hess):
4+
def make_PSD(hess):
55
[lam, V] = LA.eigh(hess) # Eigen decomposition on symmetric matrix
66
# set all negative Eigenvalues to 0
77
for i in range(0, len(lam)):

5_mov_dirichlet/FrictionEnergy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def hess(v, mu_lambda, hhat, n):
5151
inner_term = f1_div_vbarnorm(vbarnorm, epsv) * np.identity(2)
5252
if vbarnorm != 0:
5353
inner_term += f_hess_term(vbarnorm, epsv) / vbarnorm * np.outer(vbar, vbar)
54-
local_hess = mu_lambda[i] * T.dot(utils.make_PD(inner_term)).dot(np.transpose(T)) / hhat
54+
local_hess = mu_lambda[i] * T.dot(utils.make_PSD(inner_term)).dot(np.transpose(T)) / hhat
5555
for c in range(0, 2):
5656
for r in range(0, 2):
5757
IJV[0].append(i * 2 + r)

0 commit comments

Comments
 (0)