Download 07.py from TestCaseGeneration/NumFEM_Eval: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/datasets/TestCaseGeneration/NumFEM_Eval/resolve/main/07.py
- Command line
-
hf download hf://datasets/TestCaseGeneration/NumFEM_Eval/07.py
-
curl -L -o 07.py https://huggingface.co/datasets/TestCaseGeneration/NumFEM_Eval/resolve/main/07.py
1.09 kB
| from numpy import array | |
| def legendre_tetrahedra(order): | |
| from math import sqrt | |
| if order <= 1: | |
| xi = array([0.25]) | |
| eta = array([0.25]) | |
| mu = array([0.25]) | |
| w = array([1.0]) / 6.0 | |
| return xi, eta, mu, w | |
| elif order == 2: | |
| xi = array([(5.0 + 3.0 * sqrt(5.0)) / 20.0,(5.0 - sqrt(5.0)) / 20.0, (5.0 - sqrt(5.0)) / 20.0, (5.0 - sqrt(5.0)) / 20.0]) | |
| eta = array([(5.0 - sqrt(5.0)) / 20.0, (5.0 + 3.0 * sqrt(5.0)) / 20.0, (5.0 - sqrt(5.0)) / 20.0, (5.0 - sqrt(5.0)) / 20.0]) | |
| mu = array([(5.0 - sqrt(5.0)) / 20.0, (5.0 - sqrt(5.0)) / 20.0, (5.0 + 3.0 * sqrt(5.0)) / 20.0, (5.0 - sqrt(5.0)) / 20.0]) | |
| w = array([0.25, 0.25,0.25, 0.25]) / 6.0 | |
| return xi, eta, mu, w | |
| else: | |
| xi = array([1.0 / 4.0, 1.0 / 2.0, 1.0 / 6.0, 1.0 / 6.0, 1.0 / 6.0]) | |
| eta = array([1.0 / 4.0, 1.0 / 6.0, 1.0 / 2.0, 1.0 / 6.0, 1.0 / 6.0]) | |
| mu = array([1.0 / 4.0, 1.0 / 6.0, 1.0 / 6.0, 1.0 / 2.0,1.0 / 6.0]) | |
| w = array([-4.0 / 5.0, 9.0 / 20.0, 9.0 / 20.0, 9.0 / 20.0,9.0 / 20.0]) / 6.0 | |
| return xi, eta, mu, w |