Variables | |
string | mbsPrjPath = '../..' |
EXAMPLE bdys = pre.avatars() mats = pre.materials() mods = pre.models() sees = pre.see_tables() tacs = pre.tact_behavs() More... | |
int | iMbs = 0 |
list | ID_Sensor = [1] |
string | solver = 'Stored_Delassus_Loops ' |
EXAMPLE, 2D case Set the number of mbs files/system chipy.MBS2D_setNb(ml.getNbMbs()) # Retrieve the number of MBS Set the number of node on each MBS for i in range(ml.getNbMbs()): chipy.MBS2D_setNbNodes(i+1, ml.getNbNodes(i)) # Retrieve from the mbs data Set the number of contactor on the MBS, repeat on each MBS. More... | |
string | norm = 'Quad ' |
float | tol = 1.0e-4 |
float | relax = 1.0 |
int | gs_it1 = 300 |
int | gs_it2 = 200 |
int gs_it1 = 300 |
int gs_it2 = 200 |
list ID_Sensor = [1] |
int iMbs = 0 |
string mbsPrjPath = '../..' |
EXAMPLE bdys = pre.avatars() mats = pre.materials() mods = pre.models() sees = pre.see_tables() tacs = pre.tact_behavs()
EXAMPLE mat1 = pre.material(name='STEEL', materialType='RIGID', density=8000.) mats.addMaterial(mat1)
The dimensions of the model have to be consistent with the dimension of the MBS EXAMPLE 2D mod = pre.model(name='rigid', physics='MECAx', element='Rxx2D', dimension=2) mods.addModel(mod) EXAMPLE 3D mod = pre.model(name='rigid', physics='MECAx', element='Rxx3D', dimension=3) mods.addModel(mod) EXAMPLE part = pre.rigidDisk(r=0.1, center=[0,0,0], model=mod, material=mat1, color='BALLx') bdys.addAvatar(part) part = pre.rigidDisk(r=0.1, center=[0.5,0,0], model=mod, material=mat1, color='BALLx') bdys.addAvatar(part) EXAMPLE Define contact law(s) clb_fric = pre.tact_behav(name='iqsc0',type='IQS_CLB',fric=fric) tacs += clb_fric
First contact laws between the LMGC90 contactors D2J = pre.see_table(CorpsCandidat = 'RBDY2', candidat = 'DISKx', colorCandidat = 'BALLx', CorpsAntagoniste= 'RBDY2', antagoniste= 'DISKx', colorAntagoniste= 'BALLx', behav= clb_fric, alert= 0.002) sees += D2J
Then contact laws between LMGC90 and MBS contactors P2J = pre.see_table(CorpsCandidat = 'RBDY2', candidat = 'DISKx', colorCandidat = 'BALLx', CorpsAntagoniste= 'MBS2D', antagoniste= 'JONCx', colorAntagoniste= 'MBJon', behav= clb_fric, alert= 0.002) sees += P2J
In the end, contact laws between the MBS contactors P2D = pre.see_table(CorpsCandidat = 'MBS2D', candidat = 'JONCx', colorCandidat = 'MBJon', CorpsAntagoniste= 'MBS2D', antagoniste= 'JONCx', colorAntagoniste= 'MBJon', behav= clb_fric, alert= 0.002) sees += P2D EXAMPLE post = pre.postpro_commands() solv = pre.postpro_command(type='SOLVER INFORMATIONS', step=1) post.addCommand(solv)
pen = pre.postpro_command(type='VIOLATION EVOLUTION', step=1) post.addCommand(pen) EXAMPLE Show the LMGC90 bodies pre.visuAvatars(bdys) Specifying the DATBOX folder datbox_path = os.path.join(os.getcwd(),'EXAMPLE/DATBOX') if not os.path.isdir(datbox_path): os.mkdir(datbox_path)
Writting all LMGC90 preprocessing files pre.writeBodies(bdys,chemin=datbox_path) pre.writeDrvDof(bdys,chemin=datbox_path) pre.writeDofIni(bdys,chemin=datbox_path) pre.writeModels(mods,chemin=datbox_path) The gravity is defined, in X-Y plane for 2D models (but vector is size 3 anyway) pre.writeBulkBehav(mats,chemin=datbox_path, gravy=[0.,-9.81,0.]) pre.writeTactBehav(tacs,sees,chemin=datbox_path) pre.writeVlocRlocIni(chemin=datbox_path) pre.writePostpro(commands=post, parts=bdys, path=datbox_path) Mbs data loading MbsFile = '$fileName$.mbs' mbs_data = MbsData('../../dataR/'+ MbsFile, build_path="../build/") Mbs data modification mbs_data.user_model.target.X = 0.05 # For changing user model value mbs_data.q[5] = 3.14 # For changing initial condition mbs_data.q0[5] = 3.14 # To keep trace of the change Mbs data Partitionning mbs_part = MbsPart(mbs_data) mbs_part.set_options(rowperm=1, verbose=1) mbs_part.mbs_run_part(mbs_data) del mbs_part
Mbs data direct dynamic simulation mbs_dirdyn = MbsDirdyn(mbs_data) mbs_dirdyn.set_options(dt0=1e-3, tf=5.0, save2file=1) mbs_dirdyn.set_options(respath="../../resultsR") # Path to the MBS results folder mbs_dirdyn.set_options(resfilename="Mbs_alone") # Name of the MBS results files mbs_dirdyn.set_options(animpath="../../animationR") # Path to the MBS animation folder mbs_dirdyn.set_options(like_MBsysC=True) mbs_dirdyn.mbs_run_dirdyn(mbs_data) del mbs_dirdyn
Reset MBs Data to initial configuration mbs_data.q[:] = mbs_data.q0[:] mbs_data.qd[:] = mbs_data.qd0[:] mbs_data.qdd[:] = mbs_data.qdd0[:] For a rendering of the MBS in Paraview, required to load the mbs before MbsRender = MbsDisplay(mbs_data, outputDir="./DISPLAY") EXAMPLE Change working directory if needed chipy.overall_SetWorkingDirectory('./') chipy.checkDirectories() chipy.SetDimension(2) chipy.Initialize()
string norm = 'Quad ' |
float relax = 1.0 |
string solver = 'Stored_Delassus_Loops ' |
EXAMPLE, 2D case Set the number of mbs files/system chipy.MBS2D_setNb(ml.getNbMbs()) # Retrieve the number of MBS Set the number of node on each MBS for i in range(ml.getNbMbs()): chipy.MBS2D_setNbNodes(i+1, ml.getNbNodes(i)) # Retrieve from the mbs data Set the number of contactor on the MBS, repeat on each MBS.
The MBS index start at 1 !!! iMbs = 1 nbContactors = 3 chipy.MBS2D_setNbTactors(iMbs,nbContactors)
Defining contactors on MBS iMbs = 1 # The MBS index start at 1 !!! nodeID = 1 # The index of the nodes on MBS start at 1 !!! tactOnNode = 1 # The index of the contactors on the current MBS. Start at 1 !!! chipy.MBS2D_addContactor(iMbs,nodeID,tactOnNode,'JONCx','MBJon',[0.3, 0.02]) tactOnNode = 2 chipy.MBS2D_addContactor(iMbs,nodeID,tactOnNode,'DISKx','MBJon',[0.2, 0.04]) tactOnNode = 3 chipy.MBS2D_addContactor(iMbs,nodeID,tactOnNode,'DISKx','MBJon',[0.1, 0.08])
Initialize MBS, 2D case chipy.MBS2D_initialize() For MBS rendering in paraview MbsRender.OpenDisplayFiles() MbsRender.WriteDisplayFiles(1, chipy.TimeEvolution_GetStep())
float tol = 1.0e-4 |