Skip to content

Commit d21d0c0

Browse files
author
Javier Velo
committed
Merge branch 'housekeeping_2025-09-29' into 'development'
housekeeping 2025-09-29 See merge request damask/DAMASK!1134
2 parents 61ab767 + ab87a1f commit d21d0c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1131
-1450
lines changed

.github/workflows/Fortran.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Grid and Mesh Solver
22
on: [push]
33

44
env:
5-
PETSC_VERSION: '3.23.3'
5+
PETSC_VERSION: '3.24.0'
66
HOMEBREW_NO_ANALYTICS: 'ON' # Make Homebrew installation a little quicker
77
HOMEBREW_NO_AUTO_UPDATE: 'ON'
88
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 'ON'
@@ -17,7 +17,7 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
gcc_v: [11, 12, 13, 14, 15]
20+
gcc_v: [11, 12, 13, 14]
2121
fail-fast: false
2222

2323
env:
@@ -29,7 +29,6 @@ jobs:
2929

3030
- name: GCC - Install
3131
run: |
32-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
3332
sudo apt-get update
3433
sudo apt-get install liblapack-dev
3534
sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V} g++-${GCC_V}

.gitlab-ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ core:
136136
- |
137137
COMMITS=$(git log --reverse --format=format:%H origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}..${CI_COMMIT_SHA}~)
138138
for COMMIT in ${COMMITS};do
139-
echo ${COMMIT}
139+
printf "%b" "\e[1;32m::\nchecking commit ${COMMIT}\n::\e[0m\n"
140140
git checkout ${COMMIT}
141+
git submodule update --init
141142
cmake -DGRID=ON -DMESH=ON -B build && cmake --build build --parallel 4 --target install
142143
done
143144
@@ -149,7 +150,8 @@ processing:
149150
source env/DAMASK.sh
150151
COMMITS=$(git log --reverse --format=format:%H origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME..$CI_COMMIT_SHA)
151152
for COMMIT in ${COMMITS};do
152-
echo ${COMMIT}
153+
printf "%b" "\e[1;32m::\nchecking commit ${COMMIT}\n::.\e[0m\n"
154+
git checkout ${COMMIT}
153155
python -c 'import damask;print(damask.__version__)'
154156
done
155157
@@ -270,8 +272,8 @@ unittest_oneapi_previous:
270272
.compile:
271273
stage: core
272274
before_script:
275+
- ${PETSC_DIR}/lib/petsc/bin/petscversion
273276
- tail +$(grep -n 'Configure Actions.*' /petsc/configure.log | cut -f 1 -d:) /petsc/configure.log
274-
- head -n 10 /petsc/include/petscversion.h | tail -n 6
275277
- source env/DAMASK.sh
276278
- cd PRIVATE/testing
277279

@@ -320,8 +322,8 @@ Marc_compile:
320322
.configexamples_debug:
321323
stage: core
322324
before_script:
325+
- ${PETSC_DIR}/lib/petsc/bin/petscversion
323326
- tail +$(grep -n 'Configure Actions.*' /petsc/configure.log | cut -f 1 -d:) /petsc/configure.log
324-
- head -n 10 /petsc/include/petscversion.h | tail -n 6
325327
- source env/DAMASK.sh
326328
- cmake -B builddir -DGRID=ON -DCMAKE_BUILD_TYPE=DEBUG
327329
- cmake --build builddir --target install

CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
cmake_minimum_required(VERSION 3.18.0)
22
set(CMAKE_CXX_STANDARD 23)
3+
set(CMAKE_C_STANDARD 17)
34
include(FindPkgConfig REQUIRED)
45

