BasicTools.FE.FETools module

BasicTools.FE.FETools.CellDataToIntegrationPointsData(mesh, scalarFields, elementSet=None, relativeDimension=0, integrationRule={'bar2': (array([[0.21132487], [0.78867513]]), array([0.5, 0.5])), 'bar3': (array([[0.11270167], [0.5], [0.88729833]]), array([0.27777778, 0.44444444, 0.27777778])), 'hex20': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex27': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex8': (array([[0.21132487, 0.21132487, 0.21132487], [0.78867513, 0.21132487, 0.21132487], [0.21132487, 0.78867513, 0.21132487], [0.78867513, 0.78867513, 0.21132487], [0.21132487, 0.21132487, 0.78867513], [0.78867513, 0.21132487, 0.78867513], [0.21132487, 0.78867513, 0.78867513], [0.78867513, 0.78867513, 0.78867513]]), array([0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125])), 'point1': (array([[0]]), array([1.])), 'quad4': (array([[0.21132487, 0.21132487], [0.21132487, 0.78867513], [0.78867513, 0.21132487], [0.78867513, 0.78867513]]), array([0.25, 0.25, 0.25, 0.25])), 'quad8': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'quad9': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'tet10': (array([[0.16666667, 0.16666667, 0.16666667], [0.5, 0.16666667, 0.16666667], [0.16666667, 0.5, 0.16666667], [0.16666667, 0.16666667, 0.5], [0.25, 0.25, 0.25]]), array([0.075, 0.075, 0.075, 0.075, -0.13333333])), 'tet4': (array([[0.25, 0.25, 0.25]]), array([0.16666667])), 'tri3': (array([[0.16666667, 0.16666667], [0.66666667, 0.16666667], [0.16666667, 0.66666667]]), array([0.16666667, 0.16666667, 0.16666667])), 'tri6': (array([[0.44594849, 0.44594849, 0.], [0.10810302, 0.44594849, 0.], [0.44594849, 0.10810302, 0.], [0.09157621, 0.09157621, 0.], [0.81684757, 0.09157621, 0.], [0.09157621, 0.81684757, 0.]]), array([0.11169079, 0.11169079, 0.11169079, 0.05497587, 0.05497587, 0.05497587])), 'wed6': (array([[0.16666667, 0.16666667, 0.21132487], [0.16666667, 0.16666667, 0.78867513], [0.66666667, 0.16666667, 0.21132487], [0.66666667, 0.16666667, 0.78867513], [0.16666667, 0.66666667, 0.21132487], [0.16666667, 0.66666667, 0.78867513]]), array([0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333]))})[source]

Change the representation of scalarFields from data constant by cell (elements) to data at integration points. (Lagrange isoparametric finite elements)

Parameters:
  • mesh (UnstructuredMesh) – mesh on which the function is applied

  • scalarFields (np.ndarray of size (nbe of fields, nbe of elements) or dict) – with “nbe of fields” as keys and np.ndarray of size (nbe of elements,) or floats as values fields whose representation is changed by the function

  • elementSet (elementSet defining the elements on which the function is) – computed. If None, takes all the elements of considered dimension

  • relativeDimension (int (0, -1 or -2)) – difference between the dimension of the elements on which the function is computed and the dimensionality of the mesh

Returns:

of size (nbe of fields, numberOfIntegrationPoints)

Return type:

np.ndarray

BasicTools.FE.FETools.CheckIntegrity(GUI=False)[source]
BasicTools.FE.FETools.ComputeGradPhiAtIntegPoint(mesh, elementSets=None, relativeDimension=0, integrationRule={'bar2': (array([[0.21132487], [0.78867513]]), array([0.5, 0.5])), 'bar3': (array([[0.11270167], [0.5], [0.88729833]]), array([0.27777778, 0.44444444, 0.27777778])), 'hex20': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex27': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex8': (array([[0.21132487, 0.21132487, 0.21132487], [0.78867513, 0.21132487, 0.21132487], [0.21132487, 0.78867513, 0.21132487], [0.78867513, 0.78867513, 0.21132487], [0.21132487, 0.21132487, 0.78867513], [0.78867513, 0.21132487, 0.78867513], [0.21132487, 0.78867513, 0.78867513], [0.78867513, 0.78867513, 0.78867513]]), array([0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125])), 'point1': (array([[0]]), array([1.])), 'quad4': (array([[0.21132487, 0.21132487], [0.21132487, 0.78867513], [0.78867513, 0.21132487], [0.78867513, 0.78867513]]), array([0.25, 0.25, 0.25, 0.25])), 'quad8': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'quad9': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'tet10': (array([[0.16666667, 0.16666667, 0.16666667], [0.5, 0.16666667, 0.16666667], [0.16666667, 0.5, 0.16666667], [0.16666667, 0.16666667, 0.5], [0.25, 0.25, 0.25]]), array([0.075, 0.075, 0.075, 0.075, -0.13333333])), 'tet4': (array([[0.25, 0.25, 0.25]]), array([0.16666667])), 'tri3': (array([[0.16666667, 0.16666667], [0.66666667, 0.16666667], [0.16666667, 0.66666667]]), array([0.16666667, 0.16666667, 0.16666667])), 'tri6': (array([[0.44594849, 0.44594849, 0.], [0.10810302, 0.44594849, 0.], [0.44594849, 0.10810302, 0.], [0.09157621, 0.09157621, 0.], [0.81684757, 0.09157621, 0.], [0.09157621, 0.81684757, 0.]]), array([0.11169079, 0.11169079, 0.11169079, 0.05497587, 0.05497587, 0.05497587])), 'wed6': (array([[0.16666667, 0.16666667, 0.21132487], [0.16666667, 0.16666667, 0.78867513], [0.66666667, 0.16666667, 0.21132487], [0.66666667, 0.16666667, 0.78867513], [0.16666667, 0.66666667, 0.21132487], [0.16666667, 0.66666667, 0.78867513]]), array([0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333]))})[source]

