Datasets:

License:
NumFEM_Eval / 07.py
papakuku's picture
Upload 76 files
76cb30c verified
Raw History Blame Contribute Delete
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