Hi,
I deal with crack propagation in Ansys. For testing, I use a simple example (half elliptical surface crack in cylinder under longitudinal load):


The simulation has 40 substeps (the mesh of the model is therefore changed 40 times by extending the crack). Now I want to get the crack front coordinates of each substep. To get the mesh object (and to check the number of nodes and element) in each substep I use this code:
reader = Model.Analyses[0].GetResultsData()
for index in range(1, reader.ResultSetCount + 1):
reader.CurrentResultSet = index
substep_mesh = reader.CreateMeshData()
total_num_N = substep_mesh.NodeCount
total_num_E = substep_mesh.ElementCount
print index, total_num_N, total_num_E, front_num_N
The number of elements and nodes logically increases with each crack propagation. Now I want to get the NodeIDs in the Named Selection "NS_SECrack_Front", which is automatically created by Ansys and presumably contains different node numbers in each substep. I'll probably get the list by doing something like this:
front_set = substep_mesh.MeshRegionById(front_set_Id)
front_num_N = front_set.NodeCount
But how do I get the ID of the Named Selection? I have tried that, but it seems not work:
ns = {n.Name:n for n in model.NamedSelections.Children}
front_selection = ns['NS_SECrack_Front']
front_set_Id = front_selection.Id
It seems the ID of the Named Selection of the Model Data is not the same as in the Mesh Data of the substeps.