Computes the components of the gradient of the shape functions on the integration points and the integration weights associated with the integration scheme

Parameters:
  • mesh (UnstructuredMesh) – mesh on which the function is applied

  • elementSets (list of strings) – element sets, support for the shape functions

  • relativeDimension (int) – 0, -1, or -2: the dimension of the element set relative to the dimension of the mesh

Returns:

  • np.ndarray – integrationWeights

  • list (length dimensionality of the mesh) coo_matrix of size (NGauss, nbNodes) – gradPhiAtIntegPoint

BasicTools.FE.FETools.ComputeH10ScalarProductMatrix(mesh, numberOfComponents, integrationRule={'bar2': (array([[0.21132487], [0.78867513]]), array([0.5, 0.5])), 'bar3': (array([[0.11270167], [0.5], [0.88729833]]), array([0.27777778, 0.44444444, 0.27777778])), 'hex20': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex27': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex8': (array([[0.21132487, 0.21132487, 0.21132487], [0.78867513, 0.21132487, 0.21132487], [0.21132487, 0.78867513, 0.21132487], [0.78867513, 0.78867513, 0.21132487], [0.21132487, 0.21132487, 0.78867513], [0.78867513, 0.21132487, 0.78867513], [0.21132487, 0.78867513, 0.78867513], [0.78867513, 0.78867513, 0.78867513]]), array([0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125])), 'point1': (array([[0]]), array([1.])), 'quad4': (array([[0.21132487, 0.21132487], [0.21132487, 0.78867513], [0.78867513, 0.21132487], [0.78867513, 0.78867513]]), array([0.25, 0.25, 0.25, 0.25])), 'quad8': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'quad9': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'tet10': (array([[0.16666667, 0.16666667, 0.16666667], [0.5, 0.16666667, 0.16666667], [0.16666667, 0.5, 0.16666667], [0.16666667, 0.16666667, 0.5], [0.25, 0.25, 0.25]]), array([0.075, 0.075, 0.075, 0.075, -0.13333333])), 'tet4': (array([[0.25, 0.25, 0.25]]), array([0.16666667])), 'tri3': (array([[0.16666667, 0.16666667], [0.66666667, 0.16666667], [0.16666667, 0.66666667]]), array([0.16666667, 0.16666667, 0.16666667])), 'tri6': (array([[0.44594849, 0.44594849, 0.], [0.10810302, 0.44594849, 0.], [0.44594849, 0.10810302, 0.], [0.09157621, 0.09157621, 0.], [0.81684757, 0.09157621, 0.], [0.09157621, 0.81684757, 0.]]), array([0.11169079, 0.11169079, 0.11169079, 0.05497587, 0.05497587, 0.05497587])), 'wed6': (array([[0.16666667, 0.16666667, 0.21132487], [0.16666667, 0.16666667, 0.78867513], [0.66666667, 0.16666667, 0.21132487], [0.66666667, 0.16666667, 0.78867513], [0.16666667, 0.66666667, 0.21132487], [0.16666667, 0.66666667, 0.78867513]]), array([0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333]))})[source]

Computes the H10 scalar product used to compute the correlations between the primal solution snapshots. The numberOfComponents depends on the solution type: 3 for solid mechanics in 3D, or 1 for thermal in any dimension (Lagrange isoparametric finite elements)

Parameters:
  • mesh (UnstructuredMesh) – mesh on which the function is applied

  • numberOfComponents (int) – the number of components of the primal variable snapshots

Returns:

the sparse matrix of the H10 scalar product

Return type:

scipy.sparse.csr_matrix

BasicTools.FE.FETools.ComputeIntegrationPointsTags(mesh, dimension=None, integrationRule={'bar2': (array([[0.21132487], [0.78867513]]), array([0.5, 0.5])), 'bar3': (array([[0.11270167], [0.5], [0.88729833]]), array([0.27777778, 0.44444444, 0.27777778])), 'hex20': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex27': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex8': (array([[0.21132487, 0.21132487, 0.21132487], [0.78867513, 0.21132487, 0.21132487], [0.21132487, 0.78867513, 0.21132487], [0.78867513, 0.78867513, 0.21132487], [0.21132487, 0.21132487, 0.78867513], [0.78867513, 0.21132487, 0.78867513], [0.21132487, 0.78867513, 0.78867513], [0.78867513, 0.78867513, 0.78867513]]), array([0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125])), 'point1': (array([[0]]), array([1.])), 'quad4': (array([[0.21132487, 0.21132487], [0.21132487, 0.78867513], [0.78867513, 0.21132487], [0.78867513, 0.78867513]]), array([0.25, 0.25, 0.25, 0.25])), 'quad8': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'quad9': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'tet10': (array([[0.16666667, 0.16666667, 0.16666667], [0.5, 0.16666667, 0.16666667], [0.16666667, 0.5, 0.16666667], [0.16666667, 0.16666667, 0.5], [0.25, 0.25, 0.25]]), array([0.075, 0.075, 0.075, 0.075, -0.13333333])), 'tet4': (array([[0.25, 0.25, 0.25]]), array([0.16666667])), 'tri3': (array([[0.16666667, 0.16666667], [0.66666667, 0.16666667], [0.16666667, 0.66666667]]), array([0.16666667, 0.16666667, 0.16666667])), 'tri6': (array([[0.44594849, 0.44594849, 0.], [0.10810302, 0.44594849, 0.], [0.44594849, 0.10810302, 0.], [0.09157621, 0.09157621, 0.], [0.81684757, 0.09157621, 0.], [0.09157621, 0.81684757, 0.]]), array([0.11169079, 0.11169079, 0.11169079, 0.05497587, 0.05497587, 0.05497587])), 'wed6': (array([[0.16666667, 0.16666667, 0.21132487], [0.16666667, 0.16666667, 0.78867513], [0.66666667, 0.16666667, 0.21132487], [0.66666667, 0.16666667, 0.78867513], [0.16666667, 0.66666667, 0.21132487], [0.16666667, 0.66666667, 0.78867513]]), array([0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333]))})[source]

