How can we check if analysis is linear or nonlinear?
Pernelle MaroneHitz
Member, Moderator, Employee Posts: 871
✭✭✭✭
Answers

The following function checks:
whether a plastic material law exists in the model (other forms of material nonlinearity is not included)
whether nonlinear contacts are defined
whether large deflections are turned on
def LinearNonlinearAnalysis(analysis): ''' Check whether analyis is linear or nonlinear and identify source of nonlinearity ''' listExportNonLinearAnalysis = [] # test whether model is static or dynamic analysis = GetAnalysis() analysisType = analysis.AnalysisType # test whether model is linear or nonlinear ## test material properties to check for plasticity import materials existsPlasticity = False matList = ExtAPI.DataModel.Project.Model.Materials.Children for mat in matList: dataMat = mat.GetEngineeringDataMaterial() dataList = materials.GetListMaterialProperties(dataMat) plasticityList = ["Isotropic Hardening", "Kinematic Hardening"] test = [ele for ele in dataList if (ele in plasticityList)] existsPlasticity = bool(test) ## test for nonlinear contacts connections = ExtAPI.DataModel.Project.Model.Connections nonLinearContactTypeList = [ ContactType.Frictional, ContactType.Frictionless, ContactType.Rough ] contactList = [] existsNonLinearContacts = False for contGroup in connections.Children: for cont in contGroup.Children: if cont.Suppressed is False: try: contactList.append(cont.ContactType) except: pass test = [ ele for ele in contactList if (ele in nonLinearContactTypeList) ] existsNonLinearContacts = bool(test) ## test for large deformations existsNlgeom = analysis.AnalysisSettings.LargeDeflection ## checking nonlinearity of model existsNonLinearity = False nonLinearityList = [ existsPlasticity, existsNonLinearContacts, existsNlgeom ] existsNonLinearity = True in nonLinearityList listExportNonLinearAnalysis.append([ str(analysisType), str(existsNonLinearity), str(existsPlasticity), str(existsNonLinearContacts), str(existsNlgeom) ]) return listExportNonLinearAnalysis
0