-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathVolumeMeshExport.py
More file actions
35 lines (26 loc) · 950 Bytes
/
VolumeMeshExport.py
File metadata and controls
35 lines (26 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# VolumeMeshExport.py
# Python 3 version used runpy module to execute scripts from TexGen GUI which requires import of library
from TexGen.Core import *
# Specify weave parameters
nwarp=2 #Number of weft yarns in the unit cell
nweft=2 #Number of warp yarns in the unit cell
s=1 #Spacing between the yarns
t=0.1 #Thickness of the fabric (sum of two yarn heights)
ref=True #Refine model (True/False)
# Create 2D textile
weave = CTextileWeave2D( nweft, nwarp, s, t, ref )
# Set the weave pattern
weave.SwapPosition(0, 0)
weave.SwapPosition(1, 1)
# Assign a default domain
weave.AssignDefaultDomain()
#Add to the textile database
AddTextile(weave)
# Create CMesher object and set periodicity and seed size
mesher = CMesher(MATERIAL_CONTINUUM)
mesher.SetPeriodic(True)
mesher.SetSeed(0.1)
# Generate the mesh
mesher.CreateMesh(weave)
# Save the mesh to Abaqus
mesher.SaveVolumeMeshToABAQUS("VolumeMesh.inp", weave.GetName())