def getIntegrationPoints(elemType, order, scheme): xi = [] weight = [] if elemType[:-1] == "Line": if elemType == "Line2": stdOrder = 2 elif elemType == "Line3": stdOrder = 3 xi, weight = gauss_scheme(stdOrder + order) xi = [float(a.real) for a in xi] elif elemType[:-1] == "Tria": orderArray = [1, 3, 7] if elemType == "Tria3": stdOrder = 0 elif elemType == "Tria6": stdOrder = 1 xi, weight = tria_scheme(orderArray[stdOrder + order]) elif elemType[:-1] == "Quad": if elemType == "Quad4": stdOrder = 2 elif elemType == "Quad8" or elemType == "Quad9": stdOrder = 3 stdOrder += order ip, w = gauss_scheme(stdOrder) for i in range(stdOrder): for j in range(stdOrder): xi.append([float(ip[i].real), float(ip[j].real)]) weight.append(w[i] * w[j]) elif elemType[:-1] == "Hexa": if elemType == "Hexa8": stdOrder = 2 stdOrder += order ip, w = gauss_scheme(stdOrder) for i in range(stdOrder): for j in range(stdOrder): for k in range(stdOrder): xi.append([ float(ip[i].real), float(ip[j].real), float(ip[k].real) ]) weight.append(w[i] * w[j] * w[k]) return xi, weight
def getIntegrationPoints( elemType , order , scheme ): xi = [] weight = [] if elemType[:-1] == "Line": if elemType == "Line2": stdOrder = 2 elif elemType == "Line3": stdOrder = 3 xi,weight = gauss_scheme( stdOrder + order ) xi = [float(a.real) for a in xi] elif elemType[:-1] == "Tria": orderArray = [1,3,7] if elemType == "Tria3": stdOrder = 0 elif elemType == "Tria6": stdOrder = 1 xi,weight = tria_scheme( orderArray[stdOrder + order] ) elif elemType[:-1] == "Quad": if elemType == "Quad4": stdOrder = 2 elif elemType == "Quad8" or elemType == "Quad9": stdOrder = 3 stdOrder += order ip,w = gauss_scheme( stdOrder ) for i in range(stdOrder): for j in range(stdOrder): xi. append( [float(ip[i].real),float(ip[j].real)] ) weight.append( w[i]*w[j] ) elif elemType[:-1] == "Hexa": if elemType == "Quad8": stdOrder = 2 stdOrder += order ip,w = gauss_scheme( stdOrder ) for i in range(stdOrder): for j in range(stdOrder): for k in range(stdOrder): xi. append( [float(ip[i].real),float(ip[j].real)],float(ip[k].real) ) weight.append( w[i]*w[j]*w[k] ) return xi , weight
def getGaussPoints(elemType, reduced=False): point = [] weight = [] if "Line" in elemType: stdOrder = 2 if "2" in elemType else 3 if reduced: stdOrder -= 1 ip, w = gauss_scheme(stdOrder) point = [[ip[i]] for i in range(stdOrder)] weight = [[w[i]] for i in range(stdOrder)] elif "Tria" in elemType: stdOrder = 1 if "3" in elemType else 4 if stdOrder == 4 and reduced: stdOrder = 3 point, weight = tria_scheme(stdOrder) elif "Quad" in elemType: stdOrder = 2 if "4" in elemType else 3 if reduced: stdOrder -= 1 ip, w = gauss_scheme(stdOrder) point = [[ip[j], ip[i]] for i in range(stdOrder) for j in range(stdOrder)] weight = [[w[j]*w[i]] for i in range(stdOrder) for j in range(stdOrder)] elif "Tetra" in elemType: stdOrder = 1 if "4" in elemType else 5 if stdOrder == 5 and reduced: stdOrder = 4 point, weight = tetra_scheme(stdOrder) elif "Hexa" in elemType: stdOrder = 2 if "8" in elemType else 3 if reduced: stdOrder -= 1 ip, w = gauss_scheme(stdOrder) point = [[ip[k], ip[j], ip[i]] for i in range(stdOrder) for j in range(stdOrder) for k in range(stdOrder)] weight = [[w[k]*w[j]*w[i]] for i in range(stdOrder) for j in range(stdOrder) for k in range(stdOrder)] return np.array(point), np.array(weight)
def initZetaShapeFuncs(self): self.zetaSample, self.zetaWeights = gauss_scheme(2)