Returns a list of lists (of str) at each integration point (Lagrange isoparametric finite elements). Each list contains all the tags of the element of dimension “dimension” containg the considered integration points

Parameters:
  • mesh (UnstructuredMesh) – mesh on which the function is applied

  • elementSets (list if strings) – sets of elements on which the function is computed

Returns:

of length numberOfIntegrationPoints

Return type:

list of lists (of str)

BasicTools.FE.FETools.ComputeInterpolationMatrix_FE_GaussPoint(mesh, feSpace, integrationRule, feNumbering=None, ipNumbering=None, elementFilter=None)[source]
BasicTools.FE.FETools.ComputeJdetAtIntegPoint(mesh, elementSets=None, relativeDimension=0, integrationRule={'bar2': (array([[0.21132487], [0.78867513]]), array([0.5, 0.5])), 'bar3': (array([[0.11270167], [0.5], [0.88729833]]), array([0.27777778, 0.44444444, 0.27777778])), 'hex20': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex27': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex8': (array([[0.21132487, 0.21132487, 0.21132487], [0.78867513, 0.21132487, 0.21132487], [0.21132487, 0.78867513, 0.21132487], [0.78867513, 0.78867513, 0.21132487], [0.21132487, 0.21132487, 0.78867513], [0.78867513, 0.21132487, 0.78867513], [0.21132487, 0.78867513, 0.78867513], [0.78867513, 0.78867513, 0.78867513]]), array([0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125])), 'point1': (array([[0]]), array([1.])), 'quad4': (array([[0.21132487, 0.21132487], [0.21132487, 0.78867513], [0.78867513, 0.21132487], [0.78867513, 0.78867513]]), array([0.25, 0.25, 0.25, 0.25])), 'quad8': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'quad9': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'tet10': (array([[0.16666667, 0.16666667, 0.16666667], [0.5, 0.16666667, 0.16666667], [0.16666667, 0.5, 0.16666667], [0.16666667, 0.16666667, 0.5], [0.25, 0.25, 0.25]]), array([0.075, 0.075, 0.075, 0.075, -0.13333333])), 'tet4': (array([[0.25, 0.25, 0.25]]), array([0.16666667])), 'tri3': (array([[0.16666667, 0.16666667], [0.66666667, 0.16666667], [0.16666667, 0.66666667]]), array([0.16666667, 0.16666667, 0.16666667])), 'tri6': (array([[0.44594849, 0.44594849, 0.], [0.10810302, 0.44594849, 0.], [0.44594849, 0.10810302, 0.], [0.09157621, 0.09157621, 0.], [0.81684757, 0.09157621, 0.], [0.09157621, 0.81684757, 0.]]), array([0.11169079, 0.11169079, 0.11169079, 0.05497587, 0.05497587, 0.05497587])), 'wed6': (array([[0.16666667, 0.16666667, 0.21132487], [0.16666667, 0.16666667, 0.78867513], [0.66666667, 0.16666667, 0.21132487], [0.66666667, 0.16666667, 0.78867513], [0.16666667, 0.66666667, 0.21132487], [0.16666667, 0.66666667, 0.78867513]]), array([0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333]))})[source]

Computes determinant of the Jacobian of the transformation of the transformation between the reference element and the mesh element, at the integration points. (Lagrange isoparametric finite elements)

Parameters:
  • mesh (UnstructuredMesh) – mesh on which the function is applied

  • elementSets (list if strings) – sets of elements on which the det-Jacobians are computed

  • relativeDimension (int (0, -1 or -2)) – difference between the dimension of the elements on which the function is computed and the dimensionality of the mesh

Returns:

of size (NGauss,)

Return type:

np.ndarray

BasicTools.FE.FETools.ComputeL2ScalarProducMatrix(mesh, numberOfComponents, elementFilter=None, integrationRule={'bar2': (array([[0.21132487], [0.78867513]]), array([0.5, 0.5])), 'bar3': (array([[0.11270167], [0.5], [0.88729833]]), array([0.27777778, 0.44444444, 0.27777778])), 'hex20': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex27': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex8': (array([[0.21132487, 0.21132487, 0.21132487], [0.78867513, 0.21132487, 0.21132487], [0.21132487, 0.78867513, 0.21132487], [0.78867513, 0.78867513, 0.21132487], [0.21132487, 0.21132487, 0.78867513], [0.78867513, 0.21132487, 0.78867513], [0.21132487, 0.78867513, 0.78867513], [0.78867513, 0.78867513, 0.78867513]]), array([0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125])), 'point1': (array([[0]]), array([1.])), 'quad4': (array([[0.21132487, 0.21132487], [0.21132487, 0.78867513], [0.78867513, 0.21132487], [0.78867513, 0.78867513]]), array([0.25, 0.25, 0.25, 0.25])), 'quad8': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'quad9': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'tet10': (array([[0.16666667, 0.16666667, 0.16666667], [0.5, 0.16666667, 0.16666667], [0.16666667, 0.5, 0.16666667], [0.16666667, 0.16666667, 0.5], [0.25, 0.25, 0.25]]), array([0.075, 0.075, 0.075, 0.075, -0.13333333])), 'tet4': (array([[0.25, 0.25, 0.25]]), array([0.16666667])), 'tri3': (array([[0.16666667, 0.16666667], [0.66666667, 0.16666667], [0.16666667, 0.66666667]]), array([0.16666667, 0.16666667, 0.16666667])), 'tri6': (array([[0.44594849, 0.44594849, 0.], [0.10810302, 0.44594849, 0.], [0.44594849, 0.10810302, 0.], [0.09157621, 0.09157621, 0.], [0.81684757, 0.09157621, 0.], [0.09157621, 0.81684757, 0.]]), array([0.11169079, 0.11169079, 0.11169079, 0.05497587, 0.05497587, 0.05497587])), 'wed6': (array([[0.16666667, 0.16666667, 0.21132487], [0.16666667, 0.16666667, 0.78867513], [0.66666667, 0.16666667, 0.21132487], [0.66666667, 0.16666667, 0.78867513], [0.16666667, 0.66666667, 0.21132487], [0.16666667, 0.66666667, 0.78867513]]), array([0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333]))})[source]

