Download 37.py from TestCaseGeneration/NumFEM_Eval: direct link, hf CLI and curl.
- Browser
- Download file 725 Bytes
-
https://huggingface.co/datasets/TestCaseGeneration/NumFEM_Eval/resolve/main/37.py
- Command line
-
hf download hf://datasets/TestCaseGeneration/NumFEM_Eval/37.py
-
curl -L -o 37.py https://huggingface.co/datasets/TestCaseGeneration/NumFEM_Eval/resolve/main/37.py
725 Bytes
| from numpy import empty, ndarray | |
| import numpy as np | |
| def get_shape_quad4(xi: ndarray) -> tuple[ndarray, ndarray]: | |
| N = empty(4, dtype=np.float64) | |
| dNdxi = empty(shape=(2, 4), dtype=np.float64) | |
| N[0] = 0.25 * (1.0 - xi[0]) * (1.0 - xi[1]) | |
| N[1] = 0.25 * (1.0 + xi[0]) * (1.0 - xi[1]) | |
| N[2] = 0.25 * (1.0 + xi[0]) * (1.0 + xi[1]) | |
| N[3] = 0.25 * (1.0 - xi[0]) * (1.0 + xi[1]) | |
| dNdxi[0, 0] = -0.25 * (1.0 - xi[1]) | |
| dNdxi[0, 1] = 0.25 * (1.0 - xi[1]) | |
| dNdxi[0, 2] = 0.25 * (1.0 + xi[1]) | |
| dNdxi[0, 3] = -0.25 * (1.0 + xi[1]) | |
| dNdxi[1, 0] = -0.25 * (1.0 - xi[0]) | |
| dNdxi[1, 1] = -0.25 * (1.0 + xi[0]) | |
| dNdxi[1, 2] = 0.25 * (1.0 + xi[0]) | |
| dNdxi[1, 3] = 0.25 * (1.0 - xi[0]) | |
| return N, dNdxi |