Error in calculating cauchy stress. Wrong arguments shape

43 views
Skip to first unread message

samyak jain

unread,
Jan 9, 2017, 7:35:58 AM1/9/17
to sfepy-devel
Hi all. I keep getting this error with the latest version of sfepy when I run the following lines. Could you guys please help.

strain = pb.evaluate('ev_cauchy_strain.{dim}.Omega(u)'.format(dim=dims), mode='el_avg')

The above line works fine. 

stress = pb.evaluate('ev_cauchy_stress.3.Omega(m.D, u)', copy_materials=False, mode='el_avg')

but the stress line always shows the error below. m is defined before in the problem with 'D' value.

  File "C:\Python27\lib\site-packages\sfepy\discrete\problem.py", line 1264, in evaluate
sfepy: allowed argument shapes for term "ev_cauchy_stress.3.Omega(m.D, u)":
sfepy: [{'material': 'S, S', 'parameter': 'D'}]
    mode=mode, dw_mode=dw_mode, term_mode=term_mode)
  File "C:\Python27\lib\site-packages\sfepy\discrete\evaluate.py", line 280, in eval_equations
    term_mode=term_mode, asm_obj=asm_obj)
  File "C:\Python27\lib\site-packages\sfepy\discrete\equations.py", line 621, in evaluate
    term_mode=term_mode)
  File "C:\Python27\lib\site-packages\sfepy\discrete\equations.py", line 817, in evaluate
    ret_status=True)
  File "C:\Python27\lib\site-packages\sfepy\terms\terms.py", line 1337, in evaluate
    self.check_shapes(*args)
  File "C:\Python27\lib\site-packages\sfepy\terms\terms.py", line 1215, in check_shapes
    % term_str)
ValueError: wrong arguments shapes for "ev_cauchy_stress.3.Omega(m.D, u)" term! (see above)

Robert Cimrman

unread,
Jan 9, 2017, 8:24:11 AM1/9/17
to sfepy...@googlegroups.com
Hi!

On 01/09/2017 01:27 PM, samyak jain wrote:
> Hi all. I keep getting this error with the latest version of sfepy when I
> run the following lines. Could you guys please help.
>
> strain = pb.evaluate('ev_cauchy_strain.{dim}.Omega(u)'.format(dim=dims), mode='el_avg')

Note that the number after the term name has nothing to do with some dimension
(assuming from your naming) - it is the numerical quadrature order.

> The above line works fine.
>
>
> stress = pb.evaluate('ev_cauchy_stress.3.Omega(m.D, u)', copy_materials=False, mode='el_avg')
>
>
> but the stress line always shows the error below. m is defined before in the problem with 'D' value.

The D shape has to be (6, 6) in 3D or (3, 3) in 2D - can you check that?

r.

samyak jain

unread,
Jan 9, 2017, 8:47:10 AM1/9/17
to sfepy-devel
Hi Robert,

Thanks for your reply. I have checked and it is (3,3). I am calculating D from stiffness_from_youngpoisson.

Thanks 
Samyak

samyak jain

unread,
Jan 9, 2017, 8:50:17 AM1/9/17
to sfepy-devel
Hi Robert,

I did check it again and my mistake was that stiffness_from_youngpoisson with first parameter as 2 and hence (3,3). I have changed it now and it is fine and works perfectly fine.
Thanks a lot.

Samyak

Robert Cimrman

unread,
Jan 9, 2017, 9:04:32 AM1/9/17
to sfepy...@googlegroups.com
OK, glad you solved the problem!

r.
Reply all
Reply to author
Forward
0 new messages