get_surface_mesh_payload_for_keyword#
- FileIO.get_surface_mesh_payload_for_keyword(part_id, keyword_instances_json, schema_entry_json)#
Gets the mesh data of the surfaces, node sets, and element sets that custom keyword instances reference.
Use this method to retrieve the mesh data that a custom translation function needs, such as the function that translates contact pairs. The method reads the names in the parameters and data of each keyword instance and resolves them against the simulation data of the part. If a name is not found in the part, the method also searches the other parts of the model. The returned JSON document has the following top level keys: - Surfaces: Maps each surface name to its surface_type and part_name. For a node surface, the entry also contains node_ids. For other surfaces, the entry contains faces, where each face has face_id, reverse, shape_flag, and node_ids. - Nsets: Maps each node set name to its part_name and node_ids. - Elsets: Maps each element set name to its part_name and the node ids of its elements.
- Parameters:
part_id (
int) – Id of the part used to resolve the names. The default part is the first part when you specify 0.keyword_instances_json (
str) – JSON array of keyword instances as a string. The structure is the same as the CONTACT PAIR entries in the custom translations of the simulation data.schema_entry_json (
str) – JSON object of the schema entry for the keyword as a string.
- Return type:
- Returns:
Notes
This is a beta API. The behavior and implementation may change in future.
Examples
>>> import json >>> file_io = prime.FileIO(model = model) >>> simdata = json.loads(file_io.get_abaqus_simulation_data(2)) >>> instances = json.dumps(simdata["CustomTranslations"]["CONTACT PAIR"]) >>> payload = json.loads(file_io.get_surface_mesh_payload_for_keyword(2, instances, schema_entry_json))