# -*- coding: utf-8 -*-## This file is subject to the terms and conditions defined in# file 'LICENSE.txt', which is part of this source code package.#"""Ansys tools"""importMuscat.MeshContainers.ElementsDescriptionasED# for i in range(35): print(i, dpf.element_types.descriptor(i ).name)AnsysElementDescriptorToMuscatElementType={}AnsysElementDescriptorToMuscatElementType[0]=ED.Tetrahedron_10AnsysElementDescriptorToMuscatElementType[1]=ED.Hexahedron_20AnsysElementDescriptorToMuscatElementType[2]=ED.Wedge_15AnsysElementDescriptorToMuscatElementType[3]=ED.Pyramid_13AnsysElementDescriptorToMuscatElementType[4]=ED.Triangle_6AnsysElementDescriptorToMuscatElementType[5]=ED.Triangle_6AnsysElementDescriptorToMuscatElementType[6]=ED.Quadrangle_8AnsysElementDescriptorToMuscatElementType[7]=ED.Quadrangle_8AnsysElementDescriptorToMuscatElementType[8]=ED.Bar_3AnsysElementDescriptorToMuscatElementType[9]=ED.Point_1AnsysElementDescriptorToMuscatElementType[10]=ED.Tetrahedron_4AnsysElementDescriptorToMuscatElementType[11]=ED.Hexahedron_8AnsysElementDescriptorToMuscatElementType[12]=ED.Wedge_6AnsysElementDescriptorToMuscatElementType[13]=ED.Pyramid_5AnsysElementDescriptorToMuscatElementType[14]=ED.Triangle_3AnsysElementDescriptorToMuscatElementType[15]=ED.Triangle_3AnsysElementDescriptorToMuscatElementType[16]=ED.Quadrangle_4AnsysElementDescriptorToMuscatElementType[17]=ED.Quadrangle_4AnsysElementDescriptorToMuscatElementType[18]=ED.Bar_2AnsysElementDescriptorToMuscatElementType[28]=ED.Bar_2AnsysElementDescriptorToMuscatElementType[29]=ED.Bar_3AnsysElementNameToMuscatElementType={}AnsysElementNameToMuscatElementType['point1']=ED.Point_1AnsysElementNameToMuscatElementType['bar2']=ED.Bar_2AnsysElementNameToMuscatElementType['bar3']=ED.Bar_3AnsysElementNameToMuscatElementType['quad4']=ED.Quadrangle_4AnsysElementNameToMuscatElementType['quad8']=ED.Quadrangle_8AnsysElementNameToMuscatElementType['quad9']=ED.Quadrangle_9AnsysElementNameToMuscatElementType['tri3']=ED.Triangle_3AnsysElementNameToMuscatElementType['tri6']=ED.Triangle_6AnsysElementNameToMuscatElementType['tet4']=ED.Tetrahedron_4AnsysElementNameToMuscatElementType['pyr5']=ED.Pyramid_5AnsysElementNameToMuscatElementType['pyr13']=ED.Pyramid_13AnsysElementNameToMuscatElementType['pyr14']=ED.Pyramid_14AnsysElementNameToMuscatElementType['wed6']=ED.Wedge_6AnsysElementNameToMuscatElementType['wed18']=ED.Wedge_18AnsysElementNameToMuscatElementType['wed15']=ED.Wedge_15AnsysElementNameToMuscatElementType['hex8']=ED.Hexahedron_8AnsysElementNameToMuscatElementType['tet10']=ED.Tetrahedron_10AnsysElementNameToMuscatElementType['hex20']=ED.Hexahedron_20AnsysElementNameToMuscatElementType['hex27']=ED.Hexahedron_27# conversion from Muscat Element to Ansys Finite ElementMuscatToAnsysFormulation={}solid3D={}solid3D[ED.Tetrahedron_4]="185"# SOLID185solid3D[ED.Hexahedron_8]="185"# SOLID185solid3D[ED.Hexahedron_20]="186"# SOLID186solid3D[ED.Tetrahedron_10]="187"# SOLID187MuscatToAnsysFormulation["SOLID3D"]=solid3Dsolid2D={}solid2D[ED.Quadrangle_4]="182"# PLANE182solid2D[ED.Triangle_3]="182"# PLANE182solid2D[ED.Quadrangle_8]="183"# PLANE183solid2D[ED.Triangle_6]="183"# PLANE183MuscatToAnsysFormulation["SOLID2D"]=solid2D# The integration point data is treated as copy to nodes per elementnbIntegrationsPoints={}fork,vinED.numberOfNodes.items():nbIntegrationsPoints[k]=vnbIntegrationsPoints["Hex20"]=8nbIntegrationsPoints["Tet10"]=4nbIntegrationsPoints["Tet4"]=4nbIntegrationsPoints["Tri6"]=3nbIntegrationsPoints["Hex8"]=8nbIntegrationsPoints["c3d20"]=8nbIntegrationsPoints["c3d10"]=4nbIntegrationsPoints["c2d6"]=3nbIntegrationsPoints["c3d8"]=8ElementType_from_MAPDL_to_DPF={}# 2DElementType_from_MAPDL_to_DPF["154"]="quad8"ElementType_from_MAPDL_to_DPF["281"]="tri6"# 3DElementType_from_MAPDL_to_DPF["281"]="tri6"ElementType_from_MAPDL_to_DPF["187"]="tet10"ElementType_from_MAPDL_to_DPF["186"]="hex20"# eto is the total strain while EPEL is the elastic.# Ansys does not gives total strain. This must bo fixed in next versionZsetToAnsys_varialble={}ZsetToAnsys_varialble["sig11"]="SX"ZsetToAnsys_varialble["sig22"]="SY"ZsetToAnsys_varialble["sig33"]="SZ"ZsetToAnsys_varialble["sig12"]="SXY"ZsetToAnsys_varialble["sig23"]="SYZ"ZsetToAnsys_varialble["sig31"]="SXZ"ZsetToAnsys_varialble["eel11"]="EPELX"ZsetToAnsys_varialble["eel22"]="EPELY"ZsetToAnsys_varialble["eel33"]="EPELZ"ZsetToAnsys_varialble["eel12"]="EPELXY"ZsetToAnsys_varialble["eel23"]="EPELYZ"ZsetToAnsys_varialble["eel31"]="EPELXZ"ZsetToAnsys_varialble["RU1"]="RFX"ZsetToAnsys_varialble["RU2"]="RFY"ZsetToAnsys_varialble["RU3"]="RFZ"ZsetToAnsys_varialble["BFE"]="temperature"ZsetToAnsys_varialble["eto11"]="EPPLX"ZsetToAnsys_varialble["eto22"]="EPPLY"ZsetToAnsys_varialble["eto33"]="EPPLZ"ZsetToAnsys_varialble["eto12"]="EPPLXY"ZsetToAnsys_varialble["eto23"]="EPPLYZ"ZsetToAnsys_varialble["eto31"]="EPPLXZ"AnsysToZset_Variable={}forkey,valueinZsetToAnsys_varialble.items():AnsysToZset_Variable[value]=keyAnsysDatToMuscatPermutation={}AnsysDatToMuscatPermutation[ED.Tetrahedron_10]=[2,0,1,3,6,4,5,9,7,8]