def get_area_triangle(self, elem_ID, elem_nodes, nodes_coordenates):
        '''
		returns the area of the element\n
		elem_ID: ID of the element in the elem_nodes list\n
		elem_nodes: list pith the element nodes\n
		nodes_coordenates: list of the cordinates of the nodes'''
        error = Errors()
        coord_jac = self.get_coord_j(elem_ID, elem_nodes, nodes_coordenates)
        lines, cols = np.shape(coord_jac)
        if lines != 3:
            error.is_not_triangle(lines)

        StriMat = np.zeros((3, 3))
        for i in range(0, lines):
            StriMat[i, 0] = coord_jac[i, 0]
            StriMat[i, 1] = coord_jac[i, 1]
            StriMat[i, 2] = 1.0
        return 0.5 * np.abs(np.linalg.det(StriMat))
예제 #2
0
	def get_area_triangle(self,elem_ID,elem_nodes,nodes_coordenates):
		'''
		returns the area of the element\n
		elem_ID: ID of the element in the elem_nodes list\n
		elem_nodes: list with the element nodes\n
		nodes_coordenates: list of the cordinates of the nodes'''
		error=Errors() 
		coord_jac=self.get_coord_j(elem_ID,elem_nodes,nodes_coordenates)
		lines,cols=np.shape(coord_jac)
		if lines!=3:
			error.is_not_triangle(lines)
			
		StriMat=np.zeros((3,3))
		for i in range(0,lines):
			StriMat[i,0]=coord_jac[i,0]
			StriMat[i,1]=coord_jac[i,1]
			StriMat[i,2]=1.0
		return 0.5*np.abs(np.linalg.det(StriMat))