Hello, sfepy group,
I have a question about post-process calculations. For my problem I used
the modified examples linear_elastic.py and hyperelastic.py. After the
calculation of strain and stress tensors I need to get energy of
deformation
\int_{V} S : C,
where C = 2*E+I.
I think I need to calculate the multiplication of tensors first, as some
material variable, and then integrate it.
So I have 2 questions:
1. How can I calculate the double scalar multiplication of two arrays
strain and stress that have shape (number of elements, 1, 6, 1)? (Double
scalar multiplication of A and B is a scalar that can be got as
A_{ij}B_{ji}). Because of the shape of arrays I can't use
numpy.inner(stress,strain). I made some function for these calculation, but
perhaps, the simplier way exsists.
2. Then I get the multiplication - the scalar function of energy I should
integrate it. For this I get the dw_volume_integrate term. I'm trying to
integrate material parameter, where energy has been saved.
solid.update({
'E' : get_W(stress,strain),#energy in elements
})
U = problem.evaluate('dw_volume_integrate.i1.Omega(solid.E, v)',)
Or may be I should use some new variable and initialize it in post-proc.
I'm asking for help in correct formulation of this integral. Should I
define energy as material parameter or some new variable? And how I can do
it.
Thanks in advance,