mesh.py

Define functions for mesh handling.

petgem.mesh.mesh.get_nNodes_nElems(matrixNodal, matrixElems)[source]

Compute the number of elements and the number of nodes of a given mesh.

Params list matrixNodal:
 nodal coordinates.
Params list matrixElems:
 elemsN connectivity.
petgem.mesh.mesh.printMeshInfo(nElems, nEdges, dofs, bEdges)[source]

Print data mesh.

Parameters:
  • nElems (int) – number of elements.
  • nEdges (int) – number of edges.
  • dofs (int) – number of degrees of freedom.
  • bEdges (int) – number of boundary edges.
Returns:

none

petgem.mesh.mesh.readHdf5(file_name, DATA=None)[source]

Read an hdf5 file.

Parameters:
  • file_name (str) – file name to be readed.
  • DATA (str) – type of DATA to be readed: nodes, elemsN or elemsS.
Returns:

nodes, elemsN or elemsSigma.

Return type:

ndarray.

petgem.mesh.mesh.readMesh(input_modelling)[source]

Read a tetrahedral mesh defined by two HDF5 files: nodes description and elements connectivity description.

Parameters:input_modelling (dictionay) – csem_modelling dictionary.
Returns:arrays with nodes and elements connectivity.
Return type:ndarray.
petgem.mesh.mesh.unitary_test()[source]

Unitary test for mesh.py script.