call a class from yade
Good evening,
What i am trying to do is bundle the yade simulation in a class which works
from yade.pack import *
from yade import ymport
import math
class simul():
def run(self):
O.bodies.append([
sphere(
sphere(
])
O.engines=[
ForceResetter(),
InsertionSor
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
NewtonIntegra
]
O.dt=
#simulation=simul()
#simulation.run()
and call it from another file
import math
import operator
import gts
from yade.pack import *
from yade import ymport
from myclass import simul
simulation=simul()
simulation.run()
i get this
yade run.py
Welcome to Yade 1.20.0
TCP python prompt on localhost:9000, auth cookie `ucsdsy'
XMLRPC info provider on http://
Running script run.py
Traceback (most recent call last):
File "/usr/bin/yade", line 182, in runScript
execfile(
File "run.py", line 10, in <module>
from myclass import simul
ImportError: No module named myclass
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view (use h-key for showing help), F10 both, F9 generator, F8 plot. ]]
[0;34mYade [[1;34m1[0;34m]: [0m
Thank you for the help
(PS, amazing community)
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Hongyang Cheng
- Solved:
- Last query:
- Last reply:
This question was reopened
- by JOHN