← Back to team overview

yade-users team mailing list archive

[Question #652966]: utils.getStressAndTangent()

 

New question #652966 on Yade:
https://answers.launchpad.net/yade/+question/652966

from your website, i can see there is a command called utlis.getStressAndTangent() which can give a macroscopic Tangent.   However, the program with such command has error:

AttributeError: 'module' object has no attribute 'getStressAndTangent'

Yade on my computer is 1.07.0, i am wondering it is the version problem.

And also, if it is the version problem, how can i update the Yade version, for i have input " sudo apt-get install yade"  in terminal and it says the version is the newest.

You can use such codes to test what i met:
-------------------------------------------------------------------------
#!/usr/bin/python           # This is server.py file

import string
from yade import plot,qt
from yade.pack import *
from yade import pack, plot
import socket               # Import socket module
import numpy                # initial the math of matrix compute (needed in ns) 

# initial the global variables
arrcc =[0]*3  # last step strain(commit)
arrtt =[0]*3  # last step strain(trail)
scc=[0]*3 # last step stress
orst=1   # initialize the orginal save document(trial)
check=[0]*1 # I need to calculate the first step when ag=0
check[0]=0
theTangent=(0)
# load the identical package
O.load('/tmp/cccc.gz')  # only load the package, because the O.cell.velGrad is not compatible with the peri3dcontroller eigine


#O.periodic=True   ### note!!!  add
O.dt=1e-8 

# see the example of peri3dcontroller, 1.5 is used to speed up the computation
EnlargeFactor=1.5 
EnlargeFactor=1.0
O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=EnlargeFactor,label='bo1s')]),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=EnlargeFactor,label='ig2ss')],
		[Ip2_CpmMat_CpmMat_CpmPhys()],[Law2_ScGeom_CpmPhys_Cpm()]),
	NewtonIntegrator(),
	#VTKRecorder(fileName='3dfirst-vtk-',recorders=['all','cpm'],iterPeriod=4999),

]

O.cell.velGrad=utils.Matrix3(0,0,0,0,0,0,0,0,0)
O.step()
bo1s.aabbEnlargeFactor=ig2ss.interactionDetectionFactor=1.               # O.step and change 1.5 back to 1. , because the concrete model is developed in the 1. environment


if orst==1:
	print "orst1"	
	
	for b in O.bodies:
		b.material.young = 1.0001*17e10
	
	

	orst=2
	ag = [0]*3               #  current - last   ie. the changed strain
	ag[0] = 0
	ag[1]= 0
 	ag[2] =0
	ns=100 
	dstrain = utils.Matrix3(ag[0],ag[2],0,0,ag[1],0,0,0,0)      # the goal strain xx xy xz, yx yy yz, zx zy zz                                           
	O.cell.velGrad=dstrain/(ns*O.dt)
	O.run(ns,True)                                               
	stressValue=utils.getStress()
	stressxx=stressValue[0,0]                                   # the return stress xx
	stressyy=stressValue[1,1]                                   # the return stress yy
	stressxy=(stressValue[0,1]+stressValue[1,0])/2              # the return stress xy = (xy + yx)/2

	print "stress here from strain[0,0,0] step 1"
	print stressxx
	print stressyy
	print stressxy
	
	theTangent=utils.getStressAndTangent()
	print theTangent
	O.saveTmp('first')   

-------------------------------------------------------------------------------------------------



Thanks a lot!

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.