56
if(DEFINED ENV{PETSC_DIR})
@@ -11,7 +12,7 @@ endif()
1112
# Dummy project to determine compiler names and version
1213
project(Prerequisites LANGUAGES)
1314
set(ENV{PKG_CONFIG_PATH} "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
14-
set(PETSC_VERSION_MINOR_MIN "15")
15+
set(PETSC_VERSION_MINOR_MIN "19")
1516
set(PETSC_VERSION_MINOR_MAX "24")
1617

1718
pkg_check_modules(PETSC_MIN REQUIRED PETSc>=3.${PETSC_VERSION_MINOR_MIN}.0 QUIET) #CMake does not support version range
@@ -39,17 +40,18 @@ project(DAMASK
3940
HOMEPAGE_URL https://damask-multiphysics.org
4041
LANGUAGES Fortran C CXX VERSION "${DAMASK_VERSION_CMAKE}")
4142

42-
if(NOT ${CMAKE_C_COMPILER_ID} STREQUAL ${CMAKE_Fortran_COMPILER_ID})
43-
message(FATAL_ERROR "C compiler (${CMAKE_C_COMPILER_ID}) does not match Fortran compiler (${CMAKE_Fortran_COMPILER_ID})")
44-
endif()
45-
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL ${CMAKE_Fortran_COMPILER_ID})
46-
message(FATAL_ERROR "C++ compiler (${CMAKE_CXX_COMPILER_ID}) does not match Fortran compiler (${CMAKE_Fortran_COMPILER_ID})")
43+
if(NOT ${CMAKE_Fortran_COMPILER_ID} STREQUAL "LLVMFlang")
44+
if(NOT ${CMAKE_C_COMPILER_ID} STREQUAL ${CMAKE_Fortran_COMPILER_ID})
45+
message(FATAL_ERROR "C compiler (${CMAKE_C_COMPILER_ID}) does not match Fortran compiler (${CMAKE_Fortran_COMPILER_ID})")
46+
endif()
47+
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL ${CMAKE_Fortran_COMPILER_ID})
48+
message(FATAL_ERROR "C++ compiler (${CMAKE_CXX_COMPILER_ID}) does not match Fortran compiler (${CMAKE_Fortran_COMPILER_ID})")
49+
endif()
4750
endif()
4851

4952
set(CMAKE_Fortran_PREPROCESS "ON")
5053

5154
# EXPERIMENTAL: This might help to detect external packages in future if PETSc is not aware of them
52-
set(ENV{PKG_CONFIG_PATH} "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/externalpackages:$ENV{PKG_CONFIG_PATH}")
5355
pkg_check_modules(HDF5 hdf5)
5456
pkg_check_modules(fYAML libfyaml)
5557
pkg_check_modules(LAPACK lapack)

PRIVATE

cmake/Compiler-GNU.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ else()
2424
endif()
2525

2626
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 12)
27-
add_definitions(-DOLD_STYLE_C_TO_FORTRAN_STRING)
27+
add_compile_definitions(OLD_STYLE_C_TO_FORTRAN_STRING)
2828
endif()
2929

3030
#------------------------------------------------------------------------------------------------

env/DAMASK.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ fi
8989
export DAMASK_ROOT
9090
export PYTHONPATH=$DAMASK_ROOT/python:$PYTHONPATH
9191

92-
for var in BASE STAT SOLVER BRANCH; do
92+
for var in BASE STAT SOLVER BRANCH ENV_ROOT; do
9393
unset "${var}"
9494
done
95-
unset "ENV_ROOT"

env/DAMASK.zsh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ fi
7979
export DAMASK_ROOT
8080
export PYTHONPATH=$DAMASK_ROOT/python:$PYTHONPATH
8181

82-
for var in SOLVER BRANCH; do
82+
for var in SOLVER BRANCH ENV_ROOT; do
8383
unset "${var}"
8484
done
85-
unset "ENV_ROOT"

python/damask/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
from pathlib import Path as _Path
1111
import re as _re
12-
import logging
12+
import logging as _logging
1313

