def get_rdm(): rdm = fakeRdm("XXX") rdm.file = 'test' rdm.name = 'test' string="""<?xml version="1.0" ?> <data pyBar="http://open.btp.free.fr/?/pyBar" version="2.2"> <elem id="node"> <node d="0,0" id="N1" liaison="0"/> <node affaissement="0.02" d="3,0" id="N2" liaison="2"/> <node affaissement="0.02" d="@N2,5,0" id="N3" liaison="2"/> <node d="@N3,4,0" id="N4"/> </elem> <elem id="barre"> <barre d="N1,N2" id="B1"/> <barre d="N2,N3" id="B2"/> <barre d="N3,N4" id="B3"/> </elem> <elem id="geo"> <barre h="0.3" id="*" igz="8.3e-05" s="0.0053" v="0.1"/> <barre h="0.3" id="B2" igz="8e-05" s="0.0053" v="0.1"/> </elem> <elem id="material"> <barre id="*" mv="7800.0" young="200000000000.0"/> </elem> <elem id="char"> <case id="cas 1"> <barre id="*" pp="true"/> </case> <case id="cas 2"> <barre fp="2,0.0,-1000.0,0.0" id="B1"/> </case> <case id="cas 3"> <barre fp="4,0.0,-1000.0,0.0" id="B2"/> </case> <case id="cas 4"> <barre fp="1,0.0,-1000.0,0.0" id="B3"/> </case> </elem> <elem id="combinaison"> <combinaison d="1.0,0.0,0.0,0.0" id="combi1"/> </elem> <elem id="units"> <unit d="1000000.0" id="C"/> <unit d="1000000000.0" id="E"/> <unit d="1000.0" id="F"/> <unit d="1e-08" id="I"/> <unit d="1.0" id="M"/> <unit d="1.0" id="L"/> <unit d="0.0001" id="S"/> </elem> </data>""" rdm.fakeReadXMLFile(string) rdm.GetXMLElem() rdm._ExtractData() return rdm
<drawing axis="false" bar_name="true" node_name="true" scale="254.0" scale_pos="36.0,93.0,58,25" show_title="true" status="3,0" title="130.0,38.0,181,25,test-parabole.dat" x0="80.0" y0="158.0" /> </draw> </data>""" # Lecture des données soit à partir d'un fichier #xml = fakeReadXMLFile("/home/.../pyBar/fichier.dat") # soit à partir d'une chaine de caractère contenant du xml xml = fakeReadXMLString(string) rdm = fakeRdm(xml) rdm.struct.PrintErrorConsole() # les données géométrique se trouvent dans rdm.struct # print rdm.struct.Sections # récupération du cas à partir du numéro Char = rdm.GetCharByNumber(0) #Char = rdm.Combis['combi1'] #print Char.EndBarSol # sollicitation aux bouts des barres # Degré de liberté #print("DDL=", Char.ddlValue['N5']) #print("DDL=", Char.ddlValue['N6'])
<elem id="combinaison"> </elem> <elem id="prefs"> <unit d="1.0" id="C"/> <unit d="1.0" id="E"/> <unit d="1.0" id="F"/> <unit d="1.0" id="I"/> <unit d="1.0" id="M"/> <unit d="1.0" id="L"/> <unit d="1.0" id="S"/> <const g="9.81"/> <conv conv="1.0"/> </elem> </data>""" rdm = fakeRdm(string) m_rdm = classRdm.Moving_Structure(rdm.struct, ((2, 0),)) N = 10 # position convoi mini, maxi, env_inf, env_sup = m_rdm.get_moving_data(N, 5) print mini, maxi m_rdm.Char.ini(4) m_rdm.SolveOneCase(m_rdm.Char) print m_rdm.GetValue("B2", 0., m_rdm.Char, 5)[1] #print m_rdm.Char.charBarFp #print "len=", rdm.struct.Lengths #print "angles", rdm.struct.Angles
<conv conv="1.0" /> </elem> <draw id="prefs"> <drawing axis="false" bar_name="true" node_name="true" scale="254.0" scale_pos="36.0,93.0,58,25" show_title="true" status="3,0" title="130.0,38.0,181,25,test-parabole.dat" x0="80.0" y0="158.0" /> </draw> </data>""" # Lecture des données soit à partir d'un fichier #xml = fakeReadXMLFile("/home/.../pyBar/fichier.dat") # soit à partir d'une chaine de caractère contenant du xml xml = fakeReadXMLString(string) rdm = fakeRdm(xml) rdm.struct.PrintErrorConsole() # les données géométrique se trouvent dans rdm.struct # print rdm.struct.Sections # récupération du cas à partir du numéro Char = rdm.GetCharByNumber(0) #Char = rdm.Combis['combi1'] #print Char.EndBarSol # sollicitation aux bouts des barres # Degré de liberté #print("DDL=", Char.ddlValue['N5']) #print("DDL=", Char.ddlValue['N6'])
def __init__(self, myfile, w, h): xml = fakeReadXMLFile(myfile) rdm = fakeRdm(xml) rdm.struct.PrintErrorConsole() self.study = fakeStudy(rdm) self.drawing = fakeDrawing(w, h)
def __init__(self, string, w, h): xml = fakeReadXMLString(string) rdm = fakeRdm(xml) rdm.struct.PrintErrorConsole() self.study = fakeStudy(rdm) self.drawing = fakeDrawing(w, h)