more than 255 arguments

Asked by mrhappy on 2020-02-04

Hi,

I have a model where I define a function in which there are 300 variables that are save (mainly the poistion of some elements). I get an error saying that more than 255 arguments. i tried to make two different functions but that did not work as well. Any idea of how I can record positions of 300 elements?

Thanks!

# FUNCTIONAL COMPONENTS
def addPlotData1():
 plot.addData(t=O.time,Displacement = O.bodies[2450].state.pos[1] - 50, Force = -1*(O.forces.f(2450)[1]+ O.forces.f(2451)[1] + O.forces.f(2452)[1] + O.forces.f(2453)[1] + O.forces.f(2454)[1] + O.forces.f(2455)[1] + O.forces.f(2456)[1] + O.forces.f(2457)[1] + O.forces.f(2458)[1] + O.forces.f(2459)[1] + O.forces.f(2460)[1] + O.forces.f(2461)[1] + O.forces.f(2462)[1] + O.forces.f(2463)[1] + O.forces.f(2464)[1] + O.forces.f(2465)[1] + O.forces.f(2466)[1] + O.forces.f(2467)[1] + O.forces.f(2468)[1] + O.forces.f(2469)[1] + O.forces.f(2470)[1] + O.forces.f(2471)[1] + O.forces.f(2472)[1] + O.forces.f(2473)[1] + O.forces.f(2474)[1] + O.forces.f(2475)[1] + O.forces.f(2476)[1] + O.forces.f(2477)[1] + O.forces.f(2478)[1] + O.forces.f(2479)[1] + O.forces.f(2480)[1] + O.forces.f(2481)[1] + O.forces.f(2482)[1] + O.forces.f(2483)[1] + O.forces.f(2484)[1] + O.forces.f(2485)[1] + O.forces.f(2486)[1] + O.forces.f(2487)[1] + O.forces.f(2488)[1] + O.forces.f(2489)[1] + O.forces.f(2490)[1] + O.forces.f(2491)[1] + O.forces.f(2492)[1] + O.forces.f(2493)[1] + O.forces.f(2494)[1] + O.forces.f(2495)[1] + O.forces.f(2496)[1] + O.forces.f(2497)[1] + O.forces.f(2498)[1] + O.forces.f(2499)[1] ) ,DX1 = O.bodies[1250].state.pos[0], DY1 = O.bodies[1250].state.pos[1], DX2 = O.bodies[1251].state.pos[0], DY2 = O.bodies[1251].state.pos[1], DX3 = O.bodies[1252].state.pos[0], DY3 = O.bodies[1252].state.pos[1], DX4 = O.bodies[1253].state.pos[0], DY4 = O.bodies[1253].state.pos[1], DX5 = O.bodies[1254].state.pos[0], DY5 = O.bodies[1254].state.pos[1], DX6 = O.bodies[1255].state.pos[0], DY6 = O.bodies[1255].state.pos[1], DX7 = O.bodies[1256].state.pos[0], DY7 = O.bodies[1256].state.pos[1], DX8 = O.bodies[1257].state.pos[0], DY8 = O.bodies[1257].state.pos[1], DX9 = O.bodies[1258].state.pos[0], DY9 = O.bodies[1258].state.pos[1], DX10 = O.bodies[1259].state.pos[0], DY10 = O.bodies[1259].state.pos[1], DX11 = O.bodies[1260].state.pos[0], DY11 = O.bodies[1260].state.pos[1], DX12 = O.bodies[1261].state.pos[0], DY12 = O.bodies[1261].state.pos[1], DX13 = O.bodies[1262].state.pos[0], DY13 = O.bodies[1262].state.pos[1], DX14 = O.bodies[1263].state.pos[0], DY14 = O.bodies[1263].state.pos[1], DX15 = O.bodies[1264].state.pos[0], DY15 = O.bodies[1264].state.pos[1], DX16 = O.bodies[1265].state.pos[0], DY16 = O.bodies[1265].state.pos[1], DX17 = O.bodies[1266].state.pos[0], DY17 = O.bodies[1266].state.pos[1], DX18 = O.bodies[1267].state.pos[0], DY18 = O.bodies[1267].state.pos[1], DX19 = O.bodies[1268].state.pos[0], DY19 = O.bodies[1268].state.pos[1], DX20 = O.bodies[1269].state.pos[0], DY20 = O.bodies[1269].state.pos[1], DX21 = O.bodies[1270].state.pos[0], DY21 = O.bodies[1270].state.pos[1], DX22 = O.bodies[1271].state.pos[0], DY22 = O.bodies[1271].state.pos[1], DX23 = O.bodies[1272].state.pos[0], DY23 = O.bodies[1272].state.pos[1], DX24 = O.bodies[1273].state.pos[0], DY24 = O.bodies[1273].state.pos[1], DX25 = O.bodies[1274].state.pos[0], DY25 = O.bodies[1274].state.pos[1], DX26 = O.bodies[1275].state.pos[0], DY26 = O.bodies[1275].state.pos[1], DX27 = O.bodies[1276].state.pos[0], DY27 = O.bodies[1276].state.pos[1], DX28 = O.bodies[1277].state.pos[0], DY28 = O.bodies[1277].state.pos[1], DX29 = O.bodies[1278].state.pos[0], DY29 = O.bodies[1278].state.pos[1], DX30 = O.bodies[1279].state.pos[0], DY30 = O.bodies[1279].state.pos[1], DX31 = O.bodies[1280].state.pos[0], DY31 = O.bodies[1280].state.pos[1], DX32 = O.bodies[1281].state.pos[0], DY32 = O.bodies[1281].state.pos[1], DX33 = O.bodies[1282].state.pos[0], DY33 = O.bodies[1282].state.pos[1], DX34 = O.bodies[1283].state.pos[0], DY34 = O.bodies[1283].state.pos[1], DX35 = O.bodies[1284].state.pos[0], DY35 = O.bodies[1284].state.pos[1], DX36 = O.bodies[1285].state.pos[0], DY36 = O.bodies[1285].state.pos[1], DX37 = O.bodies[1286].state.pos[0], DY37 = O.bodies[1286].state.pos[1], DX38 = O.bodies[1287].state.pos[0], DY38 = O.bodies[1287].state.pos[1], DX39 = O.bodies[1288].state.pos[0], DY39 = O.bodies[1288].state.pos[1], DX40 = O.bodies[1289].state.pos[0], DY40 = O.bodies[1289].state.pos[1], DX41 = O.bodies[1290].state.pos[0], DY41 = O.bodies[1290].state.pos[1], DX42 = O.bodies[1291].state.pos[0], DY42 = O.bodies[1291].state.pos[1], DX43 = O.bodies[1292].state.pos[0], DY43 = O.bodies[1292].state.pos[1], DX44 = O.bodies[1293].state.pos[0], DY44 = O.bodies[1293].state.pos[1], DX45 = O.bodies[1294].state.pos[0], DY45 = O.bodies[1294].state.pos[1], DX46 = O.bodies[1295].state.pos[0], DY46 = O.bodies[1295].state.pos[1], DX47 = O.bodies[1296].state.pos[0], DY47 = O.bodies[1296].state.pos[1], DX48 = O.bodies[1297].state.pos[0], DY48 = O.bodies[1297].state.pos[1], DX49 = O.bodies[1298].state.pos[0], DY49 = O.bodies[1298].state.pos[1], DX50 = O.bodies[1299].state.pos[0], DY50 = O.bodies[1299].state.pos[1], DX51 = O.bodies[1200].state.pos[0], DY51 = O.bodies[1200].state.pos[1], DX52 = O.bodies[1201].state.pos[0], DY52 = O.bodies[1201].state.pos[1], DX53 = O.bodies[1202].state.pos[0], DY53 = O.bodies[1202].state.pos[1], DX54 = O.bodies[1203].state.pos[0], DY54 = O.bodies[1203].state.pos[1], DX55 = O.bodies[1204].state.pos[0], DY55 = O.bodies[1204].state.pos[1], DX56 = O.bodies[1205].state.pos[0], DY56 = O.bodies[1205].state.pos[1], DX57 = O.bodies[1206].state.pos[0], DY57 = O.bodies[1206].state.pos[1], DX58 = O.bodies[1207].state.pos[0], DY58 = O.bodies[1207].state.pos[1], DX59 = O.bodies[1208].state.pos[0], DY59 = O.bodies[1208].state.pos[1], DX60 = O.bodies[1209].state.pos[0], DY60 = O.bodies[1209].state.pos[1], DX61 = O.bodies[1210].state.pos[0], DY61 = O.bodies[1210].state.pos[1], DX62 = O.bodies[1211].state.pos[0], DY62 = O.bodies[1211].state.pos[1], DX63 = O.bodies[1212].state.pos[0], DY63 = O.bodies[1212].state.pos[1], DX64 = O.bodies[1213].state.pos[0], DY64 = O.bodies[1213].state.pos[1], DX65 = O.bodies[1214].state.pos[0], DY65 = O.bodies[1214].state.pos[1], DX66 = O.bodies[1215].state.pos[0], DY66 = O.bodies[1215].state.pos[1], DX67 = O.bodies[1216].state.pos[0], DY67 = O.bodies[1216].state.pos[1], DX68 = O.bodies[1217].state.pos[0], DY68 = O.bodies[1217].state.pos[1], DX69 = O.bodies[1218].state.pos[0], DY69 = O.bodies[1218].state.pos[1], DX70 = O.bodies[1219].state.pos[0], DY70 = O.bodies[1219].state.pos[1], DX71 = O.bodies[1220].state.pos[0], DY71 = O.bodies[1220].state.pos[1], DX72 = O.bodies[1221].state.pos[0], DY72 = O.bodies[1221].state.pos[1], DX73 = O.bodies[1222].state.pos[0], DY73 = O.bodies[1222].state.pos[1], DX74 = O.bodies[1223].state.pos[0], DY74 = O.bodies[1223].state.pos[1], DX75 = O.bodies[1224].state.pos[0], DY75 = O.bodies[1224].state.pos[1], DX76 = O.bodies[1225].state.pos[0], DY76 = O.bodies[1225].state.pos[1], DX77 = O.bodies[1226].state.pos[0], DY77 = O.bodies[1226].state.pos[1], DX78 = O.bodies[1227].state.pos[0], DY78 = O.bodies[1227].state.pos[1], DX79 = O.bodies[1228].state.pos[0], DY79 = O.bodies[1228].state.pos[1], DX80 = O.bodies[1229].state.pos[0], DY80 = O.bodies[1229].state.pos[1], DX81 = O.bodies[1230].state.pos[0], DY81 = O.bodies[1230].state.pos[1], DX82 = O.bodies[1231].state.pos[0], DY82 = O.bodies[1231].state.pos[1], DX83 = O.bodies[1232].state.pos[0], DY83 = O.bodies[1232].state.pos[1], DX84 = O.bodies[1233].state.pos[0], DY84 = O.bodies[1233].state.pos[1], DX85 = O.bodies[1234].state.pos[0], DY85 = O.bodies[1234].state.pos[1], DX86 = O.bodies[1235].state.pos[0], DY86 = O.bodies[1235].state.pos[1], DX87 = O.bodies[1236].state.pos[0], DY87 = O.bodies[1236].state.pos[1], DX88 = O.bodies[1237].state.pos[0], DY88 = O.bodies[1237].state.pos[1], DX89 = O.bodies[1238].state.pos[0], DY89 = O.bodies[1238].state.pos[1], DX90 = O.bodies[1239].state.pos[0], DY90 = O.bodies[1239].state.pos[1], DX91 = O.bodies[1240].state.pos[0], DY91 = O.bodies[1240].state.pos[1], DX92 = O.bodies[1241].state.pos[0], DY92 = O.bodies[1241].state.pos[1], DX93 = O.bodies[1242].state.pos[0], DY93 = O.bodies[1242].state.pos[1], DX94 = O.bodies[1243].state.pos[0], DY94 = O.bodies[1243].state.pos[1], DX95 = O.bodies[1244].state.pos[0], DY95 = O.bodies[1244].state.pos[1], DX96 = O.bodies[1245].state.pos[0], DY96 = O.bodies[1245].state.pos[1], DX97 = O.bodies[1246].state.pos[0], DY97 = O.bodies[1246].state.pos[1], DX98 = O.bodies[1247].state.pos[0], DY98 = O.bodies[1247].state.pos[1], DX99 = O.bodies[1248].state.pos[0], DY99 = O.bodies[1248].state.pos[1], DX100 = O.bodies[1249].state.pos[0], DY100 = O.bodies[1249].state.pos[1], )

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
2020-02-04
Last reply:
2020-02-04
Jan Stránský (honzik) said : #1

Hello,

plot module is not suitable for this tasks. According to your needs, you can use e.g. export.VTKExporter or save it "manually" to a text file (using standard Python way).

cheers
Jan

Can you help with this problem?

Provide an answer of your own, or ask mrhappy for more information if necessary.

To post a message you must log in.