Thanks for your reply. Ok, I've made some changes and I taken into account the suggestions you made. However, I get another warning which saying " Modify Section: all points increased to max value. Unable to achieve original section area". Then, I tried to use GUI to generate the same geometry but same warning popped out. Here is the code.
Code: Select all
import sys
from _Embedded import *
from TexGen.Core import *
from TexGen.Renderer import *
from TexGen.Export import *
from TexGen.Abaqus import *
from math import*
# subroutines of Pattern Generation
def patternVec(s): # 0 = warp (blue) , 1 = weft (red)
if s == 1:
return [
[0,0,0,0,0,1,0,0],
[0,0,1,0,0,0,0,0],
[0,0,0,0,0,0,0,1],
[0,0,0,0,1,0,0,0],
[0,1,0,0,0,0,0,0],
[0,0,0,0,0,0,1,0],
[0,0,0,1,0,0,0,0],
[1,0,0,0,0,0,0,0]]
print "The pattern name is Satin 8-harness (8x8)"
else:
return [
[1,1,1,0,0,0,1,1,1,1,1,1],
[1,1,0,1,0,0,1,1,1,1,1,1],
[1,0,1,0,1,0,1,1,1,1,1,1],
[0,1,0,1,0,1,1,1,1,1,1,1],
[0,0,1,0,1,1,1,1,1,1,1,1],
[0,0,0,1,1,1,1,1,1,1,1,1],
[0,0,0,0,0,0,0,0,0,1,1,1],
[0,0,0,0,0,0,0,0,1,0,1,1],
[0,0,0,0,0,0,0,1,0,1,0,1],
[0,0,0,0,0,0,1,0,1,0,1,0],
[0,0,0,0,0,0,1,1,0,1,0,0],
[0,0,0,0,0,0,1,1,1,0,0,0]]
print "The pattern name is Mata Berkait (12x12)"
#end of pattern generation subroutine
# Define some constants - USER CHANGE HERE ONLY
patternList=patternVec(1) # CHOOSE HERE 1 @ 2* ---> 1 : Satin , 2: MK
spacing = 5.13 ## (mm) -Constant
width = 4.44 ## (mm) -Constant
height = 0.52 ##(mm)
shearAngle = -1.4/180*pi
#Inputs for Material Properties
T = 2*height ## Fabric thickness
twistAngle = shearAngle
shearOffset = spacing*sin(shearAngle)
YMX = 51.92e+009
YMY = 21.97e+009
YMZ = 21.97e+009
SMXY = 8.856e+009
SMXZ = 8.856e+009
SMYZ = 6.250e+009
PRX = 0.2489
PRY = 0.2489
PRZ = 0.2143
MatYM = 2500
MatPR = 0.35
MatAlpha = 6.5e-006
#Inputs for Voxel Mesh
nXvoxel = 300
nYvoxel = 300
nZvoxel = 100
#Pattern Generation for 1st Pattern:
m=len(patternList)
n=len(patternList[0])
weave = CShearedTextileWeave2D(m, n, spacing, T, shearAngle, 1, 1) #Geometry generation class of 2DShearedweave
weave.SetGapSize(0) # Gap size between upper and lower yarns
for x in range(m):
for y in range(n):
if patternList[m-1-x][y] == 1:
weave.SwapPosition(x, y)
#Adjust the yarn heights and widths
weave.SetYarnWidths(width)
weave.SetYarnHeights(height)
#Assign the domain and get its limit
weave.AssignDefaultDomain(True) # True - sheared, False - No shear
#Domain = weave.GetDefaultDomain()
#Min = XYZ()
#Max = XYZ()
#Domain.GetBoxLimits(Min,Max)
#Set section properties
weave.SetMatrixYoungsModulus(2500, 'MPa')
weave.SetMatrixPoissonsRatio(0.35)
weave.SetMatrixAlpha(6.5e-006)
weave.SetYoungsModulusX(YMX, 'MPa')
weave.SetYoungsModulusY(YMY, 'MPa')
weave.SetYoungsModulusZ(YMZ, 'MPa')
weave.SetPoissonsRatioX(PRX)
weave.SetPoissonsRatioY(PRY)
weave.SetPoissonsRatioZ(PRZ)
weave.SetShearModulusXY(SMXY, 'MPa')
weave.SetShearModulusXZ(SMXZ, 'MPa')
weave.SetShearModulusYZ(SMYZ, 'MPa')
# Add the textile with the name "SingleLayFineCase"
AddTextile("SL1", weave)
SaveToXML(r"C:\Users\dyeyanie\Documents\MultiObjOptSimulation\MacroLay\PythonLay\SL1.tg3", "SL1", OUTPUT_STANDARD) ##
#Meshing domain - ABAQUS Sheared Voxel Mesh
#SaveVoxelMesh (CTextile &Textiletring OutputFilename, int XVoxNum, int YVoxNum, int #ZVoxNum, bool bOutputMatrix, bool bOutputYarns, int iBoundariesTied, int iElementType=0)
#Vox = CShearedVoxelMesh()
#Vox.SaveVoxelMesh(weave, r'C:\Users\dyeyanie\Documents\MultiObjOptSimulation\MacroLay\PythonLay\SL1.inp',nXvoxel,nYvoxel,nZvoxel,1,1,0,0)
Another thing is, I try to get the inp file automatically via the code. However, it doesn't generate anyway. Is it because the error from the above matter? I attached herewith the image corresponds to the error (warning) above.