Computes the L2 scalar product used to compute the correlations between the primal solution snapshots. The numberOfComponents depends on the solution type: 3 for solid mechanics in 3D, or 1 for thermal in any dimension. (Lagrange isoparametric finite elements)

Parameters:
  • mesh (UnstructuredMesh) – mesh on which the function is applied

  • numberOfComponents (int) – the number of components

  • elementFilter (ElementFilter, optional) – Filter on which the function is applied

Returns:

the sparse matrix of the L2 scalar product

Return type:

scipy.sparse.csr_matrix

BasicTools.FE.FETools.ComputeNormalsAtIntegPoint(mesh, elementSets, integrationRule={'bar2': (array([[0.21132487], [0.78867513]]), array([0.5, 0.5])), 'bar3': (array([[0.11270167], [0.5], [0.88729833]]), array([0.27777778, 0.44444444, 0.27777778])), 'hex20': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex27': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex8': (array([[0.21132487, 0.21132487, 0.21132487], [0.78867513, 0.21132487, 0.21132487], [0.21132487, 0.78867513, 0.21132487], [0.78867513, 0.78867513, 0.21132487], [0.21132487, 0.21132487, 0.78867513], [0.78867513, 0.21132487, 0.78867513], [0.21132487, 0.78867513, 0.78867513], [0.78867513, 0.78867513, 0.78867513]]), array([0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125])), 'point1': (array([[0]]), array([1.])), 'quad4': (array([[0.21132487, 0.21132487], [0.21132487, 0.78867513], [0.78867513, 0.21132487], [0.78867513, 0.78867513]]), array([0.25, 0.25, 0.25, 0.25])), 'quad8': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'quad9': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'tet10': (array([[0.16666667, 0.16666667, 0.16666667], [0.5, 0.16666667, 0.16666667], [0.16666667, 0.5, 0.16666667], [0.16666667, 0.16666667, 0.5], [0.25, 0.25, 0.25]]), array([0.075, 0.075, 0.075, 0.075, -0.13333333])), 'tet4': (array([[0.25, 0.25, 0.25]]), array([0.16666667])), 'tri3': (array([[0.16666667, 0.16666667], [0.66666667, 0.16666667], [0.16666667, 0.66666667]]), array([0.16666667, 0.16666667, 0.16666667])), 'tri6': (array([[0.44594849, 0.44594849, 0.], [0.10810302, 0.44594849, 0.], [0.44594849, 0.10810302, 0.], [0.09157621, 0.09157621, 0.], [0.81684757, 0.09157621, 0.], [0.09157621, 0.81684757, 0.]]), array([0.11169079, 0.11169079, 0.11169079, 0.05497587, 0.05497587, 0.05497587])), 'wed6': (array([[0.16666667, 0.16666667, 0.21132487], [0.16666667, 0.16666667, 0.78867513], [0.66666667, 0.16666667, 0.21132487], [0.66666667, 0.16666667, 0.78867513], [0.16666667, 0.66666667, 0.21132487], [0.16666667, 0.66666667, 0.78867513]]), array([0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333]))})[source]

Computes the normals at the elements from the sets elementSets in the ambiant space (i.e. if mesh is of dimensionality 3, elementSets should contain 2D elements)

Parameters:
  • mesh (UnstructuredMesh) – mesh on which the function is applied

  • elementSets (list of strings) – sets of elements on which the function is computed

Returns:

of size (dimensionality, NGauss)

Return type:

np.ndarray

BasicTools.FE.FETools.ComputePhiAtIntegPoint(mesh, elementSets=None, relativeDimension=0, integrationRule={'bar2': (array([[0.21132487], [0.78867513]]), array([0.5, 0.5])), 'bar3': (array([[0.11270167], [0.5], [0.88729833]]), array([0.27777778, 0.44444444, 0.27777778])), 'hex20': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex27': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex8': (array([[0.21132487, 0.21132487, 0.21132487], [0.78867513, 0.21132487, 0.21132487], [0.21132487, 0.78867513, 0.21132487], [0.78867513, 0.78867513, 0.21132487], [0.21132487, 0.21132487, 0.78867513], [0.78867513, 0.21132487, 0.78867513], [0.21132487, 0.78867513, 0.78867513], [0.78867513, 0.78867513, 0.78867513]]), array([0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125])), 'point1': (array([[0]]), array([1.])), 'quad4': (array([[0.21132487, 0.21132487], [0.21132487, 0.78867513], [0.78867513, 0.21132487], [0.78867513, 0.78867513]]), array([0.25, 0.25, 0.25, 0.25])), 'quad8': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'quad9': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'tet10': (array([[0.16666667, 0.16666667, 0.16666667], [0.5, 0.16666667, 0.16666667], [0.16666667, 0.5, 0.16666667], [0.16666667, 0.16666667, 0.5], [0.25, 0.25, 0.25]]), array([0.075, 0.075, 0.075, 0.075, -0.13333333])), 'tet4': (array([[0.25, 0.25, 0.25]]), array([0.16666667])), 'tri3': (array([[0.16666667, 0.16666667], [0.66666667, 0.16666667], [0.16666667, 0.66666667]]), array([0.16666667, 0.16666667, 0.16666667])), 'tri6': (array([[0.44594849, 0.44594849, 0.], [0.10810302, 0.44594849, 0.], [0.44594849, 0.10810302, 0.], [0.09157621, 0.09157621, 0.], [0.81684757, 0.09157621, 0.], [0.09157621, 0.81684757, 0.]]), array([0.11169079, 0.11169079, 0.11169079, 0.05497587, 0.05497587, 0.05497587])), 'wed6': (array([[0.16666667, 0.16666667, 0.21132487], [0.16666667, 0.16666667, 0.78867513], [0.66666667, 0.16666667, 0.21132487], [0.66666667, 0.16666667, 0.78867513], [0.16666667, 0.66666667, 0.21132487], [0.16666667, 0.66666667, 0.78867513]]), array([0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333]))})[source]

