Download 06.py from TestCaseGeneration/NumFEM_Eval: direct link, hf CLI and curl.
- Browser
- Download file 827 Bytes
-
https://huggingface.co/datasets/TestCaseGeneration/NumFEM_Eval/resolve/main/06.py
- Command line
-
hf download hf://datasets/TestCaseGeneration/NumFEM_Eval/06.py
-
curl -L -o 06.py https://huggingface.co/datasets/TestCaseGeneration/NumFEM_Eval/resolve/main/06.py
827 Bytes
| from numpy import array | |
| def legendre_triangle(order): | |
| if order <= 1: | |
| xi = array([1.0 / 3.0]) | |
| eta = array([1.0 / 3.0]) | |
| w = array([1.0 / 2.0]) | |
| return xi, eta, w | |
| elif order == 2: | |
| xi = array([1.0 / 2.0, 0.0,1.0 / 2.0]) | |
| eta = array([1.0 / 2.0,1.0 / 2.0,0.0]) | |
| w = array([1.0 / 6.0,1.0 / 6.0,1.0 / 6.0]) | |
| return xi, eta, w | |
| elif order == 3: | |
| xi = array([1.0 / 6.0,2.0 / 3.0,1.0 / 6.0]) | |
| eta = array([1.0 / 6.0, 1.0 / 6.0, 2.0 / 3.0]) | |
| w = array([1.0 / 6.0, 1.0 / 6.0, 1.0 / 6.0]) | |
| return xi, eta, w | |
| else: | |
| xi = array([1.0 / 3.0, 1.0 / 5.0, 1.0 / 5.0, 3.0 / 5.0]) | |
| eta = array([1.0 / 3.0,3.0 / 5.0,1.0 / 5.0,1.0 / 5.0]) | |
| w = array([-9.0 / 32.0,25.0 / 96.0, 25.0 / 96.0,25.0 / 96.0]) | |
| return xi, eta, w |