get_composite_files_from_workbench_result_folder#

ansys.dpf.composites.data_sources.get_composite_files_from_workbench_result_folder(result_folder, ensure_composite_definitions_found=True)#

Get a ContinuousFiberCompositesFiles object from a result folder.

This function assumes a typical Workbench folder structure for a composite simulation. If this method is not able to build the ContinuousFiberCompositesFiles object, you can follow these steps:

In the main Workbench window, activate the files panel by selecting View > Files. This shows the location of all files used in the workbench project. You can determine the different attributes of the ContinuousFiberCompositesFiles object:

  • rst: A list of files containing either the single file.rst file that belongs to the cell ID of the solution, or the distributed file0.rst to fileN.rst files.

  • engineering_data: The MatML.xml file in the same folder as the RST file.

  • composite: There can be multiple composite definitions, one definition for each ACP system if shell data is transferred and one definition for each solid model if solid data is transferred. All the ACPCompositeDefinitions.h5 and ACPSolidModel*.h5 files that are used in the solution must be added to the ContinuousFiberCompositesFiles.composite dictionary. The key can be chosen freely. Next to the ACPCompositeDefinitions.h5 and ACPSolidModel\*.h5 files, corresponding ACPCompositeDefinitions.mapping and ACPSolidModel*.mapping files can be found (optional). If they exist, they must be added as well.

The following example shows how a ContinuousFiberCompositesFiles object can be built. The project in this example has two ACP Pre systems, one that exports shell information and one that exports solid information.

The files are located in these locations:

Result file:

  • project_root_folder/dp0/SYS/MECH/file.rst

Engineering data file:

  • project_root_folder/dp0/SYS/MECH/MatML.xml

Composite definition and mapping files for the solid model:

  • project_root_folder/dp0/ACP-Pre-1/ACPSolidModel_SM.h5

  • project_root_folder/dp0/ACP-Pre-1/ACPSolidModel_SM.mapping

Composite definition and mapping files for the shell model:

  • project_root_folder/dp0/ACP-Pre-2/ACPCompositeDefinitions.h5

  • project_root_folder/dp0/ACP-Pre-2/ACPCompositeDefinitions.mapping

The code creates the corresponding ContinuousFiberCompositesFiles object:

ContinuousFiberCompositesFiles(
    rst=["project_root_folder/dp0/SYS/MECH/file.rst"],
    composite={
       "solid": CompositeDefinitionFiles(
            definition="project_root_folder/dp0/ACP-Pre-1/ACPSolidModel_SM.h5",
            mapping="project_root_folder/dp0/ACP-Pre-1/ACPSolidModel_SM.mapping"
        ),
       "shell": CompositeDefinitionFiles(
            definition="project_root_folder/dp0/ACP-Pre-2/ACPCompositeDefinitions.h5",
            mapping="project_root_folder/dp0/ACP-Pre-2/ACPCompositeDefinitions.mapping"
        )
    },
    engineering_data="project_root_folder/dp0/SYS/MECH/MatML.xml"
)
Parameters:
  • result_folder (Union[str, PathLike[str]]) – Result folder of the solution. Right-click the solution item in the Ansys Mechanical tree and select Open Solver Files Directory to obtain the result folder.

  • ensure_composite_definitions_found (bool, default: True) – Whether to check if at least one composite definition (shell or solid) has been found.

Return type:

ContinuousFiberCompositesFiles