why my particles don`t show in paraview?
Hello
when I check model in paraview, just I see facets and there aren`t clumps or particles. why?
here is codes:
from yade import export,
import os
from yade import plot
import math
from yade import utils
import pylab
import matplotlib; matplotlib.
from matplotlib import pyplot
from yade import qt
import numpy as np
from numpy import *
from yade import export as expt
# Materials type:
Dolomite = FrictMat()
Dolomite.density = 2870 #kg/m^3
Dolomite.young = 24.36e9 #Pa
Dolomite.poisson = 0.2
Dolomite.
Bound = FrictMat()
Bound.density = 2870 #kg/m^3
Bound.young = 60e10 #Pa
Bound.poisson = 0.2
Bound.frictionAngle = radians(55.12) #rad
Shale = FrictMat()
Shale.density = 2750 #kg/m^3
Shale.young = 6e9 #Pa
Shale.poisson = 0.23
Shale.frictionAngle = radians(42) #rad
#O.materials.
SphCordns=
ListSph=[]
LayNo=SphCordns
for b in SphCordns:
if LayNo!=b[4]:
LayNo=b[4]
ListSph=[]
ListSph.
SphCordns=
ListSph=[]
LayNo=SphCordns
for b in SphCordns:
if LayNo!=b[4]:
LayNo=b[4]
ListSph=[]
ListSph.
v1=((-2.
v2=((-2,
v3=((-1.
v4=((-1,
v5=((-0.
v6=((1,
v7=((1.
v8=((2,
v9=((2.
v10=((3,
v11=((3.
v12=((4.
v13=((4.
v14=((5.
v15=((5.
v16=((6.
v17=((6.
v18=((6.
v19=((6.
v20=((6.
v21=((6.
v22=((7.
v23=((7.
v24=((7.
v25=((7.
v26=((7.
v27=((7.
v28=((7.
v29=((7.
v30=((8.
v31=((8.
v32=((8.
v33=((8.
v34=((8.
v35=((8.
v36=((9.
v37=((9.
v38=((9.
v39=((9.
v40=((9.
v41=((9.
v42=((9.
v43=((9.
v44=((9.
v45=((5.
v46=((5.
v47=((5.
v48=((5.
v49=((5.
v50=((5.
v51=((5.
v52=((5.
v53=((5.
v54=((5.
v55=((5.
v56=((5.
v57=((5.
v58=((4.
v59=((4.
v60=((4.
v61=((4.
v62=((4.
v63=((4.
v64=((4.
v65=((4.
v66=((4.
v67=((4.
v68=((4.
v69=((4.
v70=((4.
v71=((4.
v72=((4,
v73=((4,
v74=((3.
v75=((3.
v76=((3.
v77=((3.
v78=((3.
v79=((3.
v80=((3.
v81=((3.
v82=((3.
v83=((3.
v84=((2.
v85=((0,
v86=((0,
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
O.bodies.
for b in O.bodies:
if b.material is Dolomite or b.material is Shale:
O.engines=[
ForceResetter(),
InsertionSor
InteractionLoop(
[
[
[
),
NewtonIntegr
]
utils.calm()
O.dt=10e-6
O.run(1000,True)
O.run()
os.mkdir(
O.engines=
ClumpVtkData = expt.VTKExporte
def VTKview():
ClumpVtkDat
ClumpVtkDat
thanks a lot
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Stránský
- Solved:
- 2020-12-05
- Last query:
- 2020-12-05
- Last reply:
- 2020-12-03
Robert Caulk (rcaulk) said : | #1 |
Can you please provide an MWE [1] that doesn't involve unnecessary code.
Jan Stránský (honzik) said : | #2 |
Hello,
> when I check model in paraview
please be more specific and describe the steps you are using for "checking". As it is, we can merely guess where the problem could be..
Are you aware of [1]?
cheers
Jan
[1] https:/
Mahdeyeh (mahdiye.sky) said : | #3 |
Hi
these codes are for saving data in file which can be opened with Paraview:
os.mkdir(
O.engines=
ClumpVtkData = expt.VTKExporte
def VTKview():
ClumpVtkDat
ClumpVtkDat
Jan Stránský (honzik) said : | #4 |
Hello,
> when I check model in paraview
please be more specific and describe the steps (IN PARAVIEW) you are using for "checking". As it is, we can merely guess where the problem could be..
Are you aware of [1]?
cheers
Jan
[1] https:/
Mahdeyeh (mahdiye.sky) said : | #5 |
Sorry for the delay in reply.
Thank you Jan Stránský , with your link about "Rendering spherical particles. Glyphs" I can see spherical particles in paraview by these command:
"Spheres will only appear as points. To make them look as spheres, you have to add “glyph” to the p1-spheres.* item in the pipeline using the paraview-glyph-icon icon. Then set (in the Object inspector)
“Glyph type” to Sphere
“Radius” to 1
“Scale mode” to Scalar (Scalar is set above to be the radii value saved in the file, therefore spheres with radius 1 will be scaled by their true radius)
“Set scale factor” to 1
optionally uncheck “Mask points” and “Random mode” (they make some particles not to be rendered for performance reasons, controlled by the “Maximum Number of Points”)
After clicking “Apply”, spheres will appear. They will be rendered over the original white points, which you can disable by clicking on the eye icon next to p1-spheres.* in the Pipeline browser."
But in the Object inspector there is not any icon for setting “Radius” to 1 ! If I do all steps except setting "“Radius” to 1", could see spherical particles but they do not show in real radius as be in my main code.
What should I do to see spheres in Paraview exactly with true radius in Yade?
Thank you a lot
Mahdeyeh (mahdiye.sky) said : | #6 |
my Paraview is :
5.4.1 64-bit
Mahdeyeh (mahdiye.sky) said : | #7 |
1- shall I set Glyph mode to All points (in Masking) for seeing spheres in Paraview exactly with true radius in Yade?
I did this and I think, worked!!
2- In Yade, my sphere particles are in two colour which I can distinguish them, so in Paraview for having two colour for them: should I set coloring to Glyphvector (in Display (Geom))?
Thank you
|
#8 |
> But in the Object inspector there is not any icon for setting “Radius” to 1
when you choose "GlyhpType" to "Sphere", just two lines below there is "Radius". Set it to 1 and then
somewhat below there is "Scaling" section, set "Scale Mode" to "scalar" and "Scale Factor" to 1
> but they do not show in real radius as be in my main code.
how do you know?
> shall I set Glyph mode to All points (in Masking) for seeing spheres in Paraview exactly with true radius in Yade?
"All points" just displays all points (paraview has some default limit on amount on shown particles).
It has NO influence on radius
> In Yade, my sphere particles are in two colour which I can distinguish them, so in Paraview for having two colour for them: should I set coloring to Glyphvector (in Display (Geom))?
if you use color just to distinguish two (or a few) "types" of particles, I suggest not to export color itself, but rather some "id", something like:
###
def color2scalar(
if color == (1,0,0): return 1 # red
if color == (0,0,1): return 2 # blue
return 0 # or raise error
...exportSphere
###
then in paraview you can easily color it by the color scalar
cheers
Jan
Mahdeyeh (mahdiye.sky) said : | #9 |
Thanks Jan Stránský, that solved my question.