6.13.1.6. Importing Mesh-Based Databases in Batch

The Mechanical installation includes an executable file (Ans.StandaloneExternalModelConsole.exe) that enables you to import solver input files. This input file describes a model through various data, including, but not limited to, mesh data, materials, loads and boundary conditions, as well as analysis settings. The executable is able to parse an input file and produce two types of output files:

  1. A solver file that is based on a specific solver, such as the Mechanical APDL solver or the LS-DYNA solver. This means that the output solver file can be processed by the specified solver. Furthermore, you can optionally choose to save this output file as a Mechanical database (*.mechdb) file, which includes a Mechanical system as well as the target system.

  2. A Mechanical database (*.mechdb) file. You can then use this database in the Mechanical application, where you can add a target analysis system. When opened in the application, *.mechdb files produce an analysis system in Mechanical that generates objects included with the Model object, not including an analysis system. Although it is the simplest workflow, this method requires you to manually complete setting up the analysis.

Based on your platform, the executable file is located in the following directory:

Windows

"<installation_directory>\aisol\bin\winx64\Ans.StandaloneExternalModelConsole.exe"

Linux

"<installation_directory>/aisol/.workbench -cmd <installation_directory>/aisol/bin/linx64/Ans.StandaloneExternalModelConsole.exe"

Go to a section topic:

Requirements and Limitations

This feature supports:

  • The input of the following solver files:

    • Mechanical APDL common database (.cdb)

    • ABAQUS Input (.inp)

    • LS-DYNA Input (.k and .key)

  • Single input files only. This feature does not support model assembly.


Important:  For ABAQUS and LS-DYNA input files that contain the *INCLUDE keyword, the application also processes the dependent files.


Required Arguments

You must use one of the following arguments:

  • --input_solver_file (Import a solver file using default settings).

  • --input_settings (Import a solver file using settings specified in TOML file format).

Command Entry

Use the following to execute the command and specify the required and optional arguments.

  1. Open the Command Prompt window.

  2. At the command prompt, specify the desired directory location. For example:

    "C:\ANSYS Inc\v241\aisol\bin\winx64\Ans.StandaloneExternalModelConsole.exe"

  3. Based on your desired output, specify one of the following required argument combinations:

    • --input_solver_file: Import a solver file and create a Mechanical database (up to Model object level).

      For example: Ans.StandaloneExternalModelConsole.exe --input_solver_file <file_path to solver input file> --save_mech_db

    • --input_settings: Create solver file based on target analysis as well as creating an optional Mechanical database with the analysis system.

      For example: Ans.StandaloneExternalModelConsole.exe --input_settings <file_path to TOML file> --save_mech_db

  4. As desired, specify additional arguments as described below.


Tip:  You can drag and drop files into the Command Prompt window to automatically generate the file path entry.


Command Entry Example 1

"C:\Program Files\ANSYS Inc\v241\aisol\bin\winx64\Ans.StandaloneExternalModelConsole.exe" --input_solver_file "C:\Parts\Mesh\Mech_CDB\Esys.cdb" --save_mech_db --output_dir_path "c:\"

This command entry imports a cdb solver file and generates a Mechanical database.

Where:

This entry initiates the execution of the file.

"C:\Program Files\ANSYS Inc\v241\aisol\bin\winx64\Ans.StandaloneExternalModelConsole.exe"

This argument specifies that you want to import a cdb file during the batch process. In this example the full path to the cdb file is given. If the executable is run in "C:\Parts\Mesh\Mech_CDB" you could use simply "Esys.cdb".

--input_solver_file "C:\Parts\Mesh\Mech_CDB\Esys.cdb"

This argument specifies that you want to generate and save a Mechanical database to a file during the batch process.

--save_mech_db

In this example the output file will be written to c:\. If you want to write the output file to the location where the executable is running you could use ".".

For example, if you are running the executable in "C:\Parts\Mesh\Mech_CDB" and you use "." the output file would be written to "C:\Parts\Mesh\Mech_CDB".

--output_dir_path "c:\"

Command Entry Example 2

"C:\Program Files\ANSYS Inc\v241\aisol\bin\winx64\Ans.StandaloneExternalModelConsole.exe" --input_settings Example2.toml --write_solver_file --output_dir_path c:\

