Hi Robert,

Thank you for your fixed code.
I tried and checked it worked without error.
But I wonder Mooney-Rivlin is an incompressible material and if both bottom and top fixed in XY plane and compressed in Z direction, the load value would go infinite.
I need to check the relationship between the material parameters and load-displacement.
Thank you anyway.
Best regards,

Takuo Fujita

2018年7月30日(月) 23:01 Robert Cimrman <cimrman3@ntc.zcu.cz>:
Hi,

you have found a bug that occurs in the degenerate case of storing tensors into
a VTK file on a single element. I have tried to fix it - could you try running
your example with the updated code [1]?

r.

[1] https://github.com/rc/sfepy/tree/fix-vtk-write

On 07/28/2018 06:54 AM, pyontaku14 wrote:
> Hi,
>
> I want to change the mesh into one block mesh as below.
>
> mesh = gen_block_mesh([1, 1, 1], [2, 2, 2], [0.5, 0.5, 0.5], name='el3',
>                                    verbose=False)
>
> Then, I encountered the error below.
> The error seems the array size is not match.
> What should I do to address this error?
>
> $python examples/large_deformation/compare_elastic_materials_01.py
> sfepy: left over: ['post_process', 'mesh_hook', 'stiffness_from_lame',
> 'UserMeshIO', 'gen_block_mesh', 'verbose', '_filename']
> sfepy: reading mesh [user] (function:mesh_hook)...
> sfepy: ...done in 0.00 s
> sfepy: creating regions...
> sfepy:     Omega
> sfepy:     Bottom
> sfepy:     Top
> sfepy: ...done in 0.01 s
> sfepy: using solvers:
>                  ts: ts
>                 nls: newton
>                  ls: ls
> sfepy: equation "Mooney-Rivlin":
> sfepy: dw_tl_he_neohook.i.Omega(solid.mu_mr, v, u)
>                             + dw_tl_he_mooney_rivlin.i.Omega(solid.kappa, v,
> u)
>                             + dw_tl_bulk_penalty.i.Omega(solid.K, v, u)
>                             = dw_surface_ltr.isurf.Top(load.val, v)
> sfepy: updating variables...
> sfepy: ...done
> sfepy: setting up dof connectivities...
> sfepy: ...done in 0.00 s
> sfepy: matrix shape: (4, 4)
> sfepy: assembling matrix graph...
> sfepy: ...done in 0.00 s
> sfepy: matrix structural nonzeros: 16 (1.00e+00% fill)
> sfepy: updating materials...
> sfepy:     solid
> sfepy:     load
> sfepy: ...done in 0.00 s
> sfepy: ====== time 0.000000e+00 (step   1 of 101) =====
> sfepy: updating variables...
> sfepy: ...done
> sfepy: updating materials...
> sfepy:     solid
> sfepy:     load
> sfepy: ...done in 0.00 s
> sfepy: initial residual: 0.000000e+00
> Traceback (most recent call last):
>    File "examples/large_deformation/compare_elastic_materials_01.py", line
> 246, in <module>
>      main()
>    File "examples/large_deformation/compare_elastic_materials_01.py", line
> 206, in main
>      u_t = solve_branch(problem, linear_tension)
>    File "examples/large_deformation/compare_elastic_materials_01.py", line
> 170, in solve_branch
>      post_process_hook=problem.conf.post_process)
>    File "./sfepy/discrete/problem.py", line 1383, in solve
>      status=status)
>    File "./sfepy/solvers/ts_solvers.py", line 34, in _standard_ts_call
>      status=status, **kwargs)
>    File "./sfepy/solvers/ts_solvers.py", line 150, in __call__
>      poststep_fun(ts, vec)
>    File "./sfepy/discrete/problem.py", line 1232, in poststep_fun
>      ts=ts)
>    File "./sfepy/discrete/problem.py", line 851, in save_state
>      float_format=self.float_format, **kwargs)
>    File "./sfepy/discrete/fem/mesh.py", line 437, in write
>      io.write(filename, self, out, **kwargs)
>    File "./sfepy/discrete/fem/meshio.py", line 814, in write
>      aux = _reshape_tensors(data, dim, sym, nr)
>    File "./sfepy/discrete/fem/meshio.py", line 658, in _reshape_tensors
>      aux = data[:, [0,3,4,3,1,5,4,5,2]]
> IndexError: too many indices for array
> $
>
>
> 2018年7月23日(月) 23:03 pyontaku14 <pyontaku14@gmail.com>:
>
>> Hi Robert,
>>
>> Thank you for your answer.
>> I obtained cauchy stress and strain.
>> Best regards,
>>
>> Takuo Fujita
>>
>> 2018年7月23日(月) 15:58 Robert Cimrman <cimrman3@ntc.zcu.cz>:
>>
>>> On 07/22/2018 03:41 PM, pyontaku14 wrote:
>>>> Hi,
>>>>
>>>> I tried to output stress and strain of compare_elastic_materials.py.
>>>> I edited the original to the attached.
>>>> But stress and strain did not come out to vtk.
>>>> Is there any way to output stress and strain of
>>>> compare_elastic_materials.py?
>>>
>>> Yes, there is one more thing to do - in solve_branch(), the
>>> post_process()
>>> function nas to be passed to problem.solve() as follows:
>>>
>>>           problem.solve(save_results=True, step_hook=store_top_u(out),
>>>                         post_process_hook=problem.conf.post_process)
>>>
>>> Then post_process() is called in every step, as expected.
>>>
>>> r.
>>>
>>>> Best regards,
>>>>
>>>> Takuo Fujita
>>>>
>>>>
>>>> 2018年6月12日(火) 21:54 藤田 <fujikko@adagio.ocn.ne.jp>:
>>>>
>>>>> Hi Robert,
>>>>>
>>>>> Thank you for your answer.
>>>>> I obtained vtk files.
>>>>> Thank you,
>>>>>
>>>>> Takuo Fujita
>>>>>
>>>>> 2018年6月12日(火) 15:53 Robert Cimrman <cimrman3@ntc.zcu.cz>:
>>>>>
>>>>>> On 06/11/2018 03:51 PM, pyontaku14 . wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> Is there any way to output vtk or h5 of compare_elastic_materials.py?
>>>>>>
>>>>>> Sure, just change "save_results=False" to "save_results=True" in
>>>>>> solve_branch(), line 150. You might also want to change
>>>>>> problem.output_dir to
>>>>>> different names in each run so that the results are not overwritten.
>>>>>>
>>>>>> r.
_______________________________________________
SfePy mailing list -- sfepy@python.org
To unsubscribe send an email to sfepy-leave@python.org
https://mail.python.org/mm3/mailman3/lists/sfepy.python.org/