diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index e0b44564e3..ec0a23e1fb 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -15,7 +15,7 @@ on: env: DOCKER_IMAGE_NAME: ghcr.io/ansys/prime - DOCKER_IMAGE_TAG: '25.1.0' + DOCKER_IMAGE_TAG: '25.1.1.dev0' MAIN_PYTHON_VERSION: '3.12' PACKAGE_NAME: 'ansys-meshing-prime' PACKAGE_NAMESPACE: 'ansys.meshing.prime' diff --git a/doc/changelog.d/973.maintenance.md b/doc/changelog.d/973.maintenance.md new file mode 100644 index 0000000000..c9e6f37c9e --- /dev/null +++ b/doc/changelog.d/973.maintenance.md @@ -0,0 +1 @@ +Include ADO changes \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 4cc99f8a11..82127f86b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "ansys-meshing-prime" -version = "0.7.0" +version = "0.8.0.dev0" description = "PyPrimeMesh is a Python client to Ansys Prime Server, which delivers core Ansys meshing technology." readme = "README.md" requires-python = ">=3.10,<4" diff --git a/src/ansys/meshing/prime/autogen/fileiostructs.py b/src/ansys/meshing/prime/autogen/fileiostructs.py index 5a81035b69..5c87e56ec2 100644 --- a/src/ansys/meshing/prime/autogen/fileiostructs.py +++ b/src/ansys/meshing/prime/autogen/fileiostructs.py @@ -78,9 +78,7 @@ class CadFaceter(enum.IntEnum): """Types of CAD faceter. """ ACIS = 0 - """Denotes CAD faceter is Acis. - - Note: ACIS faceter is being deprecated from 2025R1.""" + """Denotes CAD faceter is Acis.""" PARASOLID = 1 """Denotes CAD faceter is Parasolid.""" @@ -134,6 +132,18 @@ class CdbSimulationType(enum.IntEnum): EXPLICIT = 1 """Explicit Simulation.""" +class SeparateBlocksFormatType(enum.IntEnum): + """Format type for separate element blocks. Only applicable when write_separate_blocks is true. + """ + STANDARD = 0 + """Standard format for element blocks. + + **This is a beta parameter**. **The behavior and name may change in the future**.""" + COMPACT = 1 + """Compact format for element blocks with reduced columns. + + **This is a beta parameter**. **The behavior and name may change in the future**.""" + class LSDynaFileFormatType(enum.IntEnum): """Provides the format type to write the LS-DYNA file. """ @@ -1308,8 +1318,7 @@ class CadRefacetingParams(CoreObject): model: Model Model to create a ``CadRefacetingParams`` object with default parameters. cad_faceter: CadFaceter, optional - Specify the available choices for faceter. The available option is Parasolid. - Note: ACIS faceter is being deprecated from 2025R1. + Specify the available choices for faceter. The available option is Parasolid. (Note: ACIS faceter is being deprecated from 25R1). faceting_resolution: CadRefacetingResolution, optional Set the faceting resolution. custom_surface_deviation_tolerance: float, optional @@ -1362,8 +1371,7 @@ def __init__( model: Model Model to create a ``CadRefacetingParams`` object with default parameters. cad_faceter: CadFaceter, optional - Specify the available choices for faceter. The available option is Parasolid. - Note: ACIS faceter is being deprecated from 2025R1. + Specify the available choices for faceter. The available option is Parasolid. (Note: ACIS faceter is being deprecated from 25R1). faceting_resolution: CadRefacetingResolution, optional Set the faceting resolution. custom_surface_deviation_tolerance: float, optional @@ -1432,8 +1440,7 @@ def set_default( Parameters ---------- cad_faceter: CadFaceter, optional - Specify the available choices for faceter. The available option is Parasolid. - Note: ACIS faceter is being deprecated from 2025R1. + Specify the available choices for faceter. The available option is Parasolid. (Note: ACIS faceter is being deprecated from 25R1). faceting_resolution: CadRefacetingResolution, optional Set the faceting resolution. custom_surface_deviation_tolerance: float, optional @@ -1484,8 +1491,7 @@ def __str__(self) -> str: @property def cad_faceter(self) -> CadFaceter: - """Specify the available choices for faceter. The available option is Parasolid. - Note: ACIS faceter is being deprecated from 2025R1. + """Specify the available choices for faceter. The available option is Parasolid. (Note: ACIS faceter is being deprecated from 25R1). """ return self._cad_faceter @@ -3073,8 +3079,12 @@ class ExportMapdlCdbParams(CoreObject): File path to export mapdl analysis settings. **This is a beta parameter**. **The behavior and name may change in the future**. - use_compact_format: bool, optional - Option to enable compact format for the cdb blocks. When true, writes a new, more space-efficient cdb format while exporting. The default value is false. + write_separate_blocks: bool, optional + Controls whether element blocks should be written separately. When true, writes elements in separate blocks based on the format specified in separate_blocks_format_type. When false, writes all elements into a single block. + + **This is a beta parameter**. **The behavior and name may change in the future**. + separate_blocks_format_type: SeparateBlocksFormatType, optional + Controls the format type when writing separate element blocks. Only used when write_separate_blocks is true. **This is a beta parameter**. **The behavior and name may change in the future**. export_fasteners_as_swgen: bool, optional @@ -3084,6 +3094,14 @@ class ExportMapdlCdbParams(CoreObject): export_rigid_bodies_as_rbgen: bool, optional Option to export rigid bodies as rbgen. When true, translates rigid bodies into compact rbgen blocks in the exported file. The default value is false. + **This is a beta parameter**. **The behavior and name may change in the future**. + write_component_based_ties: bool, optional + Option to write ties using component-based format. When true, writes ties using component selection and surface generation commands instead of explicit element definitions. The default value is false. + + **This is a beta parameter**. **The behavior and name may change in the future**. + mortar_contact_for_ties: bool, optional + Option to enable mortar contact for ties. When true, changes the key options for tie surfaces. The default value is false. + **This is a beta parameter**. **The behavior and name may change in the future**. write_thickness_file: bool, optional Option to write a thickness file for spotweld fatigue analysis. If true, writes a file named [exportedFilename].cdb.thick.txt containing thickness information. @@ -3116,9 +3134,12 @@ def __initialize( analysis_type: CdbAnalysisType, simulation_type: CdbSimulationType, analysis_settings_file_name: str, - use_compact_format: bool, + write_separate_blocks: bool, + separate_blocks_format_type: SeparateBlocksFormatType, export_fasteners_as_swgen: bool, export_rigid_bodies_as_rbgen: bool, + write_component_based_ties: bool, + mortar_contact_for_ties: bool, write_thickness_file: bool, contact_element_types: ContactElementTypeParams): self._config_settings = config_settings @@ -3133,9 +3154,12 @@ def __initialize( self._analysis_type = CdbAnalysisType(analysis_type) self._simulation_type = CdbSimulationType(simulation_type) self._analysis_settings_file_name = analysis_settings_file_name - self._use_compact_format = use_compact_format + self._write_separate_blocks = write_separate_blocks + self._separate_blocks_format_type = SeparateBlocksFormatType(separate_blocks_format_type) self._export_fasteners_as_swgen = export_fasteners_as_swgen self._export_rigid_bodies_as_rbgen = export_rigid_bodies_as_rbgen + self._write_component_based_ties = write_component_based_ties + self._mortar_contact_for_ties = mortar_contact_for_ties self._write_thickness_file = write_thickness_file self._contact_element_types = contact_element_types @@ -3154,9 +3178,12 @@ def __init__( analysis_type: CdbAnalysisType = None, simulation_type: CdbSimulationType = None, analysis_settings_file_name: str = None, - use_compact_format: bool = None, + write_separate_blocks: bool = None, + separate_blocks_format_type: SeparateBlocksFormatType = None, export_fasteners_as_swgen: bool = None, export_rigid_bodies_as_rbgen: bool = None, + write_component_based_ties: bool = None, + mortar_contact_for_ties: bool = None, write_thickness_file: bool = None, contact_element_types: ContactElementTypeParams = None, json_data : dict = None, @@ -3215,8 +3242,12 @@ def __init__( File path to export mapdl analysis settings. **This is a beta parameter**. **The behavior and name may change in the future**. - use_compact_format: bool, optional - Option to enable compact format for the cdb blocks. When true, writes a new, more space-efficient cdb format while exporting. The default value is false. + write_separate_blocks: bool, optional + Controls whether element blocks should be written separately. When true, writes elements in separate blocks based on the format specified in separate_blocks_format_type. When false, writes all elements into a single block. + + **This is a beta parameter**. **The behavior and name may change in the future**. + separate_blocks_format_type: SeparateBlocksFormatType, optional + Controls the format type when writing separate element blocks. Only used when write_separate_blocks is true. **This is a beta parameter**. **The behavior and name may change in the future**. export_fasteners_as_swgen: bool, optional @@ -3226,6 +3257,14 @@ def __init__( export_rigid_bodies_as_rbgen: bool, optional Option to export rigid bodies as rbgen. When true, translates rigid bodies into compact rbgen blocks in the exported file. The default value is false. + **This is a beta parameter**. **The behavior and name may change in the future**. + write_component_based_ties: bool, optional + Option to write ties using component-based format. When true, writes ties using component selection and surface generation commands instead of explicit element definitions. The default value is false. + + **This is a beta parameter**. **The behavior and name may change in the future**. + mortar_contact_for_ties: bool, optional + Option to enable mortar contact for ties. When true, changes the key options for tie surfaces. The default value is false. + **This is a beta parameter**. **The behavior and name may change in the future**. write_thickness_file: bool, optional Option to write a thickness file for spotweld fatigue analysis. If true, writes a file named [exportedFilename].cdb.thick.txt containing thickness information. @@ -3256,13 +3295,16 @@ def __init__( CdbAnalysisType(json_data["analysisType"] if "analysisType" in json_data else None), CdbSimulationType(json_data["simulationType"] if "simulationType" in json_data else None), json_data["analysisSettingsFileName"] if "analysisSettingsFileName" in json_data else None, - json_data["useCompactFormat"] if "useCompactFormat" in json_data else None, + json_data["writeSeparateBlocks"] if "writeSeparateBlocks" in json_data else None, + SeparateBlocksFormatType(json_data["separateBlocksFormatType"] if "separateBlocksFormatType" in json_data else None), json_data["exportFastenersAsSwgen"] if "exportFastenersAsSwgen" in json_data else None, json_data["exportRigidBodiesAsRbgen"] if "exportRigidBodiesAsRbgen" in json_data else None, + json_data["writeComponentBasedTies"] if "writeComponentBasedTies" in json_data else None, + json_data["mortarContactForTies"] if "mortarContactForTies" in json_data else None, json_data["writeThicknessFile"] if "writeThicknessFile" in json_data else None, ContactElementTypeParams(model = model, json_data = json_data["contactElementTypes"] if "contactElementTypes" in json_data else None)) else: - all_field_specified = all(arg is not None for arg in [config_settings, pre_solution_settings, material_properties, boundary_conditions, analysis_settings, write_cells, enable_face_based_labels, write_by_zones, consider_general_connectors_as_spot_weld, analysis_type, simulation_type, analysis_settings_file_name, use_compact_format, export_fasteners_as_swgen, export_rigid_bodies_as_rbgen, write_thickness_file, contact_element_types]) + all_field_specified = all(arg is not None for arg in [config_settings, pre_solution_settings, material_properties, boundary_conditions, analysis_settings, write_cells, enable_face_based_labels, write_by_zones, consider_general_connectors_as_spot_weld, analysis_type, simulation_type, analysis_settings_file_name, write_separate_blocks, separate_blocks_format_type, export_fasteners_as_swgen, export_rigid_bodies_as_rbgen, write_component_based_ties, mortar_contact_for_ties, write_thickness_file, contact_element_types]) if all_field_specified: self.__initialize( config_settings, @@ -3277,9 +3319,12 @@ def __init__( analysis_type, simulation_type, analysis_settings_file_name, - use_compact_format, + write_separate_blocks, + separate_blocks_format_type, export_fasteners_as_swgen, export_rigid_bodies_as_rbgen, + write_component_based_ties, + mortar_contact_for_ties, write_thickness_file, contact_element_types) else: @@ -3301,9 +3346,12 @@ def __init__( analysis_type if analysis_type is not None else ( ExportMapdlCdbParams._default_params["analysis_type"] if "analysis_type" in ExportMapdlCdbParams._default_params else CdbAnalysisType(json_data["analysisType"] if "analysisType" in json_data else None)), simulation_type if simulation_type is not None else ( ExportMapdlCdbParams._default_params["simulation_type"] if "simulation_type" in ExportMapdlCdbParams._default_params else CdbSimulationType(json_data["simulationType"] if "simulationType" in json_data else None)), analysis_settings_file_name if analysis_settings_file_name is not None else ( ExportMapdlCdbParams._default_params["analysis_settings_file_name"] if "analysis_settings_file_name" in ExportMapdlCdbParams._default_params else (json_data["analysisSettingsFileName"] if "analysisSettingsFileName" in json_data else None)), - use_compact_format if use_compact_format is not None else ( ExportMapdlCdbParams._default_params["use_compact_format"] if "use_compact_format" in ExportMapdlCdbParams._default_params else (json_data["useCompactFormat"] if "useCompactFormat" in json_data else None)), + write_separate_blocks if write_separate_blocks is not None else ( ExportMapdlCdbParams._default_params["write_separate_blocks"] if "write_separate_blocks" in ExportMapdlCdbParams._default_params else (json_data["writeSeparateBlocks"] if "writeSeparateBlocks" in json_data else None)), + separate_blocks_format_type if separate_blocks_format_type is not None else ( ExportMapdlCdbParams._default_params["separate_blocks_format_type"] if "separate_blocks_format_type" in ExportMapdlCdbParams._default_params else SeparateBlocksFormatType(json_data["separateBlocksFormatType"] if "separateBlocksFormatType" in json_data else None)), export_fasteners_as_swgen if export_fasteners_as_swgen is not None else ( ExportMapdlCdbParams._default_params["export_fasteners_as_swgen"] if "export_fasteners_as_swgen" in ExportMapdlCdbParams._default_params else (json_data["exportFastenersAsSwgen"] if "exportFastenersAsSwgen" in json_data else None)), export_rigid_bodies_as_rbgen if export_rigid_bodies_as_rbgen is not None else ( ExportMapdlCdbParams._default_params["export_rigid_bodies_as_rbgen"] if "export_rigid_bodies_as_rbgen" in ExportMapdlCdbParams._default_params else (json_data["exportRigidBodiesAsRbgen"] if "exportRigidBodiesAsRbgen" in json_data else None)), + write_component_based_ties if write_component_based_ties is not None else ( ExportMapdlCdbParams._default_params["write_component_based_ties"] if "write_component_based_ties" in ExportMapdlCdbParams._default_params else (json_data["writeComponentBasedTies"] if "writeComponentBasedTies" in json_data else None)), + mortar_contact_for_ties if mortar_contact_for_ties is not None else ( ExportMapdlCdbParams._default_params["mortar_contact_for_ties"] if "mortar_contact_for_ties" in ExportMapdlCdbParams._default_params else (json_data["mortarContactForTies"] if "mortarContactForTies" in json_data else None)), write_thickness_file if write_thickness_file is not None else ( ExportMapdlCdbParams._default_params["write_thickness_file"] if "write_thickness_file" in ExportMapdlCdbParams._default_params else (json_data["writeThicknessFile"] if "writeThicknessFile" in json_data else None)), contact_element_types if contact_element_types is not None else ( ExportMapdlCdbParams._default_params["contact_element_types"] if "contact_element_types" in ExportMapdlCdbParams._default_params else ContactElementTypeParams(model = model, json_data = (json_data["contactElementTypes"] if "contactElementTypes" in json_data else None)))) self._custom_params = kwargs @@ -3327,9 +3375,12 @@ def set_default( analysis_type: CdbAnalysisType = None, simulation_type: CdbSimulationType = None, analysis_settings_file_name: str = None, - use_compact_format: bool = None, + write_separate_blocks: bool = None, + separate_blocks_format_type: SeparateBlocksFormatType = None, export_fasteners_as_swgen: bool = None, export_rigid_bodies_as_rbgen: bool = None, + write_component_based_ties: bool = None, + mortar_contact_for_ties: bool = None, write_thickness_file: bool = None, contact_element_types: ContactElementTypeParams = None): """Set the default values of the ``ExportMapdlCdbParams`` object. @@ -3360,12 +3411,18 @@ def set_default( Simulation type for the file. analysis_settings_file_name: str, optional File path to export mapdl analysis settings. - use_compact_format: bool, optional - Option to enable compact format for the cdb blocks. When true, writes a new, more space-efficient cdb format while exporting. The default value is false. + write_separate_blocks: bool, optional + Controls whether element blocks should be written separately. When true, writes elements in separate blocks based on the format specified in separate_blocks_format_type. When false, writes all elements into a single block. + separate_blocks_format_type: SeparateBlocksFormatType, optional + Controls the format type when writing separate element blocks. Only used when write_separate_blocks is true. export_fasteners_as_swgen: bool, optional Option to export fasteners as swgen. When true, translates fasteners into compact swgen blocks in the exported file. The default value is false. export_rigid_bodies_as_rbgen: bool, optional Option to export rigid bodies as rbgen. When true, translates rigid bodies into compact rbgen blocks in the exported file. The default value is false. + write_component_based_ties: bool, optional + Option to write ties using component-based format. When true, writes ties using component selection and surface generation commands instead of explicit element definitions. The default value is false. + mortar_contact_for_ties: bool, optional + Option to enable mortar contact for ties. When true, changes the key options for tie surfaces. The default value is false. write_thickness_file: bool, optional Option to write a thickness file for spotweld fatigue analysis. If true, writes a file named [exportedFilename].cdb.thick.txt containing thickness information. contact_element_types: ContactElementTypeParams, optional @@ -3412,12 +3469,18 @@ def _jsonify(self) -> Dict[str, Any]: json_data["simulationType"] = self._simulation_type if self._analysis_settings_file_name is not None: json_data["analysisSettingsFileName"] = self._analysis_settings_file_name - if self._use_compact_format is not None: - json_data["useCompactFormat"] = self._use_compact_format + if self._write_separate_blocks is not None: + json_data["writeSeparateBlocks"] = self._write_separate_blocks + if self._separate_blocks_format_type is not None: + json_data["separateBlocksFormatType"] = self._separate_blocks_format_type if self._export_fasteners_as_swgen is not None: json_data["exportFastenersAsSwgen"] = self._export_fasteners_as_swgen if self._export_rigid_bodies_as_rbgen is not None: json_data["exportRigidBodiesAsRbgen"] = self._export_rigid_bodies_as_rbgen + if self._write_component_based_ties is not None: + json_data["writeComponentBasedTies"] = self._write_component_based_ties + if self._mortar_contact_for_ties is not None: + json_data["mortarContactForTies"] = self._mortar_contact_for_ties if self._write_thickness_file is not None: json_data["writeThicknessFile"] = self._write_thickness_file if self._contact_element_types is not None: @@ -3426,7 +3489,7 @@ def _jsonify(self) -> Dict[str, Any]: return json_data def __str__(self) -> str: - message = "config_settings : %s\npre_solution_settings : %s\nmaterial_properties : %s\nboundary_conditions : %s\nanalysis_settings : %s\nwrite_cells : %s\nenable_face_based_labels : %s\nwrite_by_zones : %s\nconsider_general_connectors_as_spot_weld : %s\nanalysis_type : %s\nsimulation_type : %s\nanalysis_settings_file_name : %s\nuse_compact_format : %s\nexport_fasteners_as_swgen : %s\nexport_rigid_bodies_as_rbgen : %s\nwrite_thickness_file : %s\ncontact_element_types : %s" % (self._config_settings, self._pre_solution_settings, self._material_properties, self._boundary_conditions, self._analysis_settings, self._write_cells, self._enable_face_based_labels, self._write_by_zones, self._consider_general_connectors_as_spot_weld, self._analysis_type, self._simulation_type, self._analysis_settings_file_name, self._use_compact_format, self._export_fasteners_as_swgen, self._export_rigid_bodies_as_rbgen, self._write_thickness_file, '{ ' + str(self._contact_element_types) + ' }') + message = "config_settings : %s\npre_solution_settings : %s\nmaterial_properties : %s\nboundary_conditions : %s\nanalysis_settings : %s\nwrite_cells : %s\nenable_face_based_labels : %s\nwrite_by_zones : %s\nconsider_general_connectors_as_spot_weld : %s\nanalysis_type : %s\nsimulation_type : %s\nanalysis_settings_file_name : %s\nwrite_separate_blocks : %s\nseparate_blocks_format_type : %s\nexport_fasteners_as_swgen : %s\nexport_rigid_bodies_as_rbgen : %s\nwrite_component_based_ties : %s\nmortar_contact_for_ties : %s\nwrite_thickness_file : %s\ncontact_element_types : %s" % (self._config_settings, self._pre_solution_settings, self._material_properties, self._boundary_conditions, self._analysis_settings, self._write_cells, self._enable_face_based_labels, self._write_by_zones, self._consider_general_connectors_as_spot_weld, self._analysis_type, self._simulation_type, self._analysis_settings_file_name, self._write_separate_blocks, self._separate_blocks_format_type, self._export_fasteners_as_swgen, self._export_rigid_bodies_as_rbgen, self._write_component_based_ties, self._mortar_contact_for_ties, self._write_thickness_file, '{ ' + str(self._contact_element_types) + ' }') message += ''.join('\n' + str(key) + ' : ' + str(value) for key, value in self._custom_params.items()) return message @@ -3575,16 +3638,28 @@ def analysis_settings_file_name(self, value: str): self._analysis_settings_file_name = value @property - def use_compact_format(self) -> bool: - """Option to enable compact format for the cdb blocks. When true, writes a new, more space-efficient cdb format while exporting. The default value is false. + def write_separate_blocks(self) -> bool: + """Controls whether element blocks should be written separately. When true, writes elements in separate blocks based on the format specified in separate_blocks_format_type. When false, writes all elements into a single block. + + **This is a beta parameter**. **The behavior and name may change in the future**. + """ + return self._write_separate_blocks + + @write_separate_blocks.setter + def write_separate_blocks(self, value: bool): + self._write_separate_blocks = value + + @property + def separate_blocks_format_type(self) -> SeparateBlocksFormatType: + """Controls the format type when writing separate element blocks. Only used when write_separate_blocks is true. **This is a beta parameter**. **The behavior and name may change in the future**. """ - return self._use_compact_format + return self._separate_blocks_format_type - @use_compact_format.setter - def use_compact_format(self, value: bool): - self._use_compact_format = value + @separate_blocks_format_type.setter + def separate_blocks_format_type(self, value: SeparateBlocksFormatType): + self._separate_blocks_format_type = value @property def export_fasteners_as_swgen(self) -> bool: @@ -3610,6 +3685,30 @@ def export_rigid_bodies_as_rbgen(self) -> bool: def export_rigid_bodies_as_rbgen(self, value: bool): self._export_rigid_bodies_as_rbgen = value + @property + def write_component_based_ties(self) -> bool: + """Option to write ties using component-based format. When true, writes ties using component selection and surface generation commands instead of explicit element definitions. The default value is false. + + **This is a beta parameter**. **The behavior and name may change in the future**. + """ + return self._write_component_based_ties + + @write_component_based_ties.setter + def write_component_based_ties(self, value: bool): + self._write_component_based_ties = value + + @property + def mortar_contact_for_ties(self) -> bool: + """Option to enable mortar contact for ties. When true, changes the key options for tie surfaces. The default value is false. + + **This is a beta parameter**. **The behavior and name may change in the future**. + """ + return self._mortar_contact_for_ties + + @mortar_contact_for_ties.setter + def mortar_contact_for_ties(self, value: bool): + self._mortar_contact_for_ties = value + @property def write_thickness_file(self) -> bool: """Option to write a thickness file for spotweld fatigue analysis. If true, writes a file named [exportedFilename].cdb.thick.txt containing thickness information. @@ -3840,6 +3939,10 @@ class ExportLSDynaKeywordFileParams(CoreObject): write_thickness_file: bool, optional Option to write a thickness file for spotweld fatigue analysis. If true, writes a file named [exportedFilename].k.thick.txt containing thickness information. + **This is a beta parameter**. **The behavior and name may change in the future**. + output_controls_d3_part: bool, optional + Option to create D3Part card in output controls + **This is a beta parameter**. **The behavior and name may change in the future**. json_data: dict, optional JSON dictionary to create a ``ExportLSDynaKeywordFileParams`` object with provided parameters. @@ -3857,13 +3960,15 @@ def __initialize( output_format: LSDynaFileFormatType, analysis_type: LSDynaAnalysisType, compute_spotweld_thickness: bool, - write_thickness_file: bool): + write_thickness_file: bool, + output_controls_d3_part: bool): self._material_properties = material_properties self._database_keywords = database_keywords self._output_format = LSDynaFileFormatType(output_format) self._analysis_type = LSDynaAnalysisType(analysis_type) self._compute_spotweld_thickness = compute_spotweld_thickness self._write_thickness_file = write_thickness_file + self._output_controls_d3_part = output_controls_d3_part def __init__( self, @@ -3874,6 +3979,7 @@ def __init__( analysis_type: LSDynaAnalysisType = None, compute_spotweld_thickness: bool = None, write_thickness_file: bool = None, + output_controls_d3_part: bool = None, json_data : dict = None, **kwargs): """Initialize a ``ExportLSDynaKeywordFileParams`` object. @@ -3905,6 +4011,10 @@ def __init__( write_thickness_file: bool, optional Option to write a thickness file for spotweld fatigue analysis. If true, writes a file named [exportedFilename].k.thick.txt containing thickness information. + **This is a beta parameter**. **The behavior and name may change in the future**. + output_controls_d3_part: bool, optional + Option to create D3Part card in output controls + **This is a beta parameter**. **The behavior and name may change in the future**. json_data: dict, optional JSON dictionary to create a ``ExportLSDynaKeywordFileParams`` object with provided parameters. @@ -3920,9 +4030,10 @@ def __init__( LSDynaFileFormatType(json_data["outputFormat"] if "outputFormat" in json_data else None), LSDynaAnalysisType(json_data["analysisType"] if "analysisType" in json_data else None), json_data["computeSpotweldThickness"] if "computeSpotweldThickness" in json_data else None, - json_data["writeThicknessFile"] if "writeThicknessFile" in json_data else None) + json_data["writeThicknessFile"] if "writeThicknessFile" in json_data else None, + json_data["outputControlsD3Part"] if "outputControlsD3Part" in json_data else None) else: - all_field_specified = all(arg is not None for arg in [material_properties, database_keywords, output_format, analysis_type, compute_spotweld_thickness, write_thickness_file]) + all_field_specified = all(arg is not None for arg in [material_properties, database_keywords, output_format, analysis_type, compute_spotweld_thickness, write_thickness_file, output_controls_d3_part]) if all_field_specified: self.__initialize( material_properties, @@ -3930,7 +4041,8 @@ def __init__( output_format, analysis_type, compute_spotweld_thickness, - write_thickness_file) + write_thickness_file, + output_controls_d3_part) else: if model is None: raise ValueError("Invalid assignment. Either pass a model or specify all properties.") @@ -3943,7 +4055,8 @@ def __init__( output_format if output_format is not None else ( ExportLSDynaKeywordFileParams._default_params["output_format"] if "output_format" in ExportLSDynaKeywordFileParams._default_params else LSDynaFileFormatType(json_data["outputFormat"] if "outputFormat" in json_data else None)), analysis_type if analysis_type is not None else ( ExportLSDynaKeywordFileParams._default_params["analysis_type"] if "analysis_type" in ExportLSDynaKeywordFileParams._default_params else LSDynaAnalysisType(json_data["analysisType"] if "analysisType" in json_data else None)), compute_spotweld_thickness if compute_spotweld_thickness is not None else ( ExportLSDynaKeywordFileParams._default_params["compute_spotweld_thickness"] if "compute_spotweld_thickness" in ExportLSDynaKeywordFileParams._default_params else (json_data["computeSpotweldThickness"] if "computeSpotweldThickness" in json_data else None)), - write_thickness_file if write_thickness_file is not None else ( ExportLSDynaKeywordFileParams._default_params["write_thickness_file"] if "write_thickness_file" in ExportLSDynaKeywordFileParams._default_params else (json_data["writeThicknessFile"] if "writeThicknessFile" in json_data else None))) + write_thickness_file if write_thickness_file is not None else ( ExportLSDynaKeywordFileParams._default_params["write_thickness_file"] if "write_thickness_file" in ExportLSDynaKeywordFileParams._default_params else (json_data["writeThicknessFile"] if "writeThicknessFile" in json_data else None)), + output_controls_d3_part if output_controls_d3_part is not None else ( ExportLSDynaKeywordFileParams._default_params["output_controls_d3_part"] if "output_controls_d3_part" in ExportLSDynaKeywordFileParams._default_params else (json_data["outputControlsD3Part"] if "outputControlsD3Part" in json_data else None))) self._custom_params = kwargs if model is not None: [ model._logger.warning(f'Unsupported argument : {key}') for key in kwargs ] @@ -3958,7 +4071,8 @@ def set_default( output_format: LSDynaFileFormatType = None, analysis_type: LSDynaAnalysisType = None, compute_spotweld_thickness: bool = None, - write_thickness_file: bool = None): + write_thickness_file: bool = None, + output_controls_d3_part: bool = None): """Set the default values of the ``ExportLSDynaKeywordFileParams`` object. Parameters @@ -3975,6 +4089,8 @@ def set_default( Option to compute spot weld thickness using shell thickness when set to true. Else, use search radius as thickness. write_thickness_file: bool, optional Option to write a thickness file for spotweld fatigue analysis. If true, writes a file named [exportedFilename].k.thick.txt containing thickness information. + output_controls_d3_part: bool, optional + Option to create D3Part card in output controls """ args = locals() [ExportLSDynaKeywordFileParams._default_params.update({ key: value }) for key, value in args.items() if value is not None] @@ -4005,11 +4121,13 @@ def _jsonify(self) -> Dict[str, Any]: json_data["computeSpotweldThickness"] = self._compute_spotweld_thickness if self._write_thickness_file is not None: json_data["writeThicknessFile"] = self._write_thickness_file + if self._output_controls_d3_part is not None: + json_data["outputControlsD3Part"] = self._output_controls_d3_part [ json_data.update({ utils.to_camel_case(key) : value }) for key, value in self._custom_params.items()] return json_data def __str__(self) -> str: - message = "material_properties : %s\ndatabase_keywords : %s\noutput_format : %s\nanalysis_type : %s\ncompute_spotweld_thickness : %s\nwrite_thickness_file : %s" % (self._material_properties, self._database_keywords, self._output_format, self._analysis_type, self._compute_spotweld_thickness, self._write_thickness_file) + message = "material_properties : %s\ndatabase_keywords : %s\noutput_format : %s\nanalysis_type : %s\ncompute_spotweld_thickness : %s\nwrite_thickness_file : %s\noutput_controls_d3_part : %s" % (self._material_properties, self._database_keywords, self._output_format, self._analysis_type, self._compute_spotweld_thickness, self._write_thickness_file, self._output_controls_d3_part) message += ''.join('\n' + str(key) + ' : ' + str(value) for key, value in self._custom_params.items()) return message @@ -4085,6 +4203,18 @@ def write_thickness_file(self) -> bool: def write_thickness_file(self, value: bool): self._write_thickness_file = value + @property + def output_controls_d3_part(self) -> bool: + """Option to create D3Part card in output controls + + **This is a beta parameter**. **The behavior and name may change in the future**. + """ + return self._output_controls_d3_part + + @output_controls_d3_part.setter + def output_controls_d3_part(self, value: bool): + self._output_controls_d3_part = value + class ExportLSDynaResults(CoreObject): """Results associated with the LS-DYNA export. diff --git a/src/ansys/meshing/prime/autogen/primeconfig.py b/src/ansys/meshing/prime/autogen/primeconfig.py index dbae59b052..ac02f73312 100644 --- a/src/ansys/meshing/prime/autogen/primeconfig.py +++ b/src/ansys/meshing/prime/autogen/primeconfig.py @@ -801,6 +801,18 @@ class ErrorCode(enum.IntEnum): AUTOQUADMESHER_INVALIDMINMAXSIZES = 15001 """Difference in maximum value and minimum value is negative. + **This is a beta parameter**. **The behavior and name may change in the future**.""" + IMPORTABAQUSFAILEDWITHUNKNOWNERROR = 16200 + """Import Abaqus failed. Failed with unknown error. + + **This is a beta parameter**. **The behavior and name may change in the future**.""" + IMPORTABAQUSFAILEDWITHPARSINGFAILURE = 16201 + """Import Abaqus failed. Failed to parse file. + + **This is a beta parameter**. **The behavior and name may change in the future**.""" + IMPORTABAQUSFAILEDDURINGMESHCREATION = 16202 + """Import Abaqus failed. Failed to create mesh entities. + **This is a beta parameter**. **The behavior and name may change in the future**.""" ZEROELEMENTSREADFROMCDBFILE = 16500 """No elements read from CDB file. diff --git a/src/ansys/meshing/prime/core/fileio.py b/src/ansys/meshing/prime/core/fileio.py index b7a5481298..f236fe512d 100644 --- a/src/ansys/meshing/prime/core/fileio.py +++ b/src/ansys/meshing/prime/core/fileio.py @@ -54,6 +54,7 @@ ImportMapdlCdbParams, ImportMapdlCdbResults, ReadSizeFieldParams, + SeparateBlocksFormatType, SizeFieldFileReadResults, WriteSizeFieldParams, ) @@ -342,7 +343,7 @@ def initialize_cdb_export_params( """ Initialize specific CDB export parameters based on the given version. - This function sets the use_compact_format, export_fasteners_as_swgen and + This function sets the separate_blocks_format_type, export_fasteners_as_swgen and export_rigid_bodies_as_rbgen parameters of the provided ExportMapdlCdbParams object based on the given major and minor version numbers. Other parameters remain unchanged. @@ -366,16 +367,16 @@ def initialize_cdb_export_params( **This is a beta API**. **The behavior and implementation may change in future**. The version is formed as "r", e.g., "24r1", "25r2". - If the version is greater than or equal to "25r1", the use_compact_format, - export_fasteners_as_swgen and export_rigid_bodies_as_rbgen parameters are set - to True. Otherwise, they are set to False. + If the version is greater than or equal to "25r1", write_separate_blocks is set to True + with COMPACT format, and export_fasteners_as_swgen and export_rigid_bodies_as_rbgen + parameters are set to True. Otherwise, they are set to False. Examples -------- >>> file_io = prime.FileIO(model=model) >>> params = prime.ExportMapdlCdbParams() >>> params = file_io.initialize_cdb_export_params(params, 24, 1) - >>> params.use_compact_format + >>> params.write_separate_blocks False >>> params.export_fasteners_as_swgen False @@ -385,15 +386,21 @@ def initialize_cdb_export_params( >>> file_io = prime.FileIO(model=model) >>> params = prime.ExportMapdlCdbParams() >>> params = file_io.initialize_cdb_export_params(params, 25, 2) - >>> params.use_compact_format + >>> params.write_separate_blocks True + >>> params.separate_blocks_format_type + SeparateBlocksFormatType.COMPACT >>> params.export_fasteners_as_swgen True >>> params.export_rigid_bodies_as_swgen True """ version = f"{major_version}r{minor_version}" - params.use_compact_format = version >= "25r1" + params.write_separate_blocks = version >= "25r1" + if version >= "25r1": + params.separate_blocks_format_type = SeparateBlocksFormatType.COMPACT + else: + params.separate_blocks_format_type = SeparateBlocksFormatType.STANDARD params.export_fasteners_as_swgen = version >= "25r1" params.export_rigid_bodies_as_rbgen = version >= "25r1" return params diff --git a/src/ansys/meshing/prime/core/mapdlcdbexportutils.py b/src/ansys/meshing/prime/core/mapdlcdbexportutils.py index 879f89b6ff..3a5ed7ace6 100644 --- a/src/ansys/meshing/prime/core/mapdlcdbexportutils.py +++ b/src/ansys/meshing/prime/core/mapdlcdbexportutils.py @@ -658,6 +658,7 @@ class _MaterialProcessor: __slots__ = ( '_raw_materials_data', '_zone_data', + '_enable_hm_comments', '_mat_id', '_material_linked_to_zone_type', '_cohezive_zone_thickness_data', @@ -666,10 +667,11 @@ class _MaterialProcessor: '_logger', ) - def __init__(self, model: prime.Model, raw_materials_data, zone_data): + def __init__(self, model: prime.Model, raw_materials_data, zone_data, hm_comments=False): self._raw_materials_data = raw_materials_data self._zone_data = zone_data self._mat_id = 0 + self._enable_hm_comments = hm_comments self._material_linked_to_zone_type = {} self._cohezive_zone_thickness_data = {} self._property_function_map = { @@ -762,7 +764,13 @@ def _get_mat_comands(self, material): 'DAMAGE EVOLUTION', ] # self._logger.info(mat_data) - mapdl_text_data = f"! material '{material}' \n" + mapdl_text_data = "" + hm_comment = self._enable_hm_comments + if hm_comment: + mapdl_text_data += "!!HMNAME MAT \n" + mapdl_text_data += f'!!{self._mat_id:>10} "{material}"\n' + else: + mapdl_text_data += f"! material '{material}' \n" if "Parameters" in mat_data: self._logger.warning(f"Parameter on Material {material} are not processed.") for prop in mat_data: @@ -1030,7 +1038,10 @@ def _process_elastic_modulus(self, property_dict, material, mat_id): data = [] if 'Data' in property_dict and property_dict['Data'] is not None: data = property_dict['Data'] - if property_dict["Parameters"]["TYPE"] == "ISOTROPIC": + if ( + property_dict["Parameters"]["TYPE"] == "ISOTROPIC" + or property_dict["Parameters"]["TYPE"] == "ISO" + ): # self._logger.warning(f"Only isotropic elastic modulus is processed, " # f"Elastic Modulus for the material {material} " # f"is not processed.") @@ -1056,15 +1067,19 @@ def _process_elastic_modulus(self, property_dict, material, mat_id): f"for material {material}" ) if self._material_linked_to_zone_type[material] == 'Cohesive': - elastic_modulus += f"TB, GASKET, {mat_id}, 1, 2,elas\n" + elastic_modulus += f"TB, ELAS, {mat_id}, 1, 2,ISOT\n" elastic_modulus += f"TBDATA, 1, {youngs_mod[0]}, {nu[0]}\n" + # elastic_modulus += f"TB, GASKET, {mat_id}, 1, 2,elas\n" + # elastic_modulus += f"TBDATA, 1, {youngs_mod[0]}, {nu[0]}\n" else: elastic_modulus += f"MP,EX,{mat_id},{youngs_mod[0]}\n" elastic_modulus += f"MP,NUXY,{mat_id},{nu[0]}\n" else: if self._material_linked_to_zone_type[material] == 'Cohesive': - elastic_modulus += f"TB, GASKET, {mat_id}, 1, 2,elas\n" + elastic_modulus += f"TB, ELAS, {mat_id}, 1, 2,ISOT\n" elastic_modulus += f"TBDATA, 1, {youngs_mod[0]}, {nu[0]}\n" + # elastic_modulus += f"TB, GASKET, {mat_id}, 1, 2,elas\n" + # elastic_modulus += f"TBDATA, 1, {youngs_mod[0]}, {nu[0]}\n" else: elastic_modulus += f"MP,EX,{mat_id},{youngs_mod[0]}\n" elastic_modulus += f"MP,NUXY,{mat_id},{nu[0]}\n" @@ -1356,14 +1371,16 @@ class _JointMaterialProcessor: __slots__ = ( '_raw_joint_materials_data', '_mat_id', + '_enable_hm_comments', '_property_function_map', '_model', '_logger', ) - def __init__(self, model: prime.Model, raw_joint_materials_data): + def __init__(self, model: prime.Model, raw_joint_materials_data, hm_comments=False): self._raw_joint_materials_data = raw_joint_materials_data self._mat_id = 0 + self._enable_hm_comments = hm_comments self._property_function_map = { 'CONNECTOR ELASTICITY': self._process_elasticity, 'CONNECTOR DAMPING': self._process_damping, @@ -1385,7 +1402,13 @@ def _get_mat_comands(self, material): self._mat_id = mat_data['id'] processed_entities = ['CONNECTOR ELASTICITY', 'CONNECTOR DAMPING'] # self._logger.info(mat_data) - mapdl_text_data = f"! material '{material}' \n" + mapdl_text_data = "" + hm_comment = self._enable_hm_comments + if hm_comment: + mapdl_text_data += "!!HMNAME MAT \n" + mapdl_text_data += f'!!{self._mat_id:>10} "{material}"\n' + else: + mapdl_text_data += f"! material '{material}' \n" if "Parameters" in mat_data: self._logger.warning(f"Parameter on Material {material} are not processed.") for prop in mat_data: @@ -1474,7 +1497,7 @@ def _process_elasticity(self, property_dict, material, mat_id): else: if 'RIGID' in comp_data['Parameters']: ff = comps_linear_mapping[comp_data['Parameters']['COMPONENT']] - elasticity_data += f"TBDATA, {ff}, 1e8\n" + elasticity_data += f"TBDATA, {ff}, 1e6\n" continue if 'NONLINEAR' in comp_data['Parameters']: relative_disp = comp_data['Data']["Displacement"] @@ -1642,12 +1665,12 @@ def _process_elasticity(self, property_dict, material, mat_id): cds = comp_data['Data']['Stiffness'][0] elasticity_data += f"TBDATA, {clms}, {cds}\n" else: - elasticity_data += f"TBDATA, 1, 1e8\n" - elasticity_data += f"TBDATA, 7, 1e8\n" - elasticity_data += f"TBDATA, 12, 1e8\n" - elasticity_data += f"TBDATA, 16, 1e8\n" - elasticity_data += f"TBDATA, 19, 1e8\n" - elasticity_data += f"TBDATA, 21, 1e8\n" + elasticity_data += f"TBDATA, 1, 1e6\n" + elasticity_data += f"TBDATA, 7, 1e6\n" + elasticity_data += f"TBDATA, 12, 1e6\n" + elasticity_data += f"TBDATA, 16, 1e6\n" + elasticity_data += f"TBDATA, 19, 1e6\n" + elasticity_data += f"TBDATA, 21, 1e6\n" return elasticity_data def _process_damping(self, property_dict, material, mat_id): @@ -2668,8 +2691,8 @@ def get_global_damping_commands(self, analysis, msup=False): damping_commands += f"DMPRAT, {structural/2}\n" elif analysis == "STEADY STATE DYNAMICS": damping_commands += f"DMPSTR, {structural}\n" - # elif analysis == "FREQUENCY": - # damping_commands += f"DMPSTR, {structural}\n" + elif analysis == "FREQUENCY": + damping_commands += f"DMPSTR, {structural}\n" else: self._logger.warning( 'Global damping under STEP is not processed. Please check the results' @@ -3345,12 +3368,12 @@ def get_output_analysis_data(self, output_data): output_analysis_commands += "OUTRES, ERASE\n" output_analysis_commands += "OUTRES, ALL, NONE\n" if time_points: - output_analysis_commands += f"OUTRES, EANGL, %{time_points}%\n" + output_analysis_commands += f"! OUTRES, EANGL, %{time_points}%\n" else: # output_analysis_commands += "OUTRES, ALL, NONE\n" # TODO Removed this line to avoid complications of # multiple tabular output controls with NINTERVAL - output_analysis_commands += "OUTRES, EANGL, NONE\n" + output_analysis_commands += "! OUTRES, EANGL, NONE\n" pass output_analysis_commands += "\n" @@ -3852,6 +3875,7 @@ def create_modal_vectors(self): vector_commands += f'ACEL, 0, 0, 0 \n' vector_commands += f'\n' if data_line['node_set'].isnumeric(): + cmname = data_line['node_set'] vector_commands += ( f"F, " f"{data_line['node_set']}, " f"{dof_map[dof]}, 1\n" ) @@ -3861,10 +3885,10 @@ def create_modal_vectors(self): ) vector_commands += f"F, " f"{cmname}, " f"{dof_map[dof]}, 1\n" count_load_vectors += 1 - self._modal_load_vectors[count_load_vectors] = { - 'SET': cmname, - "COMP": dof_map[dof], - } + self._modal_load_vectors[count_load_vectors] = { + 'SET': cmname, + "COMP": dof_map[dof], + } if "BaseMotion" in step_data: base_motions_data = step_data['BaseMotion'] for base_motion_data in base_motions_data: @@ -4098,7 +4122,7 @@ def _process_step(self, step_data): mapdl_step_commands += 'DMPOPT, ESAV, NO \n' mapdl_step_commands += 'DMPOPT, EMAT, NO \n' mapdl_step_commands += 'DMPOPT, FULL, NO \n' - mapdl_step_commands += 'DMPOPT, MODE, NO \n' + mapdl_step_commands += 'DMPOPT, MODE, YES \n' mapdl_step_commands += 'DMPOPT, MLV, NO \n' mapdl_step_commands += '\n' if self._step_counter == 1: @@ -4175,16 +4199,23 @@ class _AxialTempCorrection: '_connector_sections', '_connector_behavior', '_element_wise_csys', + '_enable_hm_comments', '_model', '_logger', ) def __init__( - self, model: prime.Model, connector_sections, connector_behavior, element_wise_csys=False + self, + model: prime.Model, + connector_sections, + connector_behavior, + element_wise_csys=False, + hm_comments=False, ): self._connector_sections = connector_sections self._connector_behavior = connector_behavior self._element_wise_csys = element_wise_csys + self._enable_hm_comments = hm_comments self._model = model self._logger = model.python_logger @@ -4229,7 +4260,9 @@ def _modify_section_data(self, behavior_data): secdata_string = '' if "CONNECTOR CONSTITUTIVE REFERENCE" in behavior_data: secdata_string += self._modify_section_type(behavior_data) - joint_a_processor = _JointMaterialProcessor(self._model, self._connector_behavior) + joint_a_processor = _JointMaterialProcessor( + self._model, self._connector_behavior, self._enable_hm_comments + ) ref_lens = joint_a_processor._precess_ref_length( behavior_data["CONNECTOR CONSTITUTIVE REFERENCE"] ) @@ -4319,7 +4352,10 @@ def generate_mapdl_commands( return all_mat_cmds, analysis_settings if "Materials" in json_simulation_data and json_simulation_data["Materials"] is not None: mp = _MaterialProcessor( - model, json_simulation_data["Materials"], json_simulation_data["Zones"] + model, + json_simulation_data["Materials"], + json_simulation_data["Zones"], + params.write_separate_blocks, ) mat_cmds = mp.get_all_material_commands() all_mat_cmds = mat_cmds @@ -4327,7 +4363,9 @@ def generate_mapdl_commands( "ConnectorBehavior" in json_simulation_data and json_simulation_data["ConnectorBehavior"] is not None ): - jmp = _JointMaterialProcessor(model, json_simulation_data["ConnectorBehavior"]) + jmp = _JointMaterialProcessor( + model, json_simulation_data["ConnectorBehavior"], params.write_separate_blocks + ) joint_all_mat_cmds = jmp.get_all_material_commands() all_mat_cmds += joint_all_mat_cmds general_contact_cmds = '' diff --git a/src/ansys/meshing/prime/internals/error_handling.py b/src/ansys/meshing/prime/internals/error_handling.py index 40003dd369..6cfbc856b9 100644 --- a/src/ansys/meshing/prime/internals/error_handling.py +++ b/src/ansys/meshing/prime/internals/error_handling.py @@ -333,6 +333,9 @@ ErrorCode.AUTOQUADMESHER_INVALIDMINMAXSIZES: "Minimum size is more than maximum size.", ErrorCode.AUTOQUADMESHER_NEGATIVEINPUTPARAMETER: "Input parameters contain one or more negative values.", ErrorCode.FACEZONELETSHAVECELLSCONNECTED: "Face zonelets have cells connected.", + ErrorCode.IMPORTABAQUSFAILEDWITHUNKNOWNERROR: "Failed to import abaqus file. Unknown error.", + ErrorCode.IMPORTABAQUSFAILEDWITHPARSINGFAILURE: "Failed to import abaqus file. Failed to parse file.", + ErrorCode.IMPORTABAQUSFAILEDDURINGMESHCREATION: "Failed to import abaqus file. Mesh creation failed after parsing.", ErrorCode.ZEROELEMENTSREADFROMCDBFILE: "No mesh elements found. Check the input CDB file.", ErrorCode.ZERONODESREADFROMCDBFILE: "No nodes found. Check the input CDB file.", ErrorCode.ZEROELEMENTSFORCDBEXPORT: "No mesh elements found for CDB export. Check if the model is meshed, or set write_by_zones in ExportMapdlCdbParams to false if zones are not defined.",