This command entry uses the Example2.toml file to 1) import a solver file (as defined in the --input settings argument) and 2) output a solver file (as defined by the SolverType option).

The output solver file is written to c:\ as prescribed by the --output_dir_path.

The Example2.toml file is a text file with the following content:

[MeshFileOptions]
FilePath = 'C:\Example2.k'
FileUnitSystemName = "MKS_STANDARD"

[ConversionOptions]
TopologyCreationMode = "MeshOnly"

[EnvironmentOptions]
AnalysisType = "Static"
PhysicsType = "Structural"
SolverFileName = "Example2.dat"
SolverType = "ANSYS"

These entries specify the following:

FilePath: The path to and location of the input file.
FileUnitSystemName: Units system.
TopologyCreationMode: Specify whether to import the mesh, geometry, or both.
AnalysisType: Analysis type.
PhysicsType: Physics type.
SolverFileName: Name of the output file. Note that the application automatically creates a directory called StandaloneExternalModelConsole_files and the application places the output file in this directory. For the above example, the output file will be created in c:\StandaloneExternalModelConsole_files\Example2.dat.
SolverType: Specifies the solver output file type.
Supported Arguments

Supported arguments include:

ArgumentDescription
--helpProduce a help message.
--input_solver_file <file_path>Import a solver input file and output a Mechanical *.mechdb file. Mesh data, materials, loads and boundary conditions will be created in the Mechanical database for objects included at the Model object level. Analysis specific settings will not be processed because a target solver is not known.
--input_settings <file_path>Point to a TOML file, which in turn points to a solver input file and additional settings. The TOML file needs to be complete as describes below. The [MeshFileOptions] need to point to an input solver file and the [EnvironmentOptions] need to point to the desired target solver system.
--logging

Create External Model and Mechanical log files in the directory specified by --output_dir_path or the %TMP% directory if not specified. The Mechanical log file that will be created is called workbench.log and the external model log files are created in a sub-folder called _ExternalModelLogs.

--output_dir_path <directory_path>Create output files in the provided directory. If this argument is missing, the directory behind the Temp environment variable is used.
--save_mech_dbSave the current session as a Mechanical database.
--write_solver_fileWrite a solver file. This argument requires the --input_settings argument that defines several options including the input file (FilePath), and any related options along with conversion and analysis options. When using this option, the application automatically creates the directory StandaloneExternalModelConsole_files. The output file is placed in this directory.
TOML File

To use the --input_settings <file_path> argument, you must create a TOML file - Tom's Obvious, Minimal Language TOML (.toml). This file is referenced by the input argument. The settings in the TOML file are grouped in categories (as a TML table) and each category contains a list of options as pairs: name = value.

This file has mandatory and optional entries.

Example File

The following example shows the settings for the categories MeshFileOptions, ConversionOptionsand EnvironmentOptions:

# Example TOML File
[MeshFileOptions]

FilePath = 
FileUnitSystemName = 'BIN_CONSISTENT'
NodeComponentPrefixes = 'ROT'
ElementComponentPrefixes = 'ROT'
ElementFaceComponentPrefixes = 'ROT'

[ConversionOptions]
FaceAngle = 45.0
EdgeAngle = 120.0
TopologyCreationMode = 'GeometryAndMesh'
CreateGeometryFaceComponents = true
CreateGeometryEdgeComponents = true
CreateGeometryVertexComponents = true

[EnvironmentOptions]
AnalysisType = 'Static'
PhysicsType = 'Structural'
SolverType = 'ANSYS'
Categories and Options

The supported TOML categories and their options are described below.

[MeshFileOptions]

