NameError Traceback (most recent call last)
Hello,
I am using Ubuntu 18.04, and Yade 2019-08-
I have read the wiki and tutorials, struggle with codes as a beginner in yade and asked some questions. Finally, I slightly changed https:/
ehsan@ehsan:
Welcome to Yade 2019-08-
Using python version: 3.6.8 (default, Oct 7 2019, 12:59:55)
[GCC 8.3.0]
TCP python prompt on localhost:9000, auth cookie `yksdca'
XMLRPC info provider on http://
Running script Q.py
The constructor with a shareWidget is deprecated, use the regular contructor instead.
Number of elements: 2006
Box Volume: 5.3940427e-317
Box Volume calculated: 1000.0
-------
NameError Traceback (most recent call last)
~/yade/
NameError: name 'history' is not defined
-------
NameError Traceback (most recent call last)
~/yade/
NameError: name 'history' is not defined
-------
NameError Traceback (most recent call last)
~/yade/
NameError: name 'history' is not defined
-------
NameError Traceback (most recent call last)
~/yade/
.
.
.
Since I have defined "history()", I don't know what is the problem. Unfortunately couldn't find the answer by googling it.
*******
This is my code:
#######
######### TRIAXIAL PROBLEM, Y IS THE VERTICAL AXIS, X IS THE RIGHT AXIS, Z IS THE FRONT AXIS #########
#######
import numpy as np
import math
from yade import pack, plot, qt, export, utils
from datetime import datetime
#######
######### DEFINING VARIABLES #########
nRead=readParam
num_spheres=2000,
compFricDegree = 30,
key='_
unknownOk=True
)
from yade.params import table
num_spheres=
key=table.key
targetPorosity = 0.43
compFricDegree = table.compFricD
finalFricDegree = 30
rate=-0.02
damp=0.2
stabilityThresh
young=15e6
poisson=0.4
mn,mx=Vector3(
sigmaIso=-50e3
#######
######### DEFINING MATERIALS #########
O.materials.
O.materials.
#######
######### DEFINING PACKING #########
walls=aabbWalls
wallIds=
sp=pack.
volume = (mx[0]-
mean_rad = pow(0.09*
clumps=False
if clumps:
volume = (mx[0]-
mean_rad = pow(0.09*
c1=
sp.
sp.
O.bodies.
else:
sp.
O.bodies.
#######
######### DEFINING TRIAXIAL TEST #########
triax=TriaxialS
maxMultiplier=
finalMaxMultip
thickness = 0,
stressMask = 7,
internalCompac
)
#######
######### DEFINING ENGINES #########
newton=
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
GlobalStiffnes
triax,
TriaxialStateR
newton,
PyRunner(
PyRunner(
]
Gl1_Sphere.
if nRead==0: yade.qt.
print ('Number of elements: ', len(O.bodies))
print ('Box Volume: ', triax.boxVolume)
print ('Box Volume calculated: ', volume)
#######
######### APPLYING CONFINING PRESSURE #########
triax.internalC
setContactFrict
triax.stressmask=7
triax.goal1=
triax.goal2=
triax.goal3=
while 1:
O.run(1000, True)
unb=
meanS=
print ('unbalanced force:',unb,' mean stress engine: ',triax.
print ('porosity=
print ('void ratio='
print ('-----Phase_01: Isotropic compression 50kPa--(^_^)---')
if unb<stabilityTh
break
O.save(
print ('### Isotropic phase saved ###')
#######
######### DEVIATORIC LOADING #########
triax.internalC
setContactFrict
triax.stressMask = 5
triax.goal2=rate
triax.goal1=
triax.goal3=
while 1:
O.run(1000, True)
unb=
axialS=
print ('step=', O.iter, 'unbalanced force:',unb,' sigma2: ',axialS, 'q=', axialS-sigmaIso)
print ('axial deformation (%)', (triax.
if abs((triax.
if abs((triax.
if abs((triax.
if abs((triax.
if triax.strain[
break
O.save('final.xml')
#######
######### RECORD AND PLOT DATA #########
qt.View()
def checkUnbalanced():
if unbalancedForce
O.pause()
plot.
def history():
plot.addData(
ev=-
s11=
s22=
s33=
i=O.
)
O.run(5000,True)
plot.plots=
plot.labels=
plot.plot()
plot.saveDataTx
plot.saveGnuplo
*******
And also before the error, I get 1 notice as "The constructor with a shareWidget is deprecated, use the regular contructor instead.". I don't know if this affects my code or not.
Could you please let me know if there is any other mistake in this code?
Thank you very much for your help.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Stránský
- Solved:
- Last query:
- Last reply: