Re: Wrong results in lineral_viscoelastic.py from examples. What may cause this?
![](https://secure.gravatar.com/avatar/573ed3088eea742af8bcfeac90bc882d.jpg?s=120&d=mm&r=g)
On 04/20/2017 02:07 PM, Robert Cimrman wrote:
On 04/20/2017 01:49 PM, fatune@gmail.com wrote:
When I try lineral_viscoelastic.py from examples and then see results via postproc.py I see 5 blocks of blue colors which differs from results show in manual. The result is the same no matter how many time steps I set or which time step I currently see in Maya.
Try moving the sliders / set another time step. That should change the colors of the blocks. If not, send here the output of the "./simple.py examples/linear_elasticity/linear_viscoelastic.py" command.
When I run it like this:
python examples/linear_elasticity/linear_viscoelastic.py block.h5
I see error because there is no block.h5 yet. So instead firstly I run:
./simple.py examples/linear_elasticity/linear_viscoelastic.py
which creates block.h5 file, and then:
./postporc.py block.h5
Try running
./postproc.py -b --step=-1 block.h5
r.
I try to understand the logic of simulating viscoelastic behaviour over time through the Sfepy. That seems too complicated to me yet. But even standard example didn't work for me. What may cause the problem?
![](https://secure.gravatar.com/avatar/ec6a21d58278d578c93c607210be6655.jpg?s=120&d=mm&r=g)
Thank you for your answer Robert. It works now. It works even when I set --step=2. But now I have two following questions:
What is the purpose of step and time sliders in mayavi2 window? The resulting image of my meshes (including color map and absolute values) doesn't change no matter what value do I set via those sliders. But when I set --step option while running postproc I see different results for different steps.
While I see that stress changes when I increase total time of the modulation, I don't see that mesh deforms. Is it ever possible to do in sfepy to deform mess over time. Or I should deform the mesh each step by myself via displacment vectors.
![](https://secure.gravatar.com/avatar/573ed3088eea742af8bcfeac90bc882d.jpg?s=120&d=mm&r=g)
On 21.4.2017 01:47, fatune@gmail.com wrote:
Thank you for your answer Robert. It works now. It works even when I set --step=2. But now I have two following questions:
- What is the purpose of step and time sliders in mayavi2 window? The resulting image of my meshes (including color map and absolute values) doesn't change no matter what value do I set via those sliders. But when I set --step option while running postproc I see different results for different steps.
The sliders should have the same effect as --step - if not, there is a bug somewhere. What are your sfepy and mayavi versions?
BTW. if you change the
'output_format' : 'h5'
in options to
'output_format' : 'vtk'
the example will create a sequence of VTK files, that you can view in another viewer, like paraview, or the mayavi application.
- While I see that stress changes when I increase total time of the modulation, I don't see that mesh deforms. Is it ever possible to do in sfepy to deform mess over time. Or I should deform the mesh each step by myself via displacment vectors.
Do you mean that for the visualization purposes? If yes, see examples/linear_elasticity/linear_elastic.py - namely the -d option to postproc.py in the docstring - you may want to increase the relative scaling parameter there. Or use the appropriate filter in paraview/mayavi manualy.
r.
![](https://secure.gravatar.com/avatar/ec6a21d58278d578c93c607210be6655.jpg?s=120&d=mm&r=g)
Do you mean that for the visualization purposes?
No. I want to build a simulation of a deformation of a heterogeneous media (i.e. tectonic plate with lineral fault zones ) undergoing deformation for a long period of time. Right now I just trying to understand how to use Sfepy (which seems to be a wonderful tool!). And I don't understand how can I simulate actual deformation of a mesh at each of the steps.
![](https://secure.gravatar.com/avatar/ec6a21d58278d578c93c607210be6655.jpg?s=120&d=mm&r=g)
After looking deep into the example I created my version of minimum workng example of the script script. Here it is:
filename_in = "linear_viscoelastic.py"
conf = ProblemConf.from_file(filename_in)
pb = Problem.from_conf(conf)
time_solver = pb.get_time_solver()
time_solver.init_time()
for out in time_solver():
step, time, state = out
print ("##################")
print("step : %s time : %s " % (step, time))
u = state()
x = pb.get_mesh_coors().T[0]
y = pb.get_mesh_coors().T[1]
z = pb.get_mesh_coors().T[2]
Vx = state.reshape(state.shape[0]/3,3).T[0]
Vy = state.reshape(state.shape[0]/3,3).T[1]
Vz = state.reshape(state.shape[0]/3,3).T[2]
Vx Vy Vz are different at each new step (at least at first few steps). But coordinates of the mesh stays the same. How can I deform the mesh according to Vx Vy Vz? Or it is the wrong way of getting coordinates? ~
![](https://secure.gravatar.com/avatar/573ed3088eea742af8bcfeac90bc882d.jpg?s=120&d=mm&r=g)
On 04/21/2017 01:10 PM, fatune@gmail.com wrote:
After looking deep into the example I created my version of minimum workng example of the script script. Here it is:
filename_in = "linear_viscoelastic.py" conf = ProblemConf.from_file(filename_in) pb = Problem.from_conf(conf) time_solver = pb.get_time_solver() time_solver.init_time() for out in time_solver(): step, time, state = out print ("##################") print("step : %s time : %s " % (step, time)) u = state() x = pb.get_mesh_coors().T[0] y = pb.get_mesh_coors().T[1] z = pb.get_mesh_coors().T[2] Vx = state.reshape(state.shape[0]/3,3).T[0] Vy = state.reshape(state.shape[0]/3,3).T[1] Vz = state.reshape(state.shape[0]/3,3).T[2]
Vx Vy Vz are different at each new step (at least at first few steps). But coordinates of the mesh stays the same. How can I deform the mesh according to Vx Vy Vz? Or it is the wrong way of getting coordinates?
This can be done using the pb.set_mesh_coors(), but what do you want to do next? Maybe send us the equations you want to solve, so that we have a better idea of what to recommend you.
r.
![](https://secure.gravatar.com/avatar/ec6a21d58278d578c93c607210be6655.jpg?s=120&d=mm&r=g)
I want to solve combination of momentum and stokes equations to model visco-elastic deformation. "Viscous" media should undergo viscous deformation, and "non-viscous" media should undergo elastic deformation that recovers when load is "switched off".
Here is the equations that I take from "Introduction to numerical geodynamic modeling" http://imgur.com/a/EUivt
![](https://secure.gravatar.com/avatar/ec6a21d58278d578c93c607210be6655.jpg?s=120&d=mm&r=g)
Robert, I also have a following question. Can I build a model via sfepy that will pass this test:
Thank you
![](https://secure.gravatar.com/avatar/573ed3088eea742af8bcfeac90bc882d.jpg?s=120&d=mm&r=g)
On 22.4.2017 01:49, fatune@gmail.com wrote:
Robert, I also have a following question. Can I build a model via sfepy that will pass this test:
I do not know - the viscous medium behaves like a fluid as it flows around the elastic body - a kind of fluid-structure interaction might be needed.
r.
![](https://secure.gravatar.com/avatar/ec6a21d58278d578c93c607210be6655.jpg?s=120&d=mm&r=g)
So it means NO then. Well, that's disappointing.
Then what _viscoelastic_ means in example of linear_deformation?
![](https://secure.gravatar.com/avatar/573ed3088eea742af8bcfeac90bc882d.jpg?s=120&d=mm&r=g)
On 04/22/2017 10:22 AM, fatune@gmail.com wrote:
So it means NO then. Well, that's disappointing.
Then what _viscoelastic_ means in example of linear_deformation?
It means that the stress depends also on the velocity of the deformation. But the dependence in this example has a "fading memory" (which is finite due to time discretization), that is, after enough time after unloading, the body will recover the initial undeformed state.
r.
![](https://secure.gravatar.com/avatar/573ed3088eea742af8bcfeac90bc882d.jpg?s=120&d=mm&r=g)
On 04/21/2017 07:40 AM, fatune@gmail.com wrote:
Do you mean that for the visualization purposes?
No. I want to build a simulation of a deformation of a heterogeneous media (i.e. tectonic plate with lineral fault zones ) undergoing deformation for a long period of time. Right now I just trying to understand how to use Sfepy (which seems to be a wonderful tool!). And I don't understand how can I simulate actual deformation of a mesh at each of the steps.
You seem to need a large deformation formulation - check the examples in examples/large_deformation/ directory. Specifically, check the examples/large_deformation/hyperelastic_ul.py example, that uses the updated Lagrangian formulation - the mesh is automatically updated in each time step there. If you need to handle the mesh deformation yourself, let us know.
r.
![](https://secure.gravatar.com/avatar/ec6a21d58278d578c93c607210be6655.jpg?s=120&d=mm&r=g)
What if I want to check each step for plastic deformation? For example, I want to check stress on each step and if stress at some parts of the domain is over certain threshold I want to drastically lower viscosity to emulate fracture. Should I do it manually or there is a way to do it via sfepy?
![](https://secure.gravatar.com/avatar/573ed3088eea742af8bcfeac90bc882d.jpg?s=120&d=mm&r=g)
On 04/21/2017 02:23 PM, fatune@gmail.com wrote:
What if I want to check each step for plastic deformation? For example, I want to check stress on each step and if stress at some parts of the domain is over certain threshold I want to drastically lower viscosity to emulate fracture. Should I do it manually or there is a way to do it via sfepy?
OK, check [1] - the stiffness is modified there based on the strain.
For something more advanced, you would need to write your own script, using the interactive commands.
r.
[1] http://sfepy.org/doc-devel/examples/linear_elasticity/material_nonlinearity....
![](https://secure.gravatar.com/avatar/ec6a21d58278d578c93c607210be6655.jpg?s=120&d=mm&r=g)
The hyperelastic_ul.py Looks impressive. But I don't really understand what terms should I use to simulate visco-elastic large deformation.
![](https://secure.gravatar.com/avatar/573ed3088eea742af8bcfeac90bc882d.jpg?s=120&d=mm&r=g)
On 21.4.2017 07:25, Robert Cimrman wrote:
On 21.4.2017 01:47, fatune@gmail.com wrote:
Thank you for your answer Robert. It works now. It works even when I set --step=2. But now I have two following questions:
- What is the purpose of step and time sliders in mayavi2 window? The resulting image of my meshes (including color map and absolute values) doesn't change no matter what value do I set via those sliders. But when I set --step option while running postproc I see different results for different steps.
The sliders should have the same effect as --step - if not, there is a bug somewhere. What are your sfepy and mayavi versions?
FYI: It is a bug, see https://github.com/sfepy/sfepy/issues/394
r.
![](https://secure.gravatar.com/avatar/ec6a21d58278d578c93c607210be6655.jpg?s=120&d=mm&r=g)
Thanks. I tried it on the other PC and postproc.py worked as expected.
![](https://secure.gravatar.com/avatar/ec6a21d58278d578c93c607210be6655.jpg?s=120&d=mm&r=g)
The one that works is 4.1.0. The one that doesn't work as expected is at my work. I can't see the version now.
participants (3)
-
fatune@gmail.com
-
Radko Bankras
-
Robert Cimrman