# Path: pymicro/core/global_variables.py
# XDMF_FIELD_TYPE = {1: 'Scalar', 2: 'Vector', 3: 'Vector', 6: 'Tensor6',
#                    9: 'Tensor'}
# 
# XDMF_IMAGE_GEOMETRY = {'3DImage': 'ORIGIN_DXDYDZ', '2DImage': 'ORIGIN_DXDY'}
# 
# XDMF_IMAGE_TOPOLOGY = {'3DImage': '3DCoRectMesh', '2DImage': '2DCoRectMesh'}
# 
# Path: pymicro/core/global_variables.py
# SD_GROUP_TYPES = ['Group', '2DImage', '3DImage', '2DMesh', '3DMesh']
# 
# SD_GRID_GROUPS = ['2DImage', '3DImage', '2DMesh', '3DMesh', 'emptyImage',
#                   'emptyMesh']
# 
# SD_IMAGE_GROUPS = {2:'2DImage', 3:'3DImage', 0:'emptyImage', -1:'Image'}
# 
# SD_MESH_GROUPS = {2:'2DMesh', 3:'3DMesh', 0:'emptyMesh', -1:'Mesh'}


import os
import subprocess
import shutil
import numpy as np
import tables
import lxml.builder
import BasicTools.Containers.UnstructuredMeshCreationTools as UMCT
            import re
        import BasicTools.Containers.ElementNames as EN
        import BasicTools.Containers.ElementNames as EN
from lxml import etree
from pathlib import Path
from BasicTools.Containers.ConstantRectilinearMesh import (
    ConstantRectilinearMesh)
from BasicTools.Containers.UnstructuredMesh import (UnstructuredMesh,
                                                    AllElements)
from BasicTools.Containers.MeshBase import MeshBase
from BasicTools.IO.XdmfTools import XdmfName,XdmfNumber
from pymicro.core.global_variables import (XDMF_FIELD_TYPE,
                                           XDMF_IMAGE_GEOMETRY,
                                           XDMF_IMAGE_TOPOLOGY)
from pymicro.core.global_variables import (SD_GROUP_TYPES, SD_GRID_GROUPS,
                                           SD_IMAGE_GROUPS, SD_MESH_GROUPS)
        from BasicTools.IO.UniversalReader import ReadMesh
            max_path_level = max(value.count('/'), max_path_level)
        for level in range(max_path_level):
            self._verbose_print(f'Initializing level {level+1} of data model')
            for key, value in content_paths.items():
                if value.count('/') != level+1:
                    continue
                head, tail = os.path.split(value)
                # Find out if object is a description object
                is_descr = self._is_table_descr(content_type[key])
                if self.h5_dataset.__contains__(content_paths[key]):
                    if self._is_table(content_paths[key]):
                        msg = ('Updating table {}'.format(content_paths[key]))
                        self._verbose_print(msg)
                        self._update_table_columns(
                            tablename=content_paths[key],
                            Description=content_type[key])
                    if self._is_empty(content_paths[key]):
                        self._verbose_print('Warning: node {} specified in the'
                                            ' minimal data model for this class'
                                            ' is empty'
                                            ''.format(content_paths[key]))
                    continue
                elif is_descr:
                    msg = ('Adding empty Table  {}'.format(content_paths[key]))
                    self.add_table(location=head, name=tail, indexname=key,
                                   description=content_type[key])
                elif content_type[key] == 'Group':
                    msg = f'Adding empty Group {content_paths[key]}'
                    self.add_group(groupname=tail, location=head,
                                   indexname=key, replace=False)

# Path: pymicro/core/global_variables.py
# XDMF_FIELD_TYPE = {1: 'Scalar', 2: 'Vector', 3: 'Vector', 6: 'Tensor6',
#                    9: 'Tensor'}
# 
# XDMF_IMAGE_GEOMETRY = {'3DImage': 'ORIGIN_DXDYDZ', '2DImage': 'ORIGIN_DXDY'}
# 
# XDMF_IMAGE_TOPOLOGY = {'3DImage': '3DCoRectMesh', '2DImage': '2DCoRectMesh'}
# 
# Path: pymicro/core/global_variables.py
# SD_GROUP_TYPES = ['Group', '2DImage', '3DImage', '2DMesh', '3DMesh']
# 
# SD_GRID_GROUPS = ['2DImage', '3DImage', '2DMesh', '3DMesh', 'emptyImage',
#                   'emptyMesh']
# 
# SD_IMAGE_GROUPS = {2:'2DImage', 3:'3DImage', 0:'emptyImage', -1:'Image'}
# 
# SD_MESH_GROUPS = {2:'2DMesh', 3:'3DMesh', 0:'emptyMesh', -1:'Mesh'}


# Path: pymicro/core/samples.py
import os
import subprocess
import shutil
import numpy as np
import tables
import lxml.builder
import BasicTools.Containers.UnstructuredMeshCreationTools as UMCT
            import re
        import BasicTools.Containers.ElementNames as EN
        import BasicTools.Containers.ElementNames as EN
from lxml import etree
from pathlib import Path
from BasicTools.Containers.ConstantRectilinearMesh import (
    ConstantRectilinearMesh)
from BasicTools.Containers.UnstructuredMesh import (UnstructuredMesh,
                                                    AllElements)
from BasicTools.Containers.MeshBase import MeshBase
from BasicTools.IO.XdmfTools import XdmfName,XdmfNumber
from pymicro.core.global_variables import (XDMF_FIELD_TYPE,
                                           XDMF_IMAGE_GEOMETRY,
                                           XDMF_IMAGE_TOPOLOGY)
from pymicro.core.global_variables import (SD_GROUP_TYPES, SD_GRID_GROUPS,
                                           SD_IMAGE_GROUPS, SD_MESH_GROUPS)
        from BasicTools.IO.UniversalReader import ReadMesh

            max_path_level = max(value.count('/'), max_path_level)
        for level in range(max_path_level):
            self._verbose_print(f'Initializing level {level+1} of data model')
            for key, value in content_paths.items():
                if value.count('/') != level+1:
                    continue
                head, tail = os.path.split(value)
                # Find out if object is a description object
                is_descr = self._is_table_descr(content_type[key])
                if self.h5_dataset.__contains__(content_paths[key]):
                    if self._is_table(content_paths[key]):
                        msg = ('Updating table {}'.format(content_paths[key]))
                        self._verbose_print(msg)
                        self._update_table_columns(
                            tablename=content_paths[key],
                            Description=content_type[key])
                    if self._is_empty(content_paths[key]):
                        self._verbose_print('Warning: node {} specified in the'
                                            ' minimal data model for this class'
                                            ' is empty'
                                            ''.format(content_paths[key]))
                    continue
                elif is_descr:
                    msg = ('Adding empty Table  {}'.format(content_paths[key]))
                    self.add_table(location=head, name=tail, indexname=key,
                                   description=content_type[key])
                elif content_type[key] == 'Group':
                    msg = f'Adding empty Group {content_paths[key]}'
                    self.add_group(groupname=tail, location=head,
                                   indexname=key, replace=False)

                elif content_type[key] in SD_IMAGE_GROUPS.values():