Computes the value of the finite element shape functions at the integration points. (Lagrange isoparametric finite elements)

Parameters:
  • mesh (UnstructuredMesh) – mesh on which the function is applied

  • elementSets (list if strings) – sets of elements on which the det-Jacobians are computed

  • relativeDimension (int (0, -1 or -2)) – difference between the dimension of the elements on which the function is computed and the dimensionality of the mesh

Returns:

  • np.ndarray – of size (NGauss,)

  • coo_matrix – of size (NGauss, nbNodes)

BasicTools.FE.FETools.ComputePhiAtIntegPointFromElFilter(mesh, elFilter, space={'bar2': <BasicTools.FE.Spaces.BarSpaces.Bar_P1_Lagrange object>, 'bar3': <BasicTools.FE.Spaces.BarSpaces.Bar_P2_Lagrange object>, 'hex20': <BasicTools.FE.Spaces.HexaSpaces.Hexa20_P2_Lagrange object>, 'hex27': <BasicTools.FE.Spaces.HexaSpaces.Hexa_P2_Lagrange object>, 'hex8': <BasicTools.FE.Spaces.HexaSpaces.Hexa_P1_Lagrange object>, 'point1': <BasicTools.FE.Spaces.PointSpaces.Point_P0_Lagrange object>, 'quad4': <BasicTools.FE.Spaces.QuadSpaces.Quad_P1_Lagrange object>, 'quad8': <BasicTools.FE.Spaces.QuadSpaces.Quad8_P2_Lagrange object>, 'quad9': <BasicTools.FE.Spaces.QuadSpaces.Quad_P2_Lagrange object>, 'tet10': <BasicTools.FE.Spaces.TetSpaces.Tet_P2_Lagrange object>, 'tet4': <BasicTools.FE.Spaces.TetSpaces.Tet_P1_Lagrange object>, 'tri3': <BasicTools.FE.Spaces.TriSpaces.Tri_P1_Lagrange object>, 'tri6': <BasicTools.FE.Spaces.TriSpaces.Tri_P2_Lagrange object>, 'wed6': <BasicTools.FE.Spaces.WedgeSpaces.Wedge_P1_Lagrange object>}, integrationRule={'bar2': (array([[0.21132487],        [0.78867513]]), array([0.5, 0.5])), 'bar3': (array([[0.11270167],        [0.5       ],        [0.88729833]]), array([0.27777778, 0.44444444, 0.27777778])), 'hex20': (array([[0.11270167, 0.11270167, 0.11270167],        [0.5       , 0.11270167, 0.11270167],        [0.88729833, 0.11270167, 0.11270167],        [0.11270167, 0.5       , 0.11270167],        [0.5       , 0.5       , 0.11270167],        [0.88729833, 0.5       , 0.11270167],        [0.11270167, 0.88729833, 0.11270167],        [0.5       , 0.88729833, 0.11270167],        [0.88729833, 0.88729833, 0.11270167],        [0.11270167, 0.11270167, 0.5       ],        [0.5       , 0.11270167, 0.5       ],        [0.88729833, 0.11270167, 0.5       ],        [0.11270167, 0.5       , 0.5       ],        [0.5       , 0.5       , 0.5       ],        [0.88729833, 0.5       , 0.5       ],        [0.11270167, 0.88729833, 0.5       ],        [0.5       , 0.88729833, 0.5       ],        [0.88729833, 0.88729833, 0.5       ],        [0.11270167, 0.11270167, 0.88729833],        [0.5       , 0.11270167, 0.88729833],        [0.88729833, 0.11270167, 0.88729833],        [0.11270167, 0.5       , 0.88729833],        [0.5       , 0.5       , 0.88729833],        [0.88729833, 0.5       , 0.88729833],        [0.11270167, 0.88729833, 0.88729833],        [0.5       , 0.88729833, 0.88729833],        [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968,        0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355,        0.05486968, 0.03429355, 0.05486968, 0.0877915 , 0.05486968,        0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355,        0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347,        0.03429355, 0.02143347])), 'hex27': (array([[0.11270167, 0.11270167, 0.11270167],        [0.5       , 0.11270167, 0.11270167],        [0.88729833, 0.11270167, 0.11270167],        [0.11270167, 0.5       , 0.11270167],        [0.5       , 0.5       , 0.11270167],        [0.88729833, 0.5       , 0.11270167],        [0.11270167, 0.88729833, 0.11270167],        [0.5       , 0.88729833, 0.11270167],        [0.88729833, 0.88729833, 0.11270167],        [0.11270167, 0.11270167, 0.5       ],        [0.5       , 0.11270167, 0.5       ],        [0.88729833, 0.11270167, 0.5       ],        [0.11270167, 0.5       , 0.5       ],        [0.5       , 0.5       , 0.5       ],        [0.88729833, 0.5       , 0.5       ],        [0.11270167, 0.88729833, 0.5       ],        [0.5       , 0.88729833, 0.5       ],        [0.88729833, 0.88729833, 0.5       ],        [0.11270167, 0.11270167, 0.88729833],        [0.5       , 0.11270167, 0.88729833],        [0.88729833, 0.11270167, 0.88729833],        [0.11270167, 0.5       , 0.88729833],        [0.5       , 0.5       , 0.88729833],        [0.88729833, 0.5       , 0.88729833],        [0.11270167, 0.88729833, 0.88729833],        [0.5       , 0.88729833, 0.88729833],        [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968,        0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355,        0.05486968, 0.03429355, 0.05486968, 0.0877915 , 0.05486968,        0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355,        0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347,        0.03429355, 0.02143347])), 'hex8': (array([[0.21132487, 0.21132487, 0.21132487],        [0.78867513, 0.21132487, 0.21132487],        [0.21132487, 0.78867513, 0.21132487],        [0.78867513, 0.78867513, 0.21132487],        [0.21132487, 0.21132487, 0.78867513],        [0.78867513, 0.21132487, 0.78867513],        [0.21132487, 0.78867513, 0.78867513],        [0.78867513, 0.78867513, 0.78867513]]), array([0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125])), 'point1': (array([[0]]), array([1.])), 'quad4': (array([[0.21132487, 0.21132487],        [0.21132487, 0.78867513],        [0.78867513, 0.21132487],        [0.78867513, 0.78867513]]), array([0.25, 0.25, 0.25, 0.25])), 'quad8': (array([[0.11270167, 0.11270167],        [0.11270167, 0.5       ],        [0.11270167, 0.88729833],        [0.5       , 0.11270167],        [0.5       , 0.5       ],        [0.5       , 0.88729833],        [0.88729833, 0.11270167],        [0.88729833, 0.5       ],        [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086,        0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'quad9': (array([[0.11270167, 0.11270167],        [0.11270167, 0.5       ],        [0.11270167, 0.88729833],        [0.5       , 0.11270167],        [0.5       , 0.5       ],        [0.5       , 0.88729833],        [0.88729833, 0.11270167],        [0.88729833, 0.5       ],        [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086,        0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'tet10': (array([[0.16666667, 0.16666667, 0.16666667],        [0.5       , 0.16666667, 0.16666667],        [0.16666667, 0.5       , 0.16666667],        [0.16666667, 0.16666667, 0.5       ],        [0.25      , 0.25      , 0.25      ]]), array([ 0.075     ,  0.075     ,  0.075     ,  0.075     , -0.13333333])), 'tet4': (array([[0.25, 0.25, 0.25]]), array([0.16666667])), 'tri3': (array([[0.16666667, 0.16666667],        [0.66666667, 0.16666667],        [0.16666667, 0.66666667]]), array([0.16666667, 0.16666667, 0.16666667])), 'tri6': (array([[0.44594849, 0.44594849, 0.        ],        [0.10810302, 0.44594849, 0.        ],        [0.44594849, 0.10810302, 0.        ],        [0.09157621, 0.09157621, 0.        ],        [0.81684757, 0.09157621, 0.        ],        [0.09157621, 0.81684757, 0.        ]]), array([0.11169079, 0.11169079, 0.11169079, 0.05497587, 0.05497587,        0.05497587])), 'wed6': (array([[0.16666667, 0.16666667, 0.21132487],        [0.16666667, 0.16666667, 0.78867513],        [0.66666667, 0.16666667, 0.21132487],        [0.66666667, 0.16666667, 0.78867513],        [0.16666667, 0.66666667, 0.21132487],        [0.16666667, 0.66666667, 0.78867513]]), array([0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333,        0.08333333]))})[source]

Computes the shape functions on the integration points and the integration weights associated with the integration scheme

Parameters:
Returns:

  • np.ndarray – integrationWeights

  • coo_matrix of size (NGauss, nbNodes) – phiAtIntegPointMatrix

BasicTools.FE.FETools.GetElementaryMatrixForFormulation(elemName, wform, unknownNames, space=BasicTools.FE.Spaces.FESpaces.LagrangeSpaceP1)[source]
BasicTools.FE.FETools.IntegrationPointsToCellData(mesh, scalarFields, integrationRule={'bar2': (array([[0.21132487], [0.78867513]]), array([0.5, 0.5])), 'bar3': (array([[0.11270167], [0.5], [0.88729833]]), array([0.27777778, 0.44444444, 0.27777778])), 'hex20': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex27': (array([[0.11270167, 0.11270167, 0.11270167], [0.5, 0.11270167, 0.11270167], [0.88729833, 0.11270167, 0.11270167], [0.11270167, 0.5, 0.11270167], [0.5, 0.5, 0.11270167], [0.88729833, 0.5, 0.11270167], [0.11270167, 0.88729833, 0.11270167], [0.5, 0.88729833, 0.11270167], [0.88729833, 0.88729833, 0.11270167], [0.11270167, 0.11270167, 0.5], [0.5, 0.11270167, 0.5], [0.88729833, 0.11270167, 0.5], [0.11270167, 0.5, 0.5], [0.5, 0.5, 0.5], [0.88729833, 0.5, 0.5], [0.11270167, 0.88729833, 0.5], [0.5, 0.88729833, 0.5], [0.88729833, 0.88729833, 0.5], [0.11270167, 0.11270167, 0.88729833], [0.5, 0.11270167, 0.88729833], [0.88729833, 0.11270167, 0.88729833], [0.11270167, 0.5, 0.88729833], [0.5, 0.5, 0.88729833], [0.88729833, 0.5, 0.88729833], [0.11270167, 0.88729833, 0.88729833], [0.5, 0.88729833, 0.88729833], [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.05486968, 0.0877915, 0.05486968, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355, 0.02143347])), 'hex8': (array([[0.21132487, 0.21132487, 0.21132487], [0.78867513, 0.21132487, 0.21132487], [0.21132487, 0.78867513, 0.21132487], [0.78867513, 0.78867513, 0.21132487], [0.21132487, 0.21132487, 0.78867513], [0.78867513, 0.21132487, 0.78867513], [0.21132487, 0.78867513, 0.78867513], [0.78867513, 0.78867513, 0.78867513]]), array([0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125])), 'point1': (array([[0]]), array([1.])), 'quad4': (array([[0.21132487, 0.21132487], [0.21132487, 0.78867513], [0.78867513, 0.21132487], [0.78867513, 0.78867513]]), array([0.25, 0.25, 0.25, 0.25])), 'quad8': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'quad9': (array([[0.11270167, 0.11270167], [0.11270167, 0.5], [0.11270167, 0.88729833], [0.5, 0.11270167], [0.5, 0.5], [0.5, 0.88729833], [0.88729833, 0.11270167], [0.88729833, 0.5], [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086, 0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'tet10': (array([[0.16666667, 0.16666667, 0.16666667], [0.5, 0.16666667, 0.16666667], [0.16666667, 0.5, 0.16666667], [0.16666667, 0.16666667, 0.5], [0.25, 0.25, 0.25]]), array([0.075, 0.075, 0.075, 0.075, -0.13333333])), 'tet4': (array([[0.25, 0.25, 0.25]]), array([0.16666667])), 'tri3': (array([[0.16666667, 0.16666667], [0.66666667, 0.16666667], [0.16666667, 0.66666667]]), array([0.16666667, 0.16666667, 0.16666667])), 'tri6': (array([[0.44594849, 0.44594849, 0.], [0.10810302, 0.44594849, 0.], [0.44594849, 0.10810302, 0.], [0.09157621, 0.09157621, 0.], [0.81684757, 0.09157621, 0.], [0.09157621, 0.81684757, 0.]]), array([0.11169079, 0.11169079, 0.11169079, 0.05497587, 0.05497587, 0.05497587])), 'wed6': (array([[0.16666667, 0.16666667, 0.21132487], [0.16666667, 0.16666667, 0.78867513], [0.66666667, 0.16666667, 0.21132487], [0.66666667, 0.16666667, 0.78867513], [0.16666667, 0.66666667, 0.21132487], [0.16666667, 0.66666667, 0.78867513]]), array([0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333]))})[source]

Change the representation of scalarFields from data at integration points to data constant by cell (elements) - taking the mean of values at the integration points in each elements. (Lagrange isoparametric finite elements)

Parameters:
  • mesh (UnstructuredMesh) – mesh on which the function is applied

  • scalarFields (np.ndarray of size (nbe of fields, nbe of elements) or dict) – with “nbe of fields” as keys and np.ndarray of size (nbe of elements,) as values fields whose representation in changed by the function

Returns:

of size (nbe of elements,)

Return type:

np.ndarray

BasicTools.FE.FETools.PrepareFEComputation(mesh, elementFilter=None, numberOfComponents=None, space={'bar2': <BasicTools.FE.Spaces.BarSpaces.Bar_P1_Lagrange object>, 'bar3': <BasicTools.FE.Spaces.BarSpaces.Bar_P2_Lagrange object>, 'hex20': <BasicTools.FE.Spaces.HexaSpaces.Hexa20_P2_Lagrange object>, 'hex27': <BasicTools.FE.Spaces.HexaSpaces.Hexa_P2_Lagrange object>, 'hex8': <BasicTools.FE.Spaces.HexaSpaces.Hexa_P1_Lagrange object>, 'point1': <BasicTools.FE.Spaces.PointSpaces.Point_P0_Lagrange object>, 'quad4': <BasicTools.FE.Spaces.QuadSpaces.Quad_P1_Lagrange object>, 'quad8': <BasicTools.FE.Spaces.QuadSpaces.Quad8_P2_Lagrange object>, 'quad9': <BasicTools.FE.Spaces.QuadSpaces.Quad_P2_Lagrange object>, 'tet10': <BasicTools.FE.Spaces.TetSpaces.Tet_P2_Lagrange object>, 'tet4': <BasicTools.FE.Spaces.TetSpaces.Tet_P1_Lagrange object>, 'tri3': <BasicTools.FE.Spaces.TriSpaces.Tri_P1_Lagrange object>, 'tri6': <BasicTools.FE.Spaces.TriSpaces.Tri_P2_Lagrange object>, 'wed6': <BasicTools.FE.Spaces.WedgeSpaces.Wedge_P1_Lagrange object>}, integrationRule={'bar2': (array([[0.21132487],        [0.78867513]]), array([0.5, 0.5])), 'bar3': (array([[0.11270167],        [0.5       ],        [0.88729833]]), array([0.27777778, 0.44444444, 0.27777778])), 'hex20': (array([[0.11270167, 0.11270167, 0.11270167],        [0.5       , 0.11270167, 0.11270167],        [0.88729833, 0.11270167, 0.11270167],        [0.11270167, 0.5       , 0.11270167],        [0.5       , 0.5       , 0.11270167],        [0.88729833, 0.5       , 0.11270167],        [0.11270167, 0.88729833, 0.11270167],        [0.5       , 0.88729833, 0.11270167],        [0.88729833, 0.88729833, 0.11270167],        [0.11270167, 0.11270167, 0.5       ],        [0.5       , 0.11270167, 0.5       ],        [0.88729833, 0.11270167, 0.5       ],        [0.11270167, 0.5       , 0.5       ],        [0.5       , 0.5       , 0.5       ],        [0.88729833, 0.5       , 0.5       ],        [0.11270167, 0.88729833, 0.5       ],        [0.5       , 0.88729833, 0.5       ],        [0.88729833, 0.88729833, 0.5       ],        [0.11270167, 0.11270167, 0.88729833],        [0.5       , 0.11270167, 0.88729833],        [0.88729833, 0.11270167, 0.88729833],        [0.11270167, 0.5       , 0.88729833],        [0.5       , 0.5       , 0.88729833],        [0.88729833, 0.5       , 0.88729833],        [0.11270167, 0.88729833, 0.88729833],        [0.5       , 0.88729833, 0.88729833],        [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968,        0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355,        0.05486968, 0.03429355, 0.05486968, 0.0877915 , 0.05486968,        0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355,        0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347,        0.03429355, 0.02143347])), 'hex27': (array([[0.11270167, 0.11270167, 0.11270167],        [0.5       , 0.11270167, 0.11270167],        [0.88729833, 0.11270167, 0.11270167],        [0.11270167, 0.5       , 0.11270167],        [0.5       , 0.5       , 0.11270167],        [0.88729833, 0.5       , 0.11270167],        [0.11270167, 0.88729833, 0.11270167],        [0.5       , 0.88729833, 0.11270167],        [0.88729833, 0.88729833, 0.11270167],        [0.11270167, 0.11270167, 0.5       ],        [0.5       , 0.11270167, 0.5       ],        [0.88729833, 0.11270167, 0.5       ],        [0.11270167, 0.5       , 0.5       ],        [0.5       , 0.5       , 0.5       ],        [0.88729833, 0.5       , 0.5       ],        [0.11270167, 0.88729833, 0.5       ],        [0.5       , 0.88729833, 0.5       ],        [0.88729833, 0.88729833, 0.5       ],        [0.11270167, 0.11270167, 0.88729833],        [0.5       , 0.11270167, 0.88729833],        [0.88729833, 0.11270167, 0.88729833],        [0.11270167, 0.5       , 0.88729833],        [0.5       , 0.5       , 0.88729833],        [0.88729833, 0.5       , 0.88729833],        [0.11270167, 0.88729833, 0.88729833],        [0.5       , 0.88729833, 0.88729833],        [0.88729833, 0.88729833, 0.88729833]]), array([0.02143347, 0.03429355, 0.02143347, 0.03429355, 0.05486968,        0.03429355, 0.02143347, 0.03429355, 0.02143347, 0.03429355,        0.05486968, 0.03429355, 0.05486968, 0.0877915 , 0.05486968,        0.03429355, 0.05486968, 0.03429355, 0.02143347, 0.03429355,        0.02143347, 0.03429355, 0.05486968, 0.03429355, 0.02143347,        0.03429355, 0.02143347])), 'hex8': (array([[0.21132487, 0.21132487, 0.21132487],        [0.78867513, 0.21132487, 0.21132487],        [0.21132487, 0.78867513, 0.21132487],        [0.78867513, 0.78867513, 0.21132487],        [0.21132487, 0.21132487, 0.78867513],        [0.78867513, 0.21132487, 0.78867513],        [0.21132487, 0.78867513, 0.78867513],        [0.78867513, 0.78867513, 0.78867513]]), array([0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125])), 'point1': (array([[0]]), array([1.])), 'quad4': (array([[0.21132487, 0.21132487],        [0.21132487, 0.78867513],        [0.78867513, 0.21132487],        [0.78867513, 0.78867513]]), array([0.25, 0.25, 0.25, 0.25])), 'quad8': (array([[0.11270167, 0.11270167],        [0.11270167, 0.5       ],        [0.11270167, 0.88729833],        [0.5       , 0.11270167],        [0.5       , 0.5       ],        [0.5       , 0.88729833],        [0.88729833, 0.11270167],        [0.88729833, 0.5       ],        [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086,        0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'quad9': (array([[0.11270167, 0.11270167],        [0.11270167, 0.5       ],        [0.11270167, 0.88729833],        [0.5       , 0.11270167],        [0.5       , 0.5       ],        [0.5       , 0.88729833],        [0.88729833, 0.11270167],        [0.88729833, 0.5       ],        [0.88729833, 0.88729833]]), array([0.07716049, 0.12345679, 0.07716049, 0.12345679, 0.19753086,        0.12345679, 0.07716049, 0.12345679, 0.07716049])), 'tet10': (array([[0.16666667, 0.16666667, 0.16666667],        [0.5       , 0.16666667, 0.16666667],        [0.16666667, 0.5       , 0.16666667],        [0.16666667, 0.16666667, 0.5       ],        [0.25      , 0.25      , 0.25      ]]), array([ 0.075     ,  0.075     ,  0.075     ,  0.075     , -0.13333333])), 'tet4': (array([[0.25, 0.25, 0.25]]), array([0.16666667])), 'tri3': (array([[0.16666667, 0.16666667],        [0.66666667, 0.16666667],        [0.16666667, 0.66666667]]), array([0.16666667, 0.16666667, 0.16666667])), 'tri6': (array([[0.44594849, 0.44594849, 0.        ],        [0.10810302, 0.44594849, 0.        ],        [0.44594849, 0.10810302, 0.        ],        [0.09157621, 0.09157621, 0.        ],        [0.81684757, 0.09157621, 0.        ],        [0.09157621, 0.81684757, 0.        ]]), array([0.11169079, 0.11169079, 0.11169079, 0.05497587, 0.05497587,        0.05497587])), 'wed6': (array([[0.16666667, 0.16666667, 0.21132487],        [0.16666667, 0.16666667, 0.78867513],        [0.66666667, 0.16666667, 0.21132487],        [0.66666667, 0.16666667, 0.78867513],        [0.16666667, 0.66666667, 0.21132487],        [0.16666667, 0.66666667, 0.78867513]]), array([0.08333333, 0.08333333, 0.08333333, 0.08333333, 0.08333333,        0.08333333]))})[source]

Prepares a finite element computation with Lagrange isoparametric finite elements by computing FESpace, numberings, offset and NGauss

Parameters:
  • mesh (UnstructuredMesh) – mesh on which the function is applied

  • elementFilter (ElementFilter, optional) – Filter on which the function is applied

  • numberOfComponents (int) – the number of components

Returns:

  • FESpace

  • numberings

  • offset (list of int)

  • NGauss (int)