MAPDL Helpers

Description

This library implements some helpers to write APDL command blocks or to execute ANSYS Mechanical APDL programs.

Location

Usage

import ansys

Functions

createNodeComponent(refIds,groupName,mesh,stream,fromGeoIds=True)

This function writes the APDL command block (CMBLOCK) for the creation of a node component related to the geometry entities identified by refIds into the stream stream. “refIds” refer to geometric IDs if “fromGeoIds” is true and the node IDs are retrieved from geometric entities using the associativity between the geometry and mesh. If “fromGeoIds” is false, then “refIds” refer directly to the node IDs to be written in the component.

createElementComponent(refIds,groupName,mesh,stream,fromGeoIds=True)

This function writes the APDL command block (CMBLOCK) for the creation of an element component related to the geometry entities identified by “refIds” into the stream “stream”. “refIds” refer to geometric IDs if “fromGeoIds” is true and the element IDs are retrieved from geometric entities using the associativity between the geometry and the mesh. If “fromGeoIds” is false, the “refIds” refer directly to the element IDs to be written in the component.

RunANSYS(api,args,[runDir[,exelocation]])

This function calls the ANSYS Mechanical APDL program with the command line initialized by args. The user can specify the folder from which he wants to execute the program with runDir. The location of the executable is also managed with exelocation.

The parameter api must be ExtAPI.

Example

import ansys
ansys.createNodeComponent([refId],"myGroup",mesh,stream)
ansys.RunANSYS(ExtAPI,"")

Release 18.2 - © ANSYS, Inc. All rights reserved.