diff --git a/.ci_support/environment-notebooks-damask.yml b/.ci_support/environment-notebooks-damask.yml index d8b871ab..6c409468 100644 --- a/.ci_support/environment-notebooks-damask.yml +++ b/.ci_support/environment-notebooks-damask.yml @@ -5,16 +5,15 @@ dependencies: - coveralls - coverage - codacy-coverage - - damask-mesh =3.0.0a8 - - damask-grid =3.0.0a8 - - damask =3.0.0a8 - - mshr =2019.1.0=*_9 - - k3d =2.16.0 + - damask-mesh =3.0.0b + - damask-grid =3.0.0b + - damask =3.0.0b + - k3d - matplotlib =3.8.0 - numpy =1.26.3 - pyiron =0.5.0 - - pyiron-data =0.0.26 - - python-damask =3.0.0a8 + - pyiron-data + - python-damask =3.0.0b - pyvista =0.42.3 - scipy =1.11.4 - seaborn =0.13.1 diff --git a/.ci_support/environment-notebooks-fenics.yml b/.ci_support/environment-notebooks-fenics.yml index c28484c8..17adf966 100644 --- a/.ci_support/environment-notebooks-fenics.yml +++ b/.ci_support/environment-notebooks-fenics.yml @@ -7,8 +7,8 @@ dependencies: - codacy-coverage - fenics =2019.1.0 - fenics =2019.1.0=*_42 - - mshr =2019.1.0=*_9 - - k3d =2.16.0 + - mshr + - k3d - matplotlib =3.8.0 - numpy =1.26.3 - pyiron =0.5.0 diff --git a/.ci_support/environment-notebooks.yml b/.ci_support/environment-notebooks.yml index fe3b3465..53d93ff6 100644 --- a/.ci_support/environment-notebooks.yml +++ b/.ci_support/environment-notebooks.yml @@ -5,9 +5,9 @@ dependencies: - coveralls - coverage - codacy-coverage - - damask-mesh =3.0.0a8 - - damask-grid =3.0.0a8 - - damask =3.0.0a8 + - damask-mesh =3.0.0b + - damask-grid =3.0.0b + - damask =3.0.0b - fenics =2019.1.0 - fenics =2019.1.0=*_42 - mshr =2019.1.0=*_9 @@ -16,7 +16,7 @@ dependencies: - numpy =1.26.3 - pyiron =0.5.0 - pyiron-data =0.0.26 - - python-damask =3.0.0a8 + - python-damask =3.0.0b - pyvista =0.42.3 - scipy =1.11.4 - seaborn =0.13.1 diff --git a/pyiron_continuum/damask/factory.py b/pyiron_continuum/damask/factory.py index 766ed955..1dff2b96 100644 --- a/pyiron_continuum/damask/factory.py +++ b/pyiron_continuum/damask/factory.py @@ -8,7 +8,7 @@ 'DAMASK functionality requires the `damask` module (and its dependencies) specified as extra' 'requirements. Please install it and try again.' ) as damask_alarm: - from damask import Grid, Config, ConfigMaterial, seeds + from damask import GeomGrid, YAML, ConfigMaterial, seeds import numpy as np __author__ = "Muhammad Hassani" @@ -49,22 +49,22 @@ def write(file_path): class GridFactory: def __init__(self): - """A factory for damask._grid.Grid class.""" + """A factory for damask._grid.GeomGrid class.""" self._origin = None @staticmethod def read(file_path): - return Grid.load(fname=file_path) + return GeomGrid.load(fname=file_path) @property def origin(self): """ - Returns damask._grid.Grid, it can be used to call damask original methods. + Returns damask._grid.GeomGrid, it can be used to call damask original methods. For example: origin.from_Voronoi_tessellation(...) """ if self._origin is None: - return Grid(material=np.ones((1, 1, 1)), size=[1., 1., 1.]) + return GeomGrid(material=np.ones((1, 1, 1)), size=[1., 1., 1.]) else: return self._origin @@ -79,12 +79,12 @@ def via_voronoi_tessellation(spatial_discretization, num_grains, box_size): if isinstance(box_size, int) or isinstance(box_size, float): box_size = np.array([box_size, box_size, box_size]) seed = seeds.from_random(box_size, num_grains) - return Grid.from_Voronoi_tessellation(spatial_discretization, box_size, seed) + return GeomGrid.from_Voronoi_tessellation(spatial_discretization, box_size, seed) class DamaskLoading(dict): def __init__(self, solver, load_steps): - """A factory for damask Loading class, which is a damask._config.Config object.""" + """A factory for damask Loading class, which is a damask._config.YAML object.""" super(DamaskLoading, self).__init__(self) def __new__(cls, solver, load_steps): @@ -102,7 +102,7 @@ def __new__(cls, solver, load_steps): discretization=load_steps['discretization'], additional_parameters_dict=load_steps["additional"]) ] - return Config(solver=loading_dict["solver"], loadstep=loading_dict["loadstep"]) + return YAML(solver=loading_dict["solver"], loadstep=loading_dict["loadstep"]) class LoadStep(dict): diff --git a/pyiron_continuum/damask/regrid.py b/pyiron_continuum/damask/regrid.py index d5c5aa68..9f367e7a 100644 --- a/pyiron_continuum/damask/regrid.py +++ b/pyiron_continuum/damask/regrid.py @@ -11,7 +11,7 @@ def regrid_Geom(work_dir, geom_name, load_name, seed_scale=1.0, increment='last' Regrid the geometry It requires the previous geom.vti and result.hdf5 ''' - geom_0 = damask.Grid.load(f'{geom_name}.vti') + geom_0 = damask.GeomGrid.load(f'{geom_name}.vti') cells_0 = geom_0.cells size_0 = geom_0.size @@ -26,11 +26,11 @@ def regrid_Geom(work_dir, geom_name, load_name, seed_scale=1.0, increment='last' d5Out = damask.Result(f'{work_dir}/{geom_name}_{load_name}_material.hdf5') if increment == 'last': - inc = int(d5Out.increments[-1][10::]) # take the increment number + inc = int(d5Out.increments[-1]) # take the increment number d5Out = d5Out.view(increments=inc) increment_title = d5Out.increments[-1] elif increment in d5Out.increments: - inc = int(increment[10::]) # take the increment number + inc = int(increment) # take the increment number d5Out = d5Out.view(increments=inc) increment_title = increment else: @@ -75,9 +75,9 @@ def write_RegriddedGeom(work_dir, geom_name, increment_title, map_0to_rg, cells_ Save the regridded geometry to a new vti file ''' os.chdir(f'{work_dir}') - grid_0 = damask.Grid.load(geom_name + '.vti') + grid_0 = damask.GeomGrid.load(geom_name + '.vti') material_rg = grid_0.material.flatten('F')[map_0to_rg].reshape(cells_rg, order='F') - grid = damask.Grid(material_rg, size_rg, grid_0.origin, comments=grid_0.comments \ + grid = damask.GeomGrid(material_rg, size_rg, grid_0.origin, comments=grid_0.comments \ ).save(f'{geom_name}_regridded_{increment_title}.vti') print(f'save regrid geometry to {geom_name}_regridded_{increment_title}.vti') regrid_geom_name = f'{geom_name}_regridded_{increment_title}' diff --git a/pyiron_continuum/damask/rolling.py b/pyiron_continuum/damask/rolling.py index 22da5493..11902042 100644 --- a/pyiron_continuum/damask/rolling.py +++ b/pyiron_continuum/damask/rolling.py @@ -1,5 +1,4 @@ from ast import arg -import imp import os from random import vonmisesvariate import numpy as np @@ -14,8 +13,7 @@ from damaskjob import DAMASK import regrid as rgg -from damask import Result -from damask import Config +from damask import Result, YAML from factory import DamaskLoading @@ -33,7 +31,7 @@ def __init__(self, project, job_name): def loading_discretization(self, rolltimes, filename): time = rolltimes * self._height_reduction / (self._rolling_speed * self._number_passes) - self.load_case = Config(solver={'mechanical': 'spectral_basic'}, loadstep=[]) + self.load_case = YAML(solver={'mechanical': 'spectral_basic'}, loadstep=[]) dotF = [['x', 0, 0], [0, 0, 0], [0, 0, -1.0 * self._rolling_speed]] @@ -72,7 +70,7 @@ def executeRolling(self, reduction_height, reduction_speed, reduction_outputs, r self._write_material() self._write_geometry() - self.load_case = Config(solver={'mechanical': 'spectral_basic'}, loadstep=[]) + self.load_case = YAML(solver={'mechanical': 'spectral_basic'}, loadstep=[]) reduction_time = reduction_height / reduction_speed dotF = [['x', 0, 0], [0, 0, 0],