Skip to content

Commit

Permalink
0727
Browse files Browse the repository at this point in the history
  • Loading branch information
Su Tian committed Jul 27, 2021
1 parent 79a2f54 commit 31e8bf5
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 44 deletions.
54 changes: 54 additions & 0 deletions msgpi/layup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@


class Layer(object):
def __init__(self):
self.material = ''
self.thickness = 0
self.lamina = None
self.angle = 0
self.begin = 0
self.end = 0

def __str__(self):
return 'begin: {0}, end: {1}, material: {2}, thickness: {3}, angle: {4}'.format(
self.begin, self.end, self.material, self.thickness, self.angle
)

def readIXGENLine(self, line, cs, fmt=0, tb=''):
line = line.split()
if (fmt == 0):
self.material = ' '.join(line[5:-3])
self.thickness = line[-3]
self.angle = float(line[-2])
if (cs == 1):
self.begin = float(line[1])
self.end = float(line[2])
elif (cs == 2):
self.begin = float(line[3])
self.end = float(line[4])
elif (fmt == 1):
self.material = ' '.join(line[4:-1])
self.thickness = line[-1]
if (cs == 1):
if (tb == 'top'):
self.end = float(line[0])
elif (tb == 'bottom'):
self.end = float(line[1])
elif (cs == 2):
if (tb == 'top'):
self.end = float(line[2])
elif (tb == 'bottom'):
self.end = float(line[3])
elif (fmt == 2):
self.material = ' '.join(line[1:-2])
self.thickness = line[-2]
self.angle = float(line[-1])





class Layup(object):
def __init__(self, name=''):
self.name = name
self.layers = []
44 changes: 0 additions & 44 deletions msgpi/sg.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,49 +921,5 @@ def writeGmshMsh(self, fo, nid_begin=1, eid_begin=1, loc=[0, 0, 0], *args, **kwa
fo.write('$EndElements\n')
fo.write('\n')


# Write options
# fn_gmsh_msh_opt = fn + '.opt'
# with open(fn_gmsh_msh_opt, 'w') as fout:
# fout.write('General.Axes = ' + str(3) + ';\n')
# fout.write('General.Orthographic = ' + str(1) + ';\n')
# fout.write('General.RotationX = ' + str(270) + ';\n')
# fout.write('General.RotationY = ' + str(360) + ';\n')
# fout.write('General.RotationZ = ' + str(270) + ';\n')
# fout.write('General.ScaleX = ' + str(2) + ';\n')
# fout.write('General.ScaleY = ' + str(2) + ';\n')
# fout.write('General.ScaleZ = ' + str(2) + ';\n')
# fout.write('General.Trackball = ' + str(0) + ';\n')
# fout.write('Geometry.LineWidth = ' + str(1) + ';\n')
# fout.write('Mesh.ColorCarousel = ' + str(2) + ';\n')
# fout.write('Mesh.SurfaceFaces = ' + str(1) + ';\n')


return









class CrossSection(object):
"""A simple class for cross-sections
"""

def __init__(self, name):
self.name = name
self.template = ""

self.sg = None

self.params = {}

self.props = {}

def summary(self):
print(f'cross-section: {self.name}')

0 comments on commit 31e8bf5

Please sign in to comment.