@@ -463,7 +463,7 @@ def _interpolate_single_key(self, return_key, tri_index, x, y):
463
463
else :
464
464
raise ValueError ("Invalid return_key: " + return_key )
465
465
466
- def _compute_dof (self , kind , dz ):
466
+ def _compute_dof (self , kind , dz = None ):
467
467
"""
468
468
Computes and returns nodal dofs according to kind
469
469
@@ -604,28 +604,28 @@ def _compute_tri_eccentricities(tris_pts):
604
604
# problem (Reduced HCT element)
605
605
class _ReducedHCT_Element ():
606
606
"""
607
- Implementation of reduced HCT triangular element with explicit shape
608
- functions.
607
+ Implementation of reduced HCT triangular element with explicit shape
608
+ functions.
609
609
610
- Computes z, dz, d2z and the element stiffness matrix for bending energy:
611
- E(f) = integral( (d2z/dx2 + d2z/dy2)**2 dA)
610
+ Computes z, dz, d2z and the element stiffness matrix for bending energy:
611
+ E(f) = integral( (d2z/dx2 + d2z/dy2)**2 dA)
612
612
613
- *** Reference for the shape functions: ***
614
- [1] Basis functions for general Hsieh-Clough-Tocher _triangles, complete or
615
- reduced.
616
- Michel Bernadou, Kamal Hassan
617
- International Journal for Numerical Methods in Engineering.
618
- 17(5):784 - 789. 2.01
613
+ *** Reference for the shape functions: ***
614
+ [1] Basis functions for general Hsieh-Clough-Tocher _triangles, complete or
615
+ reduced.
616
+ Michel Bernadou, Kamal Hassan
617
+ International Journal for Numerical Methods in Engineering.
618
+ 17(5):784 - 789. 2.01
619
619
620
- *** Element description: ***
621
- 9 dofs: z and dz given at 3 apex
622
- C1 (conform)
620
+ *** Element description: ***
621
+ 9 dofs: z and dz given at 3 apex
622
+ C1 (conform)
623
623
624
624
"""
625
625
# 1) Loads matrices to generate shape functions as a function of
626
626
# triangle eccentricities - based on [1] p.11 '''
627
627
M = np .array ([
628
- [0.00 , 0.00 , 0.00 , 4.50 , 4.50 , 0.00 , 0.00 , 0.00 , 0.00 , 0.00 ],
628
+ [ 0.00 , 0.00 , 0.00 , 4.50 , 4.50 , 0.00 , 0.00 , 0.00 , 0.00 , 0.00 ],
629
629
[- 0.25 , 0.00 , 0.00 , 0.50 , 1.25 , 0.00 , 0.00 , 0.00 , 0.00 , 0.00 ],
630
630
[- 0.25 , 0.00 , 0.00 , 1.25 , 0.50 , 0.00 , 0.00 , 0.00 , 0.00 , 0.00 ],
631
631
[ 0.50 , 1.00 , 0.00 , - 1.50 , 0.00 , 3.00 , 3.00 , 0.00 , 0.00 , 3.00 ],
@@ -942,7 +942,7 @@ def get_Kff_and_Ff(self, J, ecc, triangles, Uc):
942
942
minimization of curvature energy with value of function at node
943
943
imposed and derivatives 'free'.
944
944
Builds the global Kff matrix in cco format.
945
- Builds the full Ff vec Ff = - Kfc x Uc
945
+ Builds the full Ff vec Ff = - Kfc x Uc
946
946
947
947
Parameters
948
948
----------
@@ -1048,17 +1048,17 @@ def compute_dof_from_df(self):
1048
1048
@staticmethod
1049
1049
def get_dof_vec (tri_z , tri_dz , J ):
1050
1050
"""
1051
- Computes the dof vector of a triangle, knowing the value of f, df and of the
1052
- local Jacobian at each node.
1051
+ Computes the dof vector of a triangle, knowing the value of f, df and
1052
+ of the local Jacobian at each node.
1053
1053
1054
- *tri_z*: array of shape (3,) of f nodal values
1055
- *tri_dz*: array of shape (3,2) of df/dx, df/dy nodal values
1056
- *J*: Jacobian matrix in local basis of apex 0
1054
+ *tri_z*: array of shape (3,) of f nodal values
1055
+ *tri_dz*: array of shape (3,2) of df/dx, df/dy nodal values
1056
+ *J*: Jacobian matrix in local basis of apex 0
1057
1057
1058
- Returns dof array of shape (9,) so that for each apex iapex:
1059
- dof[iapex*3+0] = f(Ai)
1060
- dof[iapex*3+1] = df(Ai).(AiAi+)
1061
- dof[iapex*3+2] = df(Ai).(AiAi-)]
1058
+ Returns dof array of shape (9,) so that for each apex iapex:
1059
+ dof[iapex*3+0] = f(Ai)
1060
+ dof[iapex*3+1] = df(Ai).(AiAi+)
1061
+ dof[iapex*3+2] = df(Ai).(AiAi-)]
1062
1062
"""
1063
1063
npt = tri_z .shape [0 ]
1064
1064
dof = np .zeros ([npt , 9 ], dtype = np .float64 )
@@ -1311,28 +1311,28 @@ def _cg(A, b, x0=None, tol=1.e-10, maxiter=1000):
1311
1311
1312
1312
Parameters
1313
1313
----------
1314
- *A* : _Sparse_Matrix_coo
1314
+ A : _Sparse_Matrix_coo
1315
1315
*A* must have been compressed before by compress_csc or
1316
1316
compress_csr method.
1317
1317
1318
- *b* : array
1318
+ b : array
1319
1319
Right hand side of the linear system.
1320
1320
1321
1321
Returns
1322
1322
----------
1323
- *x* : array.
1323
+ x : array.
1324
1324
The converged solution.
1325
- * err* : float
1325
+ err: float
1326
1326
The absolute error np.linalg.norm(A.dot(x) - b)
1327
1327
1328
1328
Other parameters
1329
1329
----------
1330
- *x0* : array.
1330
+ x0 : array.
1331
1331
Starting guess for the solution.
1332
- * tol* : float.
1332
+ tol: float.
1333
1333
Tolerance to achieve. The algorithm terminates when the relative
1334
1334
residual is below tol.
1335
- * maxiter* : integer.
1335
+ maxiter: integer.
1336
1336
Maximum number of iterations. Iteration will stop
1337
1337
after maxiter steps even if the specified tolerance has not
1338
1338
been achieved.
0 commit comments