materialite 0.1.2__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {materialite-0.1.2 → materialite-0.1.3}/PKG-INFO +1 -1
- {materialite-0.1.2 → materialite-0.1.3}/materialite/importers.py +26 -8
- {materialite-0.1.2 → materialite-0.1.3}/materialite/material.py +294 -147
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/small_strain_fft/elastic_viscoplastic.py +22 -8
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/small_strain_fft/hardening_laws.py +4 -8
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/small_strain_fft/isotropic_elastic_plastic.py +10 -5
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/small_strain_fft/multiphase.py +9 -6
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/small_strain_fft/small_strain_fft.py +90 -55
- {materialite-0.1.2 → materialite-0.1.3}/materialite/tensor.py +955 -480
- {materialite-0.1.2 → materialite-0.1.3}/materialite.egg-info/PKG-INFO +1 -1
- {materialite-0.1.2 → materialite-0.1.3}/pyproject.toml +1 -1
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_elastic_model.py +19 -18
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_elastic_viscoplastic_model.py +1 -1
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_hardening_laws.py +22 -31
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_importers.py +96 -6
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_isotropic_plasticity.py +10 -36
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_material.py +296 -71
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_multiphase.py +15 -5
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_orientation.py +6 -5
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_tensor.py +362 -196
- {materialite-0.1.2 → materialite-0.1.3}/LICENSE +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/README.md +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/__init__.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/basis_operations.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/get_ipf_colors.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/json_operations.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/__init__.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/convolution_gpu_model.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/convolution_microstructure_model.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/convolution_model.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/decoupled_crystal_elasticity.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/grain_coarsening_model.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/model.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/small_strain_fft/__init__.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/small_strain_fft/elastic.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/small_strain_fft/load_schedule.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/models/taylor_model.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/slip_system.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/util/__init__.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite/util/util.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite.egg-info/SOURCES.txt +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite.egg-info/dependency_links.txt +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite.egg-info/requires.txt +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/materialite.egg-info/top_level.txt +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/setup.cfg +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_convolution_cpu.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_convolution_gpu.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_convolution_microstructure.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_decoupled_elasticity.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_grain_coarsening.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_ipf_colors.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_json_operations.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_load_schedule.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_model.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_slip_system.py +0 -0
- {materialite-0.1.2 → materialite-0.1.3}/tests/test_taylor_model.py +0 -0
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import h5py
|
|
14
14
|
import numpy as np
|
|
15
15
|
import pandas as pd
|
|
16
|
-
from materialite import Material
|
|
16
|
+
from materialite import Material, Orientation
|
|
17
17
|
from materialite.util import camel_to_snake
|
|
18
18
|
|
|
19
19
|
|
|
@@ -55,7 +55,9 @@ def import_dream3d(
|
|
|
55
55
|
region_id_field = d3d.get(region_id_path)[:].reshape(-1)
|
|
56
56
|
fields[region_id_label] = region_id_field
|
|
57
57
|
if region_field_paths is not None:
|
|
58
|
-
|
|
58
|
+
unique_region_ids = np.unique(region_id_field)
|
|
59
|
+
regional_fields[region_id_label] = unique_region_ids
|
|
60
|
+
start_idx = 0 if 0 in unique_region_ids else 1
|
|
59
61
|
|
|
60
62
|
region_field_paths = [] if region_field_paths is None else region_field_paths
|
|
61
63
|
for region_field_path in region_field_paths:
|
|
@@ -64,7 +66,7 @@ def import_dream3d(
|
|
|
64
66
|
num_components = region_field.shape[1]
|
|
65
67
|
for ii in range(num_components):
|
|
66
68
|
suffix = "" if num_components == 1 else "_" + str(ii + 1)
|
|
67
|
-
regional_fields[region_label + suffix] = region_field[
|
|
69
|
+
regional_fields[region_label + suffix] = region_field[start_idx:, ii]
|
|
68
70
|
|
|
69
71
|
material = Material(
|
|
70
72
|
dimensions=dimensions, origin=origin, spacing=spacing, fields=fields
|
|
@@ -99,8 +101,8 @@ def import_spparks(
|
|
|
99
101
|
sep=" ",
|
|
100
102
|
header=None,
|
|
101
103
|
skiprows=skiprows,
|
|
102
|
-
usecols=
|
|
103
|
-
names=
|
|
104
|
+
usecols=usecols,
|
|
105
|
+
names=names,
|
|
104
106
|
)
|
|
105
107
|
fields.sort_values(by=["z", "y", "x"], inplace=True)
|
|
106
108
|
|
|
@@ -152,6 +154,10 @@ def import_evpfft(
|
|
|
152
154
|
file,
|
|
153
155
|
spacing=[1, 1, 1],
|
|
154
156
|
origin=[0, 0, 0],
|
|
157
|
+
grain_label="grain",
|
|
158
|
+
phase_label="phase",
|
|
159
|
+
orientation_label="orientation",
|
|
160
|
+
euler_angles_to_radians=True,
|
|
155
161
|
):
|
|
156
162
|
|
|
157
163
|
fields = pd.read_csv(
|
|
@@ -165,15 +171,27 @@ def import_evpfft(
|
|
|
165
171
|
"x_id",
|
|
166
172
|
"y_id",
|
|
167
173
|
"z_id",
|
|
168
|
-
|
|
169
|
-
|
|
174
|
+
grain_label,
|
|
175
|
+
phase_label,
|
|
170
176
|
],
|
|
171
177
|
).sort_values(by=["x_id", "y_id", "z_id"])
|
|
172
178
|
|
|
173
|
-
|
|
179
|
+
if euler_angles_to_radians:
|
|
180
|
+
orientations = Orientation.from_euler_angles(
|
|
181
|
+
fields[["euler_angle_1", "euler_angle_2", "euler_angle_3"]].to_numpy(),
|
|
182
|
+
in_degrees=True,
|
|
183
|
+
)
|
|
184
|
+
else:
|
|
185
|
+
orientations = Orientation.from_euler_angles(
|
|
186
|
+
fields[["euler_angle_1", "euler_angle_2", "euler_angle_3"]].to_numpy()
|
|
187
|
+
)
|
|
174
188
|
|
|
175
189
|
dimensions = fields[["x_id", "y_id", "z_id"]].max().to_numpy()
|
|
176
190
|
|
|
191
|
+
fields = fields.assign(**{orientation_label: orientations}).drop(
|
|
192
|
+
labels=["euler_angle_1", "euler_angle_2", "euler_angle_3"], axis=1
|
|
193
|
+
)
|
|
194
|
+
|
|
177
195
|
return Material(
|
|
178
196
|
dimensions=dimensions,
|
|
179
197
|
spacing=spacing,
|