Skip to content

Conversation

@bgranzow
Copy link

No description provided.

from jaxtyping import Array, Float, Int
from scipy import special
import numpy as onp
import equinox as eqx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the motivation for adding equinox and related dependencies (e.g. jaxtyping)?

@@ -0,0 +1,201 @@
from jaxtyping import Array, Float, Int
from scipy import special
import numpy as onp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer

import numpy as np
import jax.numpy as jnp

for consistency with CMAD main.


"""

DOF_NODE: number of degrees of freedom per node
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are integer variables capitalized according to this naming convention?

If so, SURF_TRACTION_VECTOR should be lowercase?


Attributes:
values: Values of the shape functions at a discrete set of points.
Shape is ``(nPts, nNodes)``, where ``nPts`` is the number of
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming convention here is different that other parts of the code. What is the reason for that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been trying to follow PEP 8 guidelines for CMAD main.

https://peps.python.org/pep-0008/

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer (num_points, num_nodes) for consistency with the rest of the code.

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)``.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nNdodes? is that a typo?


return PEL

def assemble_global_stiffness(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talk through how this works.

E = 200
nu = 0.3

eq_num, NUM_FREE_DOF, NUM_PRES_DOF\
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space needed between variable and continuation character \

from jaxtyping import Array, Float, Int
from scipy import special
import numpy as onp
import equinox as eqx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically only near-universal packages (e.g. numpy, pandas, matplotlib) are allowed to have shortened names.


def initialize_equation(NUM_NODES, DOF_NODE, disp_node):

eq_num = np.zeros((NUM_NODES, DOF_NODE), dtype = int)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP 8 states no space between = in function arguments except when combining argument annotation with default values.

and the weights.
"""

n = math.ceil((degree + 1)/2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try using numpy utilities instead of math

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants