How can we set the contact type through scripting?
Pernelle Marone-Hitz
Member, Moderator, Employee Posts: 871
✭✭✭✭
Answers
-
The following function can be used:
def SetContactRegion(contactRegion,contactType,nu): ''' set the contact region :param contactType: string of type of contact :param nu: friction coefficient ''' try: if contactType=="BONDED": if contactRegion.ContactType != ContactType.Bonded: contactRegion.ContactType = ContactType.Bonded ExtAPI.Log.WriteMessage((str(contactRegion.Name) + " was set bonded.") elif contactType=="FRICTIONAL": if contactRegion.ContactType != ContactType.Frictional: contactRegion.ContactType = ContactType.Frictional contactRegion.FrictionCoefficient = float(nu) # adjust to touch by default for better convergence contactRegion.InterfaceTreatment= ContactInitialEffect.AdjustToTouch # adding Fkn = 0.1 to ease solving contactRegion.AutomaticNormalStiffness= False contactRegion.NormalStiffnessFactor = 0.1 ExtAPI.Log.WriteMessage((str(contactRegion.Name) + " was set frictional.") elif contactType=="SUPPRESSED": if contactRegion.Suppressed != True: contactRegion.Suppressed = True ExtAPI.Log.WriteMessage((str(contactRegion.Name) + " was set suppressed.") except: ExtAPI.Log.WriteMessage(("Error : Exception in SetContactRegion()")
0