|
2 | 2 |
|
3 | 3 | from dataclasses import dataclass |
4 | 4 | from typing import Any, Collection, Dict, List, Optional, Sequence, Union, cast |
| 5 | +from warnings import warn |
5 | 6 |
|
6 | 7 | import ansys.dpf.core as dpf |
7 | 8 | from ansys.dpf.core import DataSources, MeshedRegion, Operator, PropertyField |
@@ -200,6 +201,38 @@ def get_dpf_material_id_by_analyis_ply_map( |
200 | 201 | data_source_or_streams_provider: |
201 | 202 | DPF data source with rst file or streams_provider. The streams provider is |
202 | 203 | available from :attr:`.CompositeModel.core_model` (under metadata.streams_provider). |
| 204 | +
|
| 205 | + Note |
| 206 | + ---- |
| 207 | + Cache the output because the computation can be performance-critical. |
| 208 | + """ |
| 209 | + warn( |
| 210 | + "`get_dpf_material_id_by_analyis_ply_map` is deprecated. " |
| 211 | + " and was replaced by `get_dpf_material_id_by_analysis_ply_map`.", |
| 212 | + category=DeprecationWarning, |
| 213 | + stacklevel=2, |
| 214 | + ) |
| 215 | + return get_dpf_material_id_by_analysis_ply_map(mesh, data_source_or_streams_provider) |
| 216 | + |
| 217 | + |
| 218 | +def get_dpf_material_id_by_analysis_ply_map( |
| 219 | + mesh: MeshedRegion, |
| 220 | + data_source_or_streams_provider: Union[DataSources, Operator], |
| 221 | +) -> Dict[str, np.int64]: |
| 222 | + """Get the dictionary that maps analysis ply names to DPF material IDs. |
| 223 | +
|
| 224 | + Parameters |
| 225 | + ---------- |
| 226 | + mesh |
| 227 | + DPF Meshed region enriched with lay-up information |
| 228 | + data_source_or_streams_provider: |
| 229 | + DPF data source with RST file or streams provider. The streams provider is |
| 230 | + available from the :attr:`.CompositeModel.core_model` attribute |
| 231 | + (under ``metadata.streams_provider``). |
| 232 | +
|
| 233 | + Note |
| 234 | + ---- |
| 235 | + Cache the output because the computation can be performance-critical. |
203 | 236 | """ |
204 | 237 | # Note: The stream_provider_or_data_source is not strictly needed for this workflow |
205 | 238 | # We just need it because get_element_info_provider provider needs it (which needs |
|
0 commit comments