def __init__(self, salome_mesh, mesh_description, model_part_name=""):
        """Keyword arguments:
        salome_mesh -- the Salome mesh to access. Depending on the type the corresponding conversion is performed before creating a MeshInterface that is then passed to the base class
        mesh_description -- see base class
        model_part_name -- see base class
        """

        if isinstance(salome_mesh, str):
            mesh_identifier = salome_mesh
        elif any([
                salome_utilities.IsMeshProxy(salome_mesh),
                salome_utilities.IsSubMeshProxy(salome_mesh),
                salome_utilities.IsMeshGroup(salome_mesh)
        ]):
            mesh_identifier = salome_utilities.GetSalomeID(salome_mesh)
        elif salome_utilities.IsMesh(salome_mesh):
            mesh_identifier = salome_utilities.GetSalomeID(
                salome_mesh.GetMesh())
        else:
            err_msg = 'Type of argument "salome_mesh" not permitted: {}\n'.format(
                type(salome_mesh))
            err_msg += 'No mesh can be retrieved from this input!'.format(
                type(salome_mesh))
            raise Exception(err_msg)

        mesh_interface = MeshInterface(mesh_identifier)

        super().__init__(mesh_interface, mesh_description, model_part_name)
    def setUp(self):
        super().setUp()
        # this also tests the "CheckMeshIsValid" function right here
        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.domain_mesh.GetMesh())
        self.mesh_interface_domain_mesh = MeshInterface(
            existing_mesh_identifier)
        self.assertTrue(self.mesh_interface_domain_mesh.CheckMeshIsValid())

        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.neumann_mesh)
        self.mesh_interface_neumann = MeshInterface(existing_mesh_identifier)
        self.assertTrue(self.mesh_interface_neumann.CheckMeshIsValid())

        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.dirichlet_mesh)
        self.mesh_interface_dirichlet = MeshInterface(existing_mesh_identifier)
        self.assertTrue(self.mesh_interface_dirichlet.CheckMeshIsValid())
    def setUp(self):
        super().setUp()
        # this also tests the "CheckMeshIsValid" function right here
        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.mesh_tetra.GetMesh())
        self.mesh_interface_main_mesh_tetra = MeshInterface(
            existing_mesh_identifier)
        self.assertTrue(self.mesh_interface_main_mesh_tetra.CheckMeshIsValid())

        self.mesh_interface_non_exist_mesh = MeshInterface(
            existing_mesh_identifier)
        self.mesh_interface_non_exist_mesh.mesh_identifier = "1:55555:114777"  # has to be overwritten, otherwise throws in constructor
        self.assertFalse(self.mesh_interface_non_exist_mesh.CheckMeshIsValid())

        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.mesh_hexa.GetMesh())
        self.mesh_interface_main_mesh_hexa = MeshInterface(
            existing_mesh_identifier)
        self.assertTrue(self.mesh_interface_main_mesh_hexa.CheckMeshIsValid())

        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.sub_mesh_tetra_e_1)
        self.mesh_interface_sub_mesh_tetra_edge = MeshInterface(
            existing_mesh_identifier)
        self.assertTrue(
            self.mesh_interface_sub_mesh_tetra_edge.CheckMeshIsValid())

        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.sub_mesh_tetra_f_2)
        self.mesh_interface_sub_mesh_tetra_face = MeshInterface(
            existing_mesh_identifier)
        self.assertTrue(
            self.mesh_interface_sub_mesh_tetra_face.CheckMeshIsValid())

        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.sub_mesh_tetra_g_1)
        self.mesh_interface_sub_mesh_group_tetra_face = MeshInterface(
            existing_mesh_identifier)
        self.assertTrue(
            self.mesh_interface_sub_mesh_group_tetra_face.CheckMeshIsValid())

        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.sub_mesh_hexa_g_2)
        self.mesh_interface_sub_mesh_group_hexa_edge = MeshInterface(
            existing_mesh_identifier)
        self.assertTrue(
            self.mesh_interface_sub_mesh_group_hexa_edge.CheckMeshIsValid())

        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.sub_mesh_hexa_g_1)
        self.mesh_interface_sub_mesh_group_hexa_face = MeshInterface(
            existing_mesh_identifier)
        self.assertTrue(
            self.mesh_interface_sub_mesh_group_hexa_face.CheckMeshIsValid())

        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.sub_mesh_hexa_f_2)
        self.mesh_interface_sub_mesh_hexa_face = MeshInterface(
            existing_mesh_identifier)
        self.assertTrue(
            self.mesh_interface_sub_mesh_hexa_face.CheckMeshIsValid())

        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.group_tetra_0D_elements)
        self.mesh_interface_tetra_0D_elements = MeshInterface(
            existing_mesh_identifier)
        self.assertTrue(
            self.mesh_interface_tetra_0D_elements.CheckMeshIsValid())

        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.group_hexa_ball_elements)
        self.mesh_interface_hexa_ball_elements = MeshInterface(
            existing_mesh_identifier)
        self.assertTrue(
            self.mesh_interface_hexa_ball_elements.CheckMeshIsValid())

        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.group_tetra_f1_nodes)
        self.mesh_interface_tetra_mesh_group_f1_nodes = MeshInterface(
            existing_mesh_identifier)
        self.assertTrue(
            self.mesh_interface_tetra_mesh_group_f1_nodes.CheckMeshIsValid())

        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.group_tetra_f1_faces)
        self.mesh_interface_tetra_mesh_group_f1_faces = MeshInterface(
            existing_mesh_identifier)
        self.assertTrue(
            self.mesh_interface_tetra_mesh_group_f1_faces.CheckMeshIsValid())

        existing_mesh_identifier = salome_utilities.GetSalomeID(
            self.group_hexa_edges)
        self.mesh_interface_hexa_mesh_group_edges = MeshInterface(
            existing_mesh_identifier)
        self.assertTrue(
            self.mesh_interface_hexa_mesh_group_edges.CheckMeshIsValid())