14-
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
14+
_logging.basicConfig(level=_logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
1515

1616
name = 'damask'
17-
with open(_Path(__file__).parent/_Path('VERSION')) as _f:
17+
with open(_Path(__file__).parent/'VERSION') as _f:
1818
version = _re.sub(r'^v','',_f.readline().strip())
1919
__version__ = version
2020

python/damask/_colormap.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from itertools import chain
77

88
import numpy as np
9+
from numpy import typing as npt
910
import scipy.interpolate as interp
1011
import matplotlib as mpl
1112
if os.name == 'posix' and 'DISPLAY' not in os.environ:
@@ -618,7 +619,7 @@ def adjust_hue(msh_sat, m_unsat):
618619

619620

620621
@staticmethod
621-
def _hsv2rgb(hsv: np.ndarray) -> np.ndarray:
622+
def _hsv2rgb(hsv: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
622623
"""
623624
Hue Saturation Value to Red Green Blue.
624625
@@ -635,7 +636,7 @@ def _hsv2rgb(hsv: np.ndarray) -> np.ndarray:
635636
return np.array(colorsys.hsv_to_rgb(hsv[0]/360.,hsv[1],hsv[2]))
636637

637638
@staticmethod
638-
def _rgb2hsv(rgb: np.ndarray) -> np.ndarray:
639+
def _rgb2hsv(rgb: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
639640
"""
640641
Red Green Blue to Hue Saturation Value.
641642
@@ -654,7 +655,7 @@ def _rgb2hsv(rgb: np.ndarray) -> np.ndarray:
654655

655656

656657
@staticmethod
657-
def _hsl2rgb(hsl: np.ndarray) -> np.ndarray:
658+
def _hsl2rgb(hsl: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
658659
"""
659660
Hue Saturation Luminance to Red Green Blue.
660661
@@ -671,7 +672,7 @@ def _hsl2rgb(hsl: np.ndarray) -> np.ndarray:
671672
return np.array(colorsys.hls_to_rgb(hsl[0]/360.,hsl[2],hsl[1]))
672673

673674
@staticmethod
674-
def _rgb2hsl(rgb: np.ndarray) -> np.ndarray:
675+
def _rgb2hsl(rgb: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
675676
"""
676677
Red Green Blue to Hue Saturation Luminance.
677678
@@ -690,7 +691,7 @@ def _rgb2hsl(rgb: np.ndarray) -> np.ndarray:
690691

691692

692693
@staticmethod
693-
def _xyz2rgb(xyz: np.ndarray) -> np.ndarray:
694+
def _xyz2rgb(xyz: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
694695
"""
695696
CIEXYZ to Red Green Blue.
696697
@@ -719,7 +720,7 @@ def _xyz2rgb(xyz: np.ndarray) -> np.ndarray:
719720
return np.clip(rgb,0.,1.)
720721

721722
@staticmethod
722-
def _rgb2xyz(rgb: np.ndarray) -> np.ndarray:
723+
def _rgb2xyz(rgb: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
723724
"""
724725
Red Green Blue to CIEXYZ.
725726
@@ -746,8 +747,8 @@ def _rgb2xyz(rgb: np.ndarray) -> np.ndarray:
746747

747748

748749
@staticmethod
749-
def _lab2xyz(lab: np.ndarray,
750-
ref_white: np.ndarray = _REF_WHITE) -> np.ndarray:
750+
def _lab2xyz(lab: npt.NDArray[np.floating],
751+
ref_white: npt.NDArray[np.floating] = _REF_WHITE) -> npt.NDArray[np.floating]:
751752
"""
752753
CIELAB to CIEXYZ.
753754
@@ -778,8 +779,8 @@ def _lab2xyz(lab: np.ndarray,
778779
])*ref_white
779780

780781
@staticmethod
781-
def _xyz2lab(xyz: np.ndarray,
782-
ref_white: np.ndarray = _REF_WHITE) -> np.ndarray:
782+
def _xyz2lab(xyz: npt.NDArray[np.floating],
783+
ref_white: npt.NDArray[np.floating] = _REF_WHITE) -> npt.NDArray[np.floating]:
783784
"""
784785
CIEXYZ to CIELAB.
785786
@@ -812,7 +813,7 @@ def _xyz2lab(xyz: np.ndarray,
812813

813814

814815
@staticmethod
815-
def _lab2msh(lab: np.ndarray) -> np.ndarray:
816+
def _lab2msh(lab: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
816817
"""
817818
CIELAB to Msh.
818819
@@ -839,7 +840,7 @@ def _lab2msh(lab: np.ndarray) -> np.ndarray:
839840
])
840841

841842
@staticmethod
842-
def _msh2lab(msh: np.ndarray) -> np.ndarray:
843+
def _msh2lab(msh: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
843844
"""
844845
Msh to CIELAB.
845846
@@ -865,7 +866,7 @@ def _msh2lab(msh: np.ndarray) -> np.ndarray:
865866
])
866867

867868
@staticmethod
868-
def _lab2rgb(lab: np.ndarray) -> np.ndarray:
869+
def _lab2rgb(lab: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
869870
"""
870871
CIELAB to Red Green Blue.
871872
@@ -882,7 +883,7 @@ def _lab2rgb(lab: np.ndarray) -> np.ndarray:
882883
return Colormap._xyz2rgb(Colormap._lab2xyz(lab))
883884

884885
@staticmethod
885-
def _rgb2lab(rgb: np.ndarray) -> np.ndarray:
886+
def _rgb2lab(rgb: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
886887
"""
887888
Red Green Blue to CIELAB.
888889
@@ -899,7 +900,7 @@ def _rgb2lab(rgb: np.ndarray) -> np.ndarray:
899900
return Colormap._xyz2lab(Colormap._rgb2xyz(rgb))
900901

901902
@staticmethod
902-
def _msh2rgb(msh: np.ndarray) -> np.ndarray:
903+
def _msh2rgb(msh: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
903904
"""
904905
Msh to Red Green Blue.
905906
@@ -916,7 +917,7 @@ def _msh2rgb(msh: np.ndarray) -> np.ndarray:
916917
return Colormap._lab2rgb(Colormap._msh2lab(msh))
917918

918919
@staticmethod
919-
def _rgb2msh(rgb: np.ndarray) -> np.ndarray:
920+
def _rgb2msh(rgb: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
920921
"""
921922
Red Green Blue to Msh.
922923
@@ -933,7 +934,7 @@ def _rgb2msh(rgb: np.ndarray) -> np.ndarray:
933934
return Colormap._lab2msh(Colormap._rgb2lab(rgb))
934935

935936
@staticmethod
936-
def _hsv2msh(hsv: np.ndarray) -> np.ndarray:
937+
def _hsv2msh(hsv: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
937938
"""
938939
Hue Saturation Value to msh.
939940
@@ -950,7 +951,7 @@ def _hsv2msh(hsv: np.ndarray) -> np.ndarray:
950951
return Colormap._rgb2msh(Colormap._hsv2rgb(hsv))
951952

952953
@staticmethod
953-
def _hsl2msh(hsl: np.ndarray) -> np.ndarray:
954+
def _hsl2msh(hsl: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
954955
"""
955956
Hue Saturation Luminance to Msh.
956957
@@ -967,7 +968,7 @@ def _hsl2msh(hsl: np.ndarray) -> np.ndarray:
967968
return Colormap._rgb2msh(Colormap._hsl2rgb(hsl))
968969

969970
@staticmethod
970-
def _xyz2msh(xyz: np.ndarray) -> np.ndarray:
971+
def _xyz2msh(xyz: npt.NDArray[np.floating]) -> npt.NDArray[np.floating]:
971972
"""
972973
CIEXYZ to Msh.
973974

python/damask/_configmaterial.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,12 @@ def load_DREAM3D(fname: str,
124124
125125
Homogenization and phase entries are emtpy and need to be
126126
defined separately.
127+
128+
Versions 8.0 and later of the DREAM.3D file format are not yet supported.
127129
"""
128130
with h5py.File(fname, 'r') as f:
131+
if (file_version := util.version(f.attrs['FileVersion'].decode()+'.0')) > '7.0.0':
132+
raise ValueError(f'DREAM.3D file format {file_version} is not supported')
129133
b = util.DREAM3D_base_group(f) if base_group is None else base_group
130134
c = util.DREAM3D_cell_data_group(f) if cell_data is None else cell_data
131135

0 commit comments

Comments
 (0)