Test Parser

To test integrity of GMsh parser.

class test_parser.TestElemetsParser

To test elements parsed from mesh file.

test__1_element__given_1d_mesh()

AIM: To check whether number of nodes per element matches expected value.

EXPECTED: True, as the number of nodes per element in a 1d mesh is known. The check is done using the N_ELEM parameter to check for the last element in the msh file.

test__1_element__given_2d_mesh()

AIM: To check whether number of nodes per element matches expected value.

EXPECTED: True, as the number of nodes per element in a 1d mesh is known. The check is done using the N_ELEM parameter to check for the last element in the msh file.

test__boundary_elements__given_1d_mesh()

AIM: To check whether number of boundary elements for a given mesh.

EXPECTED: True, as the number of boundary elements in this case is 2, as it is a 1d mesh. The boundary elements in question are the two ends of the mesh.

test__boundary_elements__given_2d_mesh()

AIM: To check whether number of boundary elements for a given mesh.

EXPECTED: True, as the number of boundary elements in this case is 4, as it is a 2d quadrilateral mesh. The boundary elements in question are the edges of the mesh.

test__n_elem__given_1d_mesh()

AIM: To check whether number of elements matches expected value.

EXPECTED: True, as the number of elements is known from the definition of gmsh file. GMsh exports nodes as point elements and lines as expected from 1d mesh. The total values 2 + 2 = 4.

test__n_elem__given_2d_mesh()

AIM: To check whether number of elements matches expected value.

EXPECTED: True, as the number of elements is known from the definition of gmsh file. GMsh exports nodes as point elements and lines as well as quadrilateral element as expected from 2d mesh. The total values 4 + 4 + 1 = 4.

class test_parser.TestNodesParser

To test nodes parsed from mesh file.

test__n_nodes__given_2d_mesh()

AIM: To check whether number of nodes matches expected value for a 2d mesh.

EXPECTED: True, as the number of nodes is known from the definition of gmsh file. The values should match.

test__n_nodes_given_1d_mesh()

AIM: To check whether number of nodes matches expected value for a 1d mesh.

EXPECTED: True, as the number of nodes is known from the definition of gmsh file. The values should match.