On 3/2/23 22:57, Deepika Kushwah wrote:

Kindly suggest if there is any other method to calculate avg strain/stress using composite material where the size of elements in matrix and inclusion are different.

DataPostprocessor is the wrong approach to the problem. It is used to generate graphical output, but that is not what you want.

The average strain is

  s_avg = \int_\Omega s(x) dx  /  \int_\Omega 1 dx

where the second integral is simply the volume. You can approximate both integrals by a sum over all cells and then applying quadrature. For example, the first integral is computed via a loop that will look roughly like this:

  double s_integral = 0;
  for (cell=....)
  {
    fe_values.reinit(cell);
    fe_values.get_function_gradients (solution, solution_grads);
    for (q=...)
      s_integral += (compute strain/stress from solution_grads[q]) *
                    fe_values.JxW(q);
  }

The volume of the domain is computed similarly, but you can also use GridTools::volume() for that.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 [email protected]
                           www: http://www.math.colostate.edu/~bangerth/


--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/6e1029dc-cc8f-b8d5-145a-3afa23326eb9%40colostate.edu.

Reply via email to