CategoryOption
FilePath: [string][mandatory]Specify the full path to the solver file to be imported, or simply specify the name of the input file as long as the file is located in the directory where the executable is running. Use single quotes to enclose the entry to avoid problems with spaces or other characters in the file path.
FileUnitSystemName: [string][optional]Unit system name to use when importing. Supported values include:
"SI"
"MKS_STANDARD"
"CGS_STANDARD"
"NMM_STANDARD"
"NMMTON_STANDARD"
"BFT_STANDARD"
"BIN_STANDARD"
"UMKS_STANDARD"
"MKS_CONSISTENT"
"CGS_CONSISTENT"
"NMM_STANDARD"
"BFT_CONSISTENT"
"BIN_CONSISTENT"
"UMKS_CONSISTENT"
"KGMMMS_CONSISTENT"
"MKS_CONSISTENT"
"CGS_CONSISTENT"
"NMM_STANDARD"
"BFT_CONSISTENT"
"BIN_CONSISTENT"
"UMKS_CONSISTENT"
"KGMMMS_CONSISTENT"
SupportingFiles: [array of strings][optional]List of included files to use as included file paths. These paths appear in the commands *INCLUDE for ABAQUS, *INCLUDE/*INCLUDE_TRANSFORM for LS-Dyna, INCLUDE for Nastran. If specified, only the specified files will be processed. If not specified, all the included files will be processed.
ProcessMesh200FromCdb: [boolean][optional]For .cdb files process, MESH200 element types. Supported values include true and false.
NodeComponentPrefixes: [string][optional]Only import nodal components whose names start with the provided prefixes. The prefixes are to be separated by ';' in the provided string.
ElementComponentPrefixes: [string][optional]Only import elemental components whose names start with the provided prefixes. The prefixes are to be separated by ';' in the provided string.
ElementFaceComponentPrefixes: [string][optional]Only import element-face components whose names start with the provided prefixes. The prefixes are to be separated by ';' in the provided string.

[ConversionOptions] (Optional Entries)

OptionDescription
FaceAngle: [double][optional]Tolerance angle for faces.
EdgeAngle: [double][optional]Tolerance angle for edges.
ProcessLineBodies: [boolean][optional]Import line elements as line bodies. Supported values include true and false.
BodyGrouping: [array of strings][optional]Body grouping to use for import. Supported values include:
"Material"
"Thickness"
"AnsysElementNumber"
TopologyCreationMode: [string][optional]Specifies whether geometry and/or mesh should be generated by the import. Supported values:
"GeometryAndMesh"
"MeshOnly"
"GeometryOnly"
KeepOnlyXYPlanarElements: [boolean][optional]Only import 2d elements in the X-Y plane. Supported values include true and false.
TwoDTolerance: [double][optional]Tolerance value to use for the KeepOnlyXYPlanarElements option.
CreateGeometryFaceComponents: [boolean][optional]Attempt to create geometric face named selections from components. Supported values include true and false.
CreateGeometryEdgeComponents: [boolean][optional]Attempt to create geometric edge named selections from components. Supported values include true and false.
CreateGeometryVertexComponents: [boolean][optional]Attempt to create geometric face vertex selections from components. Supported values include true and false.

[MechanicalOptions]

OptionDescription
AutoContactDetectionOnAttach [boolean][optional]This option runs Mechanical auto-contact detection when importing the solver file. Supported values include true and false.
ActiveUnitSystemName [string][optional]

Unit system to use when writing the solver file or saving the mechdb. Supported values include:

MKS_STANDARD (default)
CGS_STANDARD
NMM_STANDARD
NMMTON_STANDARD
NMMDAT_STANDARD
UMKS_STANDARD
BFT_STANDARD
BIN_STANDARD

[EnvironmentOptions] (Mandatory Entries only when --write_solver_file is used.)

OptionDescription
AnalysisType: [string][mandatory]Specify the analysis type. Supported values include:
"Static"
"SteadyState"
"Harmonic"
"Transient"
"RandomVibration"
"ResponseSpectrum"
"Buckling"
"Modal"
"ShapeOptimization"
"TopologyOptimization"
"SubstructureGeneration"
PhysicsType: [string][mandatory]Specify the physics type. Supported values include:
"Structural"
"Thermal"
"Electromagnetics"
"Electric"
"ThermalElectromagnetics"
"Multiphysics"
SolverFileName: [string][optional]Specify the solver file name produced when using with --write_solver_file. If missing, the defaulted value is ds.dat. The SolverFileName should not include a path. The path to where the output file will be created comes from --ouptut_dir_path argument and the file is placed in a directory StandaloneExternalModelConsole_files.
SolverType: [string][mandatory]Specify the solver. The only supported value is "ANSYS"