[Yade-users] [Question #341304]: Landing of a satellite

2016-08-12 Thread Jonathan Pergoli
New question #341304 on Yade:
https://answers.launchpad.net/yade/+question/341304

Hi guys,

I am performing simulation in which a satellite lands on the soil. The 
simulation deal with more than 70.000 particles and take a week to make 10 
seconds of simulations using 10 cores. I'd like to know if it is possible to 
speed it up.
This is the code:

from yade import utils,ymport,export,plot
import math as m


# Material
E1=1e+8
E2=5e+7
mli=FrictMat(density=643,frictionAngle=0.1489,label="MLI",young=E2)
MLI=O.materials.append(mli)
gravel=FrictMat(density=1700,frictionAngle=0.7853,label="gravel",young=E1)
GRAVEL=O.materials.append(gravel)

# Ground
s=ymport.textExt('1cm_0g2.txt',format='x_y_z_r')
sphere=O.bodies.append(s)


# Create a vector o spheres to eliminate those that have COG above the container
for i in O.bodies:
if isinstance(i.shape,Sphere):
if i.state.pos[2]>.30:
O.bodies.erase(i.id)
print i.state.mass
for i in O.bodies:
if isinstance(i.shape,Sphere):
if i.state.pos[2]<0:
O.bodies.erase(i.id)
for i in O.bodies:
if isinstance(i.shape,Sphere):
x=i.state.pos[0]
y=i.state.pos[1]
r=m.sqrt(x**2+y**2)
if r>.75:
O.bodies.erase(i.id)

aa=[]
for i in O.bodies:
if isinstance(i.shape,Sphere):
aa.append(i.id)

print len(aa)

# Cylinder
hc=.30
c=geom.facetCylinder((0,0,.15),radius=.75,height=hc,segmentsNumber=100,wallMask=6,material="gravel")
O.bodies.append(c)

# SAT
a=.2774
b=.2922
c=.1973
aa=a/2
bb=b/2
cc=c/2
h=.65
dist=0
theta=0
thetav=0
v1=(aa,bb,c)
v2=(aa,-bb,c)
v3=(-aa,-bb,c)
v4=(-aa,bb,c)
v5=(aa,bb,0)
v6=(aa,-bb,0)
v7=(-aa,-bb,0)
v8=(-aa,bb,0)
V=[v1,v2,v3,v4,v5,v6,v7,v8]
vz=.19
R=[[m.cos(theta),0,m.sin(theta)],[0,1,0],[-m.sin(theta),0,m.cos(theta)]]
v1=(R[0][0]*V[0][0]+R[0][1]*V[0][1]+R[0][2]*V[0][2],R[1][0]*V[0][0]+R[1][1]*V[0][1]+R[1][2]*V[0][2],R[2][0]*V[0][0]+R[2][1]*V[0][1]+R[2][2]*V[0][2])
v2=(R[0][0]*V[1][0]+R[0][1]*V[1][1]+R[0][2]*V[1][2],R[1][0]*V[1][0]+R[1][1]*V[1][1]+R[1][2]*V[1][2],R[2][0]*V[1][0]+R[2][1]*V[1][1]+R[2][2]*V[1][2])
v3=(R[0][0]*V[2][0]+R[0][1]*V[2][1]+R[0][2]*V[2][2],R[1][0]*V[2][0]+R[1][1]*V[2][1]+R[1][2]*V[2][2],R[2][0]*V[2][0]+R[2][1]*V[2][1]+R[2][2]*V[2][2])
v4=(R[0][0]*V[3][0]+R[0][1]*V[3][1]+R[0][2]*V[3][2],R[1][0]*V[3][0]+R[1][1]*V[3][1]+R[1][2]*V[3][2],R[2][0]*V[3][0]+R[2][1]*V[3][1]+R[2][2]*V[3][2])
v5=(R[0][0]*V[4][0]+R[0][1]*V[4][1]+R[0][2]*V[4][2],R[1][0]*V[4][0]+R[1][1]*V[4][1]+R[1][2]*V[4][2],R[2][0]*V[4][0]+R[2][1]*V[4][1]+R[2][2]*V[4][2])
v6=(R[0][0]*V[5][0]+R[0][1]*V[5][1]+R[0][2]*V[5][2],R[1][0]*V[5][0]+R[1][1]*V[5][1]+R[1][2]*V[5][2],R[2][0]*V[5][0]+R[2][1]*V[5][1]+R[2][2]*V[5][2])
v7=(R[0][0]*V[6][0]+R[0][1]*V[6][1]+R[0][2]*V[6][2],R[1][0]*V[6][0]+R[1][1]*V[6][1]+R[1][2]*V[6][2],R[2][0]*V[6][0]+R[2][1]*V[6][1]+R[2][2]*V[6][2])
v8=(R[0][0]*V[7][0]+R[0][1]*V[7][1]+R[0][2]*V[7][2],R[1][0]*V[7][0]+R[1][1]*V[7][1]+R[1][2]*V[7][2],R[2][0]*V[7][0]+R[2][1]*V[7][1]+R[2][2]*V[7][2])
p=utils.polyhedron((v1,v2,v3,v4,v5,v6,v7,v8),fixed=False,color=(.6,.45,0),material="MLI",wire=False)
SAT=O.bodies.append(p)
p.state.vel=(vz*m.sin(thetav),0,-vz*m.cos(thetav))
p.state.ori=((0,-1,0),theta)
p.state.pos=(-dist,0,h)
Ixx=0.081026
Iyy=0.10031
Izz=0.12116
p.state.inertia=(Ixx,Iyy,Izz)
M=p.id
r=m.sqrt(aa**2+bb**2)
Rj=m.sqrt(r**2+cc**2)
Ri=0.05
Rr=Rj*Ri/(Rj+Ri)
mu_rM=0.016
mu_rG=2.05
KN=E1*2*Ri*E1*2*Ri/(E1*2*Ri+E1*2*Ri)#6.5e+4
KR=3*Ri**2*mu_rG**2*KN/4
print "SAT's mass = ",p.state.mass
print "SAT's position = ",p.state.pos
print "SAT's orientation = ",p.state.ori
print "SAT's inertia = ",p.state.inertia
print "Timestep = ",O.dt

# Functions

def forces():
# rotation of axis
q1=p.state.ori[0]
q2=p.state.ori[1]
q3=p.state.ori[2]
q4=p.state.ori[3]

RR=[[q1**2-q2**2-q3**2+q4**2,2*(q1*q2+q3*q4),2*(q1*q3-q2*q4)],[2*(q1*q2-q3*q4),-q1**2+q2**2-q3**2+q4**2,2*(q2*q3+q1*q4)],[2*(q1*q3+q2*q4),2*(q2*q3-q1*q4),-q1**2-q2**2+q3**2+q4**2]]
e1=(RR[0][0],RR[0][1],RR[0][2])
e2=(RR[1][0],RR[1][1],RR[1][2])
e3=(RR[2][0],RR[2][1],RR[2][2])
massa1=0
massa2=0
massa3=0
for i in O.bodies:
if isinstance(i.shape,Sphere):
if i.state.vel[2]>.001:
massa1+=i.state.mass
if i.state.pos[2]>.4:
massa2+=i.state.mass
if i.state.vel[2]>.01:
massa3+=i.state.mass
# forces
#Fx=utils.sumForces([MASCOT],e1)
#Fy=utils.sumForces([MASCOT],e2)
#Fz=utils.sumForces([MASCOT],e3)

#Tx=utils.sumTorques([MASCOT],axis=e1,axisPt=(p.state.pos[0]-aa,p.state.pos[1],p.state.pos[2]))


Re: [Yade-users] [Question #327518]: install yadedaily on Ubuntu 14.04

2016-08-12 Thread Jan De Pue
Question #327518 on Yade changed:
https://answers.launchpad.net/yade/+question/327518

Jan De Pue proposed the following answer:
Yep, it is fixed. Thanks!

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #340018]: Simulation of the shearbox

2016-08-12 Thread Jan Stránský
Question #340018 on Yade changed:
https://answers.launchpad.net/yade/+question/340018

Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Felipe,
there might be several reasons, please provide a MWE [1].
Additionally please specify:
- more in detail what you would like to achieve (e.g. I **assume** constant
motion=motion at constant velocity)
- how the requirements differs from actual simulation (not important with
MWE as anybody can try the provided script).
thanks
Jan

[1] https://yade-dem.org/wiki/Howtoask

PS: from the videos made from just a few pictures, it is not possible to
see anything :-)


2016-08-12 2:12 GMT+02:00 Felipe :

> New question #340018 on Yade:
> https://answers.launchpad.net/yade/+question/340018
>
> Hello Everybody,
>
>
> I am having some issues about simulation of the shear box. When the
> surface was moving down, the motion is not constant. It's sounds like leaps
> in motion.
>
> I have tried to change all my script to build the same program with
> different ways. However, the result was the same. I was wondering if anyone
> could help me to understand what is happening.
>
> I am sharing one video which was produced at the ParaView (version 5.0.1)
> were simulated on Ubuntu 16.04 LTS.
>
> https://www.dropbox.com/sh/yu6crs6d4bpu996/AACeT41RsvgpBPmJkcX2gr7ra?dl=0
>
>
> The best motion will be moving down constantly  and when the surface gets
> either the correct position or apply stress, the box is going to move
> right, like shear motion.
>
> Do Anyone have any idea to solve this problem?
>
> Hope getting a solution about this problem.
>
> Best Regards,
>
> Felipe
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> ___
> Mailing list: https://launchpad.net/~yade-users
> Post to : yade-users@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp