|
32 | 32 | from numpy.typing import NDArray |
33 | 33 |
|
34 | 34 | from .composite_scope import CompositeScope |
35 | | -from .constants import SolverType |
| 35 | +from .constants import D3PLOT_KEY_AND_FILENAME, SolverType |
36 | 36 | from .data_sources import ( |
37 | 37 | CompositeDataSources, |
38 | 38 | ContinuousFiberCompositesFiles, |
@@ -268,11 +268,10 @@ def layup_model_type(self) -> LayupModelContextType: |
268 | 268 | @property |
269 | 269 | def solver_type(self) -> SolverType: |
270 | 270 | """Get the type of solver used to generate the result file.""" |
271 | | - raise NotImplementedError( |
272 | | - "solver_type is not implemented" |
273 | | - " for this version of DPF. DPF server 10.0 (2025 R2)" |
274 | | - " or later should be used instead." |
275 | | - ) |
| 271 | + if self._core_model.metadata.data_sources.result_key == D3PLOT_KEY_AND_FILENAME: |
| 272 | + return SolverType.LSDYNA |
| 273 | + |
| 274 | + return SolverType.MAPDL |
276 | 275 |
|
277 | 276 | def evaluate_failure_criteria( |
278 | 277 | self, |
@@ -314,6 +313,9 @@ def evaluate_failure_criteria( |
314 | 313 | ``write_data_for_full_element_scope=True`` is not supported. |
315 | 314 |
|
316 | 315 | """ |
| 316 | + if self.solver_type != SolverType.MAPDL: |
| 317 | + raise RuntimeError("evaluate_failure_criteria is implemented for MAPDL results only.") |
| 318 | + |
317 | 319 | if composite_scope is None: |
318 | 320 | composite_scope = CompositeScope() |
319 | 321 |
|
@@ -385,6 +387,9 @@ def get_sampling_point( |
385 | 387 | attribute. This parameter is only required for assemblies. |
386 | 388 | See the note about assemblies in the description for the :class:`CompositeModel` class. |
387 | 389 | """ |
| 390 | + if self.solver_type != SolverType.MAPDL: |
| 391 | + raise RuntimeError("get_sampling_point is implemented for MAPDL results only.") |
| 392 | + |
388 | 393 | time_in = time |
389 | 394 |
|
390 | 395 | if composite_definition_label is None: |
@@ -594,6 +599,11 @@ def add_interlaminar_normal_stresses( |
594 | 599 | Interlaminar normal stresses are only added to the layered elements defined |
595 | 600 | in the specified composite definition. |
596 | 601 | """ |
| 602 | + if self.solver_type != SolverType.MAPDL: |
| 603 | + raise RuntimeError( |
| 604 | + "add_interlaminar_normal_stresses is implemented for MAPDL results only." |
| 605 | + ) |
| 606 | + |
597 | 607 | if composite_definition_label is None: |
598 | 608 | composite_definition_label = self._first_composite_definition_label_if_only_one() |
599 | 609 |
|
|
0 commit comments