GMSH#

Gmsh and related objects.

class volmdlr.gmsh_vm.GmshParser(mesh_format: Dict[any, any], nodes: Dict[any, any], elements: Dict[any, any], entities: Dict[any, any], physical_names=None, partitioned_entities=None, periodic=None, parametrizations=None, node_data=None, element_data=None, element_node_data=None, name: str = '')[source]#

Bases: DessiaObject

A class to read and parse a .msh file to extract mesh data.

static check_2d(list_nodes)[source]#

Check if the nodes are defined on 2D or not.

Parameters:

list_nodes (List[volmdlr.mesh.Node2D]) – A list of points (nodes)

Returns:

True or False

Return type:

bool

define_quadratic_tetrahedron_element_mesh()[source]#

Defines a volmdlr mesh with Quadratic TetrahedronElement from a .msh file.

define_tetrahedron_element_mesh()[source]#

Defines a volmdlr mesh with TetrahedronElement from a .msh file.

define_triangular_element_mesh()[source]#

Defines a volmdlr mesh with TriangularElement from a .msh file.

classmethod from_file(file_stream: BinaryFile, name: str = '')[source]#

Defines a gmsh object from .msh file.

static from_file_element_data(lines)[source]#

Gets mesh element_data from .msh file.

static from_file_element_node_data(lines)[source]#

Gets mesh element_node_data from .msh file.

static from_file_elements(lines)[source]#

Gets elements data from .msh file.

static from_file_entities(lines)[source]#

Gets entities data from .msh file.

static from_file_ghost_elements(lines)[source]#

Gets mesh ghost_elements from .msh file.

static from_file_interpolation_scheme(lines)[source]#

Gets mesh interpolation_scheme from .msh file.

static from_file_mesh_format(lines)[source]#

Gets mesh format data from .msh file.

static from_file_node_data(lines)[source]#

Gets mesh node_data from .msh file.

static from_file_nodes(lines)[source]#

Gets mesh nodes from .msh file.

static from_file_parametrizations(lines)[source]#

Gets mesh parametrization from .msh file.

static from_file_partitioned_entities(lines)[source]#

Gets mesh partitioned_entities from .msh file.

static from_file_periodic(lines)[source]#

Gets mesh periodic from .msh file.

static from_file_physical_names(lines)[source]#

Gets mesh physical_names from .msh file.

get_lines_cells()[source]#

Gets lines related to cells data.

Returns:

a list of lines

Return type:

List[str]

get_lines_cells_type()[source]#

Gets lines related to cells type data.

Returns:

a list of lines

Return type:

List[str]

get_lines_nodes()[source]#

Gets lines related to nodes data.

Returns:

a list of lines

Return type:

List[str]

static read_file(file_path: str)[source]#

Gets lines from a .msh file.

static to_2d(list_nodes)[source]#

Convert a list of Node3D to a list of Node2D.

Parameters:

list_nodes (List[volmdlr.mesh.Node2D]) – A list of points3d (nodes)

Returns:

A list of points2d (nodes)

Return type:

List[volmdlr.mesh.Node2D]

to_vtk(output_file_name)[source]#

Create a .vtk file from a GmshParser data.

Parameters:

output_file_name (TYPE) – DESCRIPTION

Returns:

DESCRIPTION

Return type:

TYPE