Conversation
cmad/fem_utils/interpolants.py
Outdated
| from jaxtyping import Array, Float, Int | ||
| from scipy import special | ||
| import numpy as onp | ||
| import equinox as eqx |
There was a problem hiding this comment.
What's the motivation for adding equinox and related dependencies (e.g. jaxtyping)?
cmad/fem_utils/interpolants.py
Outdated
| @@ -0,0 +1,201 @@ | |||
| from jaxtyping import Array, Float, Int | |||
| from scipy import special | |||
| import numpy as onp | |||
There was a problem hiding this comment.
Would prefer
import numpy as np
import jax.numpy as jnp
for consistency with CMAD main.
cmad/fem_utils/solve_fem.py
Outdated
|
|
||
| """ | ||
|
|
||
| DOF_NODE: number of degrees of freedom per node |
There was a problem hiding this comment.
Are integer variables capitalized according to this naming convention?
If so, SURF_TRACTION_VECTOR should be lowercase?
cmad/fem_utils/interpolants.py
Outdated
|
|
||
| Attributes: | ||
| values: Values of the shape functions at a discrete set of points. | ||
| Shape is ``(nPts, nNodes)``, where ``nPts`` is the number of |
There was a problem hiding this comment.
Naming convention here is different that other parts of the code. What is the reason for that?
There was a problem hiding this comment.
I have been trying to follow PEP 8 guidelines for CMAD main.
There was a problem hiding this comment.
prefer (num_points, num_nodes) for consistency with the rest of the code.
cmad/fem_utils/interpolants.py
Outdated
| gradients: Values of the parametric gradients of the shape functions. | ||
| Shape is ``(nPts, nDim, nNodes)``, where ``nDim`` is the number | ||
| of spatial dimensions. Line elements are an exception, which | ||
| have shape ``(nPts, nNdodes)``. |
cmad/fem_utils/fem_functions.py
Outdated
|
|
||
| return PEL | ||
|
|
||
| def assemble_global_stiffness( |
There was a problem hiding this comment.
Talk through how this works.
cmad/fem_utils/tests/test_fem.py
Outdated
| E = 200 | ||
| nu = 0.3 | ||
|
|
||
| eq_num, NUM_FREE_DOF, NUM_PRES_DOF\ |
There was a problem hiding this comment.
space needed between variable and continuation character \
cmad/fem_utils/interpolants.py
Outdated
| from jaxtyping import Array, Float, Int | ||
| from scipy import special | ||
| import numpy as onp | ||
| import equinox as eqx |
There was a problem hiding this comment.
Typically only near-universal packages (e.g. numpy, pandas, matplotlib) are allowed to have shortened names.
cmad/fem_utils/fem_functions.py
Outdated
|
|
||
| def initialize_equation(NUM_NODES, DOF_NODE, disp_node): | ||
|
|
||
| eq_num = np.zeros((NUM_NODES, DOF_NODE), dtype = int) |
There was a problem hiding this comment.
PEP 8 states no space between = in function arguments except when combining argument annotation with default values.
cmad/fem_utils/quadrature_rule.py
Outdated
| and the weights. | ||
| """ | ||
|
|
||
| n = math.ceil((degree + 1)/2) |
There was a problem hiding this comment.
try using numpy utilities instead of math
No description provided.