diff --git a/msgpi/ms/beam.py b/msgpi/ms/beam.py index 45225a4..06b327d 100644 --- a/msgpi/ms/beam.py +++ b/msgpi/ms/beam.py @@ -1,68 +1,81 @@ +import typing import numpy as np -import msgpi.sg as sgi +import msgpi.sg as msg import msgpi.io.utils as ioutil import msgpi.utils as utils import pprint -class BeamSegment(object): - """Class for a beam segment. +class GEBTBeamMember(): + """Class for a GEBT beam memebr. """ def __init__(self): + self.member_id = None + #: list of ints: Point labels. #: `[beginning point, ending point]` self.points = [] - #: list of lists of floats: Coordinates of beginning and ending points. - #: `[[x1, x2, x3], [x1, x2, x3]]` - self.coords = [] + #: list of ints: Cross-section labels. #: `[beginning, ending]` self.css = [] - self.cs_template = [] - - #: float: Rotation around a1. - self.rotate_a1 = 0.0 - #: float: Twist. - self.twist = 0.0 - # self.dihedral = 0. - # self.sweep = 0. - #: int: Local frame id. - self.local_frame_id = 0 #: int: Frame id - self.frame_id = 0 + self.frame_id: int = 0 #: int: Curvature id - self.curv_id = 0 + self.curv_id: int = 0 #: int: Number of division of the segment. - self.num_divisions = 1 + self.num_divisions: int = 1 + + + def __str__(self): + s = f'{self.member_id:4d}' + s += f'{self.points[0]:4d}{self.points[1]:4d}' + s += f'{self.css[0]:4d}{self.css[1]:4d}' + s += f'{self.frame_id:4d}{self.num_divisions:4d}{self.curv_id:4d}' + return s - #: dict: Parameter distributions - #: `{name: [beginning value, ending value], ...}` - self.cs_parameters = {} def summary(self): - print(' points:', self.points) - print(' coords:', self.coords) - print(' cs names:', self.css) - print(' cs templates:', self.cs_template) - print(' cs parameters:', self.cs_parameters) + print('member:', self.member_id) + print('points:', self.points) + print('sectional properties:', self.css) + print('frame:', self.frame_id) + print('divisions:', self.num_divisions) + print('initial curvature:', self.curv_id) - def calcLengthSq(self): - """Calculate the square of the segment length. - Returns - ------- - float - Squred length of the segment. - """ - return ((np.array(self.coords[0]) - np.array(self.coords[1]))**2).sum() + def writeGEBTInput(self, file): + file.write(self.__str__()) + file.write('\n') +class GEBTCondition(): + def __init__(self): + self.object_id = None + self.dofs = [0, 0, 0, 0, 0, 0] + self.values = [0., 0., 0., 0., 0., 0.] + self.time_funcs = [0, 0, 0, 0, 0, 0] + self.followers = [0, 0, 0, 0, 0, 0] + + def summary(self): + print('member:', self.object_id) + print('dofs:', self.dofs) + print('values:', self.values) + print('time functions:', self.time_funcs) + print('follower loads:', self.followers) + def writeGEBTInput(self, file): + file.write(f'{self.object_id}\n') + ioutil.writeFormatIntegers(file, self.dofs, '16d') + ioutil.writeFormatFloats(file, self.values, '16.6E') + ioutil.writeFormatIntegers(file, self.time_funcs, '16d') + ioutil.writeFormatIntegers(file, self.followers, '16d') + file.write('\n') @@ -161,7 +174,7 @@ def printAll(self, analysis): -class Beam(object): +class GEBTBeam(object): """Class for a slender beam-like structure. This class is mainly for the GEBT code. @@ -199,30 +212,30 @@ def __init__(self): #: `{ptid: [x1, x2, x3], ...}` self.points = {} - #: dict of {int, msgpi.ms.beam.BeamSegment}: Beam segments - #: `{bsid: BeamSegment object, ...}` - self.segments = {} + #: dict of {int, msgpi.ms.beam.GEBTBeamMember}: Beam members + #: `{bsid: GEBTBeamMember object, ...}` + self.members: typing.Dict[int, GEBTBeamMember] = {} # self.divisions = [] # Divisions of members #: list: Point conditions (B.C. and loads). - self.pconditions = [] + self.pconditions: typing.List[GEBTCondition] = [] #: list: Member conditions (B.C. and loads). - self.mconditions = [] + self.mconditions: typing.List[GEBTCondition] = [] #: dict of {int, msgpi.sg.BeamProperty}: Effective properties of cross-sections. #: `{sid: BeamProperty object, ...}` - self.sections = {} + self.sections: typing.Dict[int, msg.BeamProperty] = {} # {section name: template name, ...} - self.section_templates = {} + # self.section_templates = {} self.frames = {} #: Local frames self.distrloads = [] #: Distribution loads self.timefunctions = [] #: Time functions self.initcurvatures = [] #: Initial curvatures - self.functions = {} #: Functions - self.distributions = {} #: Distributions + # self.functions = {} #: Functions + # self.distributions = {} #: Distributions # Results # self.results = None #: Results of GEBT analysis @@ -252,18 +265,13 @@ def summary(self): for pid, coords in self.points.items(): print(f'{pid}: ( {coords[0]} , {coords[1]} , {coords[2]} )') - print('\nSegments') - for k, v in self.segments.items(): - print('segment', k) + print('\nMembers') + for k, v in self.members.items(): v.summary() - print('\nPoint B.C.') - - print('\nMember B.C.') - - print('\nSection templates') - for sn, st in self.section_templates.items(): - print(f'{sn}: {st}') + print('\nPoint conditions') + for pc in self.pconditions: + pc.summary() print('\nSectional properties') for sid, bp in self.sections.items(): @@ -275,13 +283,9 @@ def summary(self): pp.pprint(bp.mass) print('') - print('\nDistributions') - pp.pprint(self.distributions) - - print('\nFunctions') - # pp.pprint(self.functions) - for k, v in self.functions.items(): - print(k, ':', v) + print('\nMember conditions') + for mc in self.mconditions: + mc.summary() @@ -434,7 +438,7 @@ def writeGEBTIn(self, fn_gebt_in=''): fout.write('\n') line = [ - len(self.points), len(self.segments), len(self.pconditions), + len(self.points), len(self.members), len(self.pconditions), len(self.sections), len(self.frames), len(self.mconditions), len(self.distrloads), len(self.timefunctions), len(self.initcurvatures) ] @@ -449,52 +453,46 @@ def writeGEBTIn(self, fn_gebt_in=''): # Write the block of members # for i, member in enumerate(members): - for bsid, bs in self.segments.items(): - line = [ - bsid, bs.points[0], bs.points[1], bs.css[0], bs.css[1], - bs.frame_id, bs.num_divisions, bs.curv_id - ] - ioutil.writeFormatIntegers(fout, line, '4d') + for bmid in range(1, len(self.members)+1): + bm = self.members[bmid] + bm.writeGEBTInput(fout) + # line = [ + # bmid, bm.points[0], bm.points[1], bm.css[0], bm.css[1], + # bm.frame_id, bm.num_divisions, bm.curv_id + # ] + # ioutil.writeFormatIntegers(fout, line, '4d') fout.write('\n') # Write the block of point conditions - for condition in self.pconditions: - fout.write('{0:4d}\n'.format(condition['point'])) - ioutil.writeFormatIntegers(fout, condition['components'], '16d') - ioutil.writeFormatFloats(fout, condition['values']) - ioutil.writeFormatIntegers( - fout, np.zeros(6, dtype=np.int8), '16d') - ioutil.writeFormatIntegers( - fout, np.zeros(6, dtype=np.int8), '16d') + for pc in self.pconditions: + pc.writeGEBTInput(fout) + # fout.write('{0:4d}\n'.format(condition['point'])) + # ioutil.writeFormatIntegers(fout, condition['components'], '16d') + # ioutil.writeFormatFloats(fout, condition['values']) + # ioutil.writeFormatIntegers( + # fout, np.zeros(6, dtype=np.int8), '16d') + # ioutil.writeFormatIntegers( + # fout, np.zeros(6, dtype=np.int8), '16d') fout.write('\n') # Write the block of cross sectional properties - # for i, member in enumerate(members): - for sid, ms in self.sections.items(): + fmt = '20.10E' + for sid in range(1, len(self.sections)+1): + bp = self.sections[sid] fout.write('{0:4d}\n'.format(sid)) - # tcm = st['tcm'] - # for row in tcm: - # utl.writeFormatFloats(fout, row) - # if len(ms.eff_props[1]['compliance']['refined']) > 0: - if not ms.compliance_refined is None: - # for row in ms.eff_props[1]['compliance']['refined']: - for row in ms.compliance_refined: - ioutil.writeFormatFloats(fout, row) + if len(bp.cmpl_t) > 0: + for row in bp.cmpl_t: + ioutil.writeFormatFloats(fout, row, fmt=fmt) else: - # for i, row in enumerate(ms.eff_props[1]['compliance']['classical']): - for i, row in enumerate(ms.compliance): - ioutil.writeFormatFloats(fout, (row[0], 0, 0, row[1], row[2], row[3])) + for i, row in enumerate(bp.cmpl): + ioutil.writeFormatFloats(fout, (row[0], 0, 0, row[1], row[2], row[3]), fmt=fmt) if i == 0: - ioutil.writeFormatFloats(fout, np.zeros(6)) - ioutil.writeFormatFloats(fout, np.zeros(6)) + ioutil.writeFormatFloats(fout, np.zeros(6), fmt=fmt) + ioutil.writeFormatFloats(fout, np.zeros(6), fmt=fmt) fout.write('\n') if self.analysis_type != 0: - # mass = st['mass'] - # for row in mass: - # utl.writeFormatFloats(fout, row) - # for row in ms.eff_props[1]['mass']['origin']: - for row in ms.mass_origin: - ioutil.writeFormatFloats(fout, row) + for row in bp.mass: + ioutil.writeFormatFloats(fout, row, fmt=fmt) fout.write('\n') # Write the block of self.frames diff --git a/msgpi/ms/blade.py b/msgpi/ms/blade.py index abf340c..891a463 100644 --- a/msgpi/ms/blade.py +++ b/msgpi/ms/blade.py @@ -1,6 +1,7 @@ import pprint import xml.etree.ElementTree as et import msgpi.cross_section as mcs +import msgpi.ms.beam as msbeam import msgpi.utils as utils @@ -101,22 +102,28 @@ def __init__(self): self.section_templates = {} + # Model + self.model = None + self.solver = None + self.analysis = None + + def summary(self): pp = pprint.PrettyPrinter(indent=4, compact=False) - print('\nAnalysis') - print('analysis type:', self.analysis_type) - print('max iteration:', self.max_iteration) - print('number of steps:', self.num_steps) - if self.analysis_type != 0: - print('angular velocity:', self.angular_velocity) - print('time function:', self.av_tf) - print('linear velocity:', self.linear_velocity) - print('time function:', self.lv_tf) - if self.analysis_type == 3: - print('number of eigen results:', self.num_eigens) + # print('\nAnalysis') + # print('analysis type:', self.analysis_type) + # print('max iteration:', self.max_iteration) + # print('number of steps:', self.num_steps) + # if self.analysis_type != 0: + # print('angular velocity:', self.angular_velocity) + # print('time function:', self.av_tf) + # print('linear velocity:', self.linear_velocity) + # print('time function:', self.lv_tf) + # if self.analysis_type == 3: + # print('number of eigen results:', self.num_eigens) print('\nPoints') # pp.pprint(self.points) @@ -227,6 +234,14 @@ def genCrossSectionDesign(self, segi, csj): return cs_name, cs_params + def createGEBTBeamModel(self): + gbm = msbeam.GEBTBeam() + + # Create members from segments + + self.model = gbm + return + @@ -234,7 +249,7 @@ def genCrossSectionDesign(self, segi, csj): -def readBladeInput(fn_blade): +def readBladeInput(fn_blade: str) -> Blade: blade = Blade() @@ -371,6 +386,12 @@ def readBladeInput(fn_blade): blade.segments[bslabel] = bs + # Read modeling inputs + xe_model = xr_beam.find('model') + + + + return blade diff --git a/msgpi/ms/iogebt.py b/msgpi/ms/iogebt.py index 7a2965b..7b2dfbf 100644 --- a/msgpi/ms/iogebt.py +++ b/msgpi/ms/iogebt.py @@ -1,6 +1,7 @@ +import typing import numpy as np import msgpi.ms.beam as msb -import msgpi.sg as sgi +import msgpi.sg as msg import msgpi.io.utils as utl @@ -12,7 +13,7 @@ # # ==================================================================== -def readGEBTIn(fn_gebt_in): +def readGEBTIn(fn_gebt_in: str) -> msb.GEBTBeam: """Read GEBT input. Parameters @@ -25,7 +26,7 @@ def readGEBTIn(fn_gebt_in): msgpi.ms.beam.Beam Beam object constructed from the data. """ - beam = msb.Beam() + beam = msb.GEBTBeam() # results = {} lines = [] @@ -55,32 +56,103 @@ def readGEBTIn(fn_gebt_in): line2 = list(map(int, lines[li].split())) nkp = line2[0] nmemb = line2[1] - # results['ncondpt'] = line2[2] - # results['nmate'] = line2[3] - # results['nframe'] = line2[4] - # results['ncondmb'] = line2[5] - # results['ndistr'] = line2[6] - # results['ntimefun'] = line2[7] - # results['ncurv'] = line2[8] + ncond_pt = line2[2] + nmate = line2[3] + nframe = line2[4] + ncond_mb = line2[5] + ndistr = line2[6] + ntimefun = line2[7] + ncurv = line2[8] li += 1 # Read keypoints - for i in range(li, li + nkp): - p = lines[i].strip().split()[:4] + for i in range(nkp): + p = lines[li].strip().split()[:4] beam.points[int(p[0])] = list(map(float, p[1:])) - li += nkp + li += 1 + # Read members - for i in range(li, li + nmemb): - data = list(map(int, lines[i].strip().split()[:8])) - bs = msb.BeamSegment() - bs.points = data[1:3] - bs.css = data[3:5] - bs.frame_id = data[5] - bs.num_divisions = data[6] - bs.curv_id = data[7] - beam.segments[data[0]] = bs - li += nmemb + for i in range(nmemb): + data = list(map(int, lines[li].strip().split()[:8])) + bm = msb.GEBTBeamMember() + bm.member_id = data[0] + bm.points = data[1:3] + bm.css = data[3:5] + bm.frame_id = data[5] + bm.num_divisions = data[6] + bm.curv_id = data[7] + beam.members[data[0]] = bm + li += 1 + + + # Read point conditions + for i in range(ncond_pt): + pc = msb.GEBTCondition() + pc.object_id = int(lines[li]) + li += 1 + pc.dofs = list(map(int, lines[li].split())) + li += 1 + pc.values = list(map(float, lines[li].split())) + li += 1 + pc.time_funcs = list(map(int, lines[li].split())) + li += 1 + pc.followers = list(map(int, lines[li].split())) + beam.pconditions.append(pc) + li += 1 + + # Read sectional properties + for i in range(nmate): + ms = msg.BeamProperty() + ms_id = int(lines[li]) + li += 1 + # Read compliance matrix + for j in range(6): + ms.cmpl_t.append( + list(map(float, lines[li].split())) + ) + li += 1 + # Read mass matrix + if beam.analysis_type != 0: + for j in range(6): + ms.mass.append( + list(map(float, line[li].split())) + ) + li += 1 + + beam.sections[ms_id] = ms + + # Read frames + for i in range(nframe): + pass + + # Read member conditions + for i in range(ncond_mb): + mc = msb.GEBTCondition() + mc.object_id = int(lines[li]) + li += 1 + mc.dofs = list(map(int, lines[li].split())) + li += 1 + mc.values = list(map(float, lines[li].split())) + li += 1 + mc.time_funcs = list(map(int, lines[li].split())) + li += 1 + mc.followers = list(map(int, lines[li].split())) + beam.mconditions.append(mc) + li += 1 + + # Read distributed load functions + for i in range(ndistr): + pass + + # Read initial curvatures and twist + for i in range(ncurv): + pass + + # Read time functions + if (ntimefun > 0) or (beam.analysis_type == 2): + pass + return beam diff --git a/msgpi/ms/prebeam.py b/msgpi/ms/prebeam.py index a4a39ef..8a1fec9 100644 --- a/msgpi/ms/prebeam.py +++ b/msgpi/ms/prebeam.py @@ -486,141 +486,141 @@ def preBeam(fn_beam, mode=1, sections=[]): -def preBeam2(fn_beam): +# def preBeam2(fn_beam): - beam = msb.Beam() - - with open(fn_beam, 'r') as fo: - tree = et.parse(fo) - xr_beam = tree.getroot() - - # Read design - xe_design = xr_beam.find('design') - - - - - # Read points - # pn2l = {} # point name to label dictionary - # plabel = 0 - xe_points = xe_design.find('points') - for xe_point in xe_points.findall('point'): - # plabel += 1 - pname = xe_point.get('name') - pcoord = list(map(float, xe_point.text.strip().split())) - # pn2l[pname] = plabel - # beam.points[plabel] = pcoord - beam.points[pname] = pcoord - - - - - # Read functions - xe_functions = xr_beam.find('functions') - for xe_function in xe_functions.findall('function'): - fname = xe_function.get('name') - ftype = xe_function.get('type', default='polynomial') - fpointsx = [] - fpointsy = [] - - xe_coeffs = xe_function.find('coefficients') - if xe_coeffs is not None: - # print(xe_coeffs.text) - fcoeffs = list(map(float, xe_coeffs.text.strip().split())) - xe_points = xe_function.find('points') - if xe_points is not None: - for xe_point in xe_points.findall('point'): - x, y = list(map(float, xe_point.text.strip().split())) - fpointsx.append(x) - fpointsy.append(y) - - beam.functions[fname] = utils.PolynomialFunction( - coefficients=fcoeffs, x=fpointsx, y=fpointsy - ) - - - - - # Read distributions - xe_distributions = xe_design.find('distributions') - for xe_distribution in xe_distributions.findall('distribution'): - # distr_type = xe_distribution.get('type', default='function') - param_name = xe_distribution.find('parameter').text - - func_name = xe_distribution.find('function').text - value_type = 'float' - xe_type = xe_distribution.find('type') - if xe_type is not None: - value_type = xe_distribution.find('type').text - m = 1.0 - if xe_distribution.find('multiplier'): - m = float(xe_distribution.find('multiplier').text) - beam.distributions[param_name] = [func_name, m, value_type] - - - - - # Read segments - xe_segments = xe_design.find('segments') - bslabel = 0 - for xe_sgm in xe_segments.findall('segment'): - bslabel += 1 - bs = msb.BeamSegment() - - # Beginning station - xe_start = xe_sgm.find('begin') - pn = xe_start.find('location').text.strip() - # bs.points.append(pn2l[pn]) - bs.points.append(pn) - # pc = beam.findPtCoordByName(pn2l[pn]) - pc = beam.findPtCoordByName(pn) - bs.coords.append(pc) - xe_cs = xe_start.find('cross_section') - fn_cs_template = xe_cs.get('template') - cs_name = xe_cs.text.strip() - # fn_cs = cs_name + '.xml' - bs.cs_template.append(fn_cs_template) - bs.css.append(cs_name) - - if not cs_name in beam.section_templates.keys(): - beam.section_templates[cs_name] = fn_cs_template - - # Ending station - xe_stop = xe_sgm.find('end') - pn = xe_stop.find('location').text.strip() - # bs.points.append(pn2l[pn]) - bs.points.append(pn) - # pc = beam.findPtCoordByName(pn2l[pn]) - pc = beam.findPtCoordByName(pn) - bs.coords.append(pc) - xe_cs = xe_stop.find('cross_section') - fn_cs_template = xe_cs.get('template') - cs_name = xe_cs.text.strip() - # fn_cs = cs_name + '.xml' - bs.cs_template.append(fn_cs_template) - bs.css.append(cs_name) - - if not cs_name in beam.section_templates.keys(): - beam.section_templates[cs_name] = fn_cs_template - - - # Cross-section parameters - for xe_param in xe_sgm.findall('parameter'): - name = xe_param.find('name').text.strip() - values = [0, 0] - for xe_value in xe_param.findall('value'): - apply = xe_value.get('apply', default='all') - value = float(xe_value.text.strip()) - if apply == 'all': - values = [value, value] - elif apply == 'begin': - values[0] = value - elif apply == 'end': - values[1] = value - bs.cs_parameters[name] = values - - - beam.segments[bslabel] = bs - - - return beam +# beam = msb.Beam() + +# with open(fn_beam, 'r') as fo: +# tree = et.parse(fo) +# xr_beam = tree.getroot() + +# # Read design +# xe_design = xr_beam.find('design') + + + + +# # Read points +# # pn2l = {} # point name to label dictionary +# # plabel = 0 +# xe_points = xe_design.find('points') +# for xe_point in xe_points.findall('point'): +# # plabel += 1 +# pname = xe_point.get('name') +# pcoord = list(map(float, xe_point.text.strip().split())) +# # pn2l[pname] = plabel +# # beam.points[plabel] = pcoord +# beam.points[pname] = pcoord + + + + +# # Read functions +# xe_functions = xr_beam.find('functions') +# for xe_function in xe_functions.findall('function'): +# fname = xe_function.get('name') +# ftype = xe_function.get('type', default='polynomial') +# fpointsx = [] +# fpointsy = [] + +# xe_coeffs = xe_function.find('coefficients') +# if xe_coeffs is not None: +# # print(xe_coeffs.text) +# fcoeffs = list(map(float, xe_coeffs.text.strip().split())) +# xe_points = xe_function.find('points') +# if xe_points is not None: +# for xe_point in xe_points.findall('point'): +# x, y = list(map(float, xe_point.text.strip().split())) +# fpointsx.append(x) +# fpointsy.append(y) + +# beam.functions[fname] = utils.PolynomialFunction( +# coefficients=fcoeffs, x=fpointsx, y=fpointsy +# ) + + + + +# # Read distributions +# xe_distributions = xe_design.find('distributions') +# for xe_distribution in xe_distributions.findall('distribution'): +# # distr_type = xe_distribution.get('type', default='function') +# param_name = xe_distribution.find('parameter').text + +# func_name = xe_distribution.find('function').text +# value_type = 'float' +# xe_type = xe_distribution.find('type') +# if xe_type is not None: +# value_type = xe_distribution.find('type').text +# m = 1.0 +# if xe_distribution.find('multiplier'): +# m = float(xe_distribution.find('multiplier').text) +# beam.distributions[param_name] = [func_name, m, value_type] + + + + +# # Read segments +# xe_segments = xe_design.find('segments') +# bslabel = 0 +# for xe_sgm in xe_segments.findall('segment'): +# bslabel += 1 +# bs = msb.BeamSegment() + +# # Beginning station +# xe_start = xe_sgm.find('begin') +# pn = xe_start.find('location').text.strip() +# # bs.points.append(pn2l[pn]) +# bs.points.append(pn) +# # pc = beam.findPtCoordByName(pn2l[pn]) +# pc = beam.findPtCoordByName(pn) +# bs.coords.append(pc) +# xe_cs = xe_start.find('cross_section') +# fn_cs_template = xe_cs.get('template') +# cs_name = xe_cs.text.strip() +# # fn_cs = cs_name + '.xml' +# bs.cs_template.append(fn_cs_template) +# bs.css.append(cs_name) + +# if not cs_name in beam.section_templates.keys(): +# beam.section_templates[cs_name] = fn_cs_template + +# # Ending station +# xe_stop = xe_sgm.find('end') +# pn = xe_stop.find('location').text.strip() +# # bs.points.append(pn2l[pn]) +# bs.points.append(pn) +# # pc = beam.findPtCoordByName(pn2l[pn]) +# pc = beam.findPtCoordByName(pn) +# bs.coords.append(pc) +# xe_cs = xe_stop.find('cross_section') +# fn_cs_template = xe_cs.get('template') +# cs_name = xe_cs.text.strip() +# # fn_cs = cs_name + '.xml' +# bs.cs_template.append(fn_cs_template) +# bs.css.append(cs_name) + +# if not cs_name in beam.section_templates.keys(): +# beam.section_templates[cs_name] = fn_cs_template + + +# # Cross-section parameters +# for xe_param in xe_sgm.findall('parameter'): +# name = xe_param.find('name').text.strip() +# values = [0, 0] +# for xe_value in xe_param.findall('value'): +# apply = xe_value.get('apply', default='all') +# value = float(xe_value.text.strip()) +# if apply == 'all': +# values = [value, value] +# elif apply == 'begin': +# values[0] = value +# elif apply == 'end': +# values[1] = value +# bs.cs_parameters[name] = values + + +# beam.segments[bslabel] = bs + + +# return beam diff --git a/tests/test_prebeam/test_prebeam_1.py b/tests/test_prebeam/test_prebeam_1.py index f797ff1..aabb682 100644 --- a/tests/test_prebeam/test_prebeam_1.py +++ b/tests/test_prebeam/test_prebeam_1.py @@ -1,5 +1,5 @@ -import msgpi.ms.prebeam as prebeam +import msgpi.ms.blade as msblade -beam = prebeam.preBeam2('uh60a_blade.xml') +blade = msblade.readBladeInput('uh60a_blade.xml') -beam.summary() +blade.summary() diff --git a/tests/test_prebeam/uh60a_blade.xml b/tests/test_prebeam/uh60a_blade.xml index 9efcc75..3c1143b 100644 --- a/tests/test_prebeam/uh60a_blade.xml +++ b/tests/test_prebeam/uh60a_blade.xml @@ -1,6 +1,26 @@ - - - + + + + gebt + 0 + 100 + 1 + + p1 + 1 2 3 4 5 6 + 0 0 0 0 0 0 + 0 0 0 0 0 0 + 0 0 0 0 0 0 + + + p3 + 7 8 9 10 11 12 + 0 0 0 0 -1000 0 + 0 0 0 0 0 0 + 0 0 0 0 0 0 + + 0.1 + @@ -199,4 +219,4 @@ - + diff --git a/tests/test_read_gebt_inout/contilever1_rewrite.dat b/tests/test_read_gebt_inout/contilever1_rewrite.dat new file mode 100644 index 0000000..42254b0 --- /dev/null +++ b/tests/test_read_gebt_inout/contilever1_rewrite.dat @@ -0,0 +1,30 @@ + 0 100 1 + + 2 1 2 1 0 0 0 0 0 + + 1 0.000000E+00 0.000000E+00 0.000000E+00 + 2 1.000000E+00 0.000000E+00 0.000000E+00 + + 1 1 2 1 1 0 11 0 + +1 + 1 2 3 4 5 6 + 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 + 0 0 0 0 0 0 + 0 0 0 0 0 0 + +2 + 7 8 9 10 11 12 + 0.000000E+00 0.000000E+00 5.000000E+05 0.000000E+00 0.000000E+00 0.000000E+00 + 0 0 1 0 0 0 + 0 0 1 0 0 0 + + + 1 + 1.9230769231E-08 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 2.0689655172E-05 0.0000000000E+00 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 5.7692307692E-06 0.0000000000E+00 + 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 0.0000000000E+00 2.3076923077E-05 + diff --git a/tests/test_read_gebt_inout/test_read_gebt_in.py b/tests/test_read_gebt_inout/test_read_gebt_in.py index 80612d7..0280845 100644 --- a/tests/test_read_gebt_inout/test_read_gebt_in.py +++ b/tests/test_read_gebt_inout/test_read_gebt_in.py @@ -4,3 +4,5 @@ beam.summary() +beam.writeGEBTIn('contilever1_rewrite.dat') +