Download 34.py from TestCaseGeneration/NumFEM_Eval: direct link, hf CLI and curl.
- Browser
- Download file 374 Bytes
-
https://huggingface.co/datasets/TestCaseGeneration/NumFEM_Eval/resolve/main/34.py
- Command line
-
hf download hf://datasets/TestCaseGeneration/NumFEM_Eval/34.py
-
curl -L -o 34.py https://huggingface.co/datasets/TestCaseGeneration/NumFEM_Eval/resolve/main/34.py
374 Bytes
| from numpy import empty, ndarray | |
| def get_shape_line3(xi: ndarray) -> tuple[ndarray, ndarray]: | |
| N = empty(3) | |
| dNdxi = empty(shape=(1, 3)) | |
| N[0] = 0.5 * (1.0 - xi) - 0.5 * (1.0 - xi * xi) | |
| N[1] = 1.0 - xi * xi | |
| N[2] = 0.5 * (1.0 + xi) - 0.5 * (1.0 - xi * xi) | |
| dNdxi[0, 0] = -0.5 + xi | |
| dNdxi[0, 1] = -2.0 * xi | |
| dNdxi[0, 2] = 0.5 + xi | |
| return N, dNdxi |