Thank you Prof. for your reply. I have already attached the code in previous mail. But after reading more about Datapostprocedure class I understood that I can't multiply an array directly to the computed_quantities. I have also checked the attached link. I understand how we can assign material_id when I have a variable (for ex. viscosity ) related to that quantity (for ex. stress).
Here I wanted to ask 2 questions: 1. I have 2 materials in a single domain for which I already defined material_id in triangulation. Now how to call these material_id while calculating strain values? (as material_ids are only related with lambda and mu). 2. I wanted to calculate stress for the same problem which I defined above. I have the following relation but how to write this constitutive matrix (C) while using datapostprocessor class? [image: image.png] Thanks & Regards, Deepika On Tue, Dec 13, 2022 at 5:30 AM Wolfgang Bangerth <[email protected]> wrote: > > > 1. I have created the following geometry using CellData class. Now I > wanted to > > calculate stresses and strains under dirichlet and Neumann boundary > conditions > > for the attached triangulation. > > For strain calculations I have used the DataPostprocedure tensor class, > but my > > problem is how to calculate stress while there are two materials in the > same > > domain? > > I see from your picture that you have already used the material_id to mark > which cells are which. You can access the material_id of the cell you are > currently working on from the DataPostprocessor object: The > DataPostprocessorInputs object you are handed in the evaluate() function > gives > an example of how to do that: > > > https://dealii.org/developer/doxygen/deal.II/structDataPostprocessorInputs_1_1CommonInputs.html > > > > 2. I am also facing difficulty calculating single material, I tried the > > procedure which is mention in documentation that multiply strain with > > stress-strain tensor (considering lambda=1, mu =1), see below > > > > image.png > > > > > > but I am getting the following error: > > > > error: invalid operands of types ‘dealii::Tensor<1, 2>::value_type’ > {aka > > ‘double’} and ‘int [3][3]’ to binary ‘operator*’ > > 68 | = ((input_data.solution_gradients[p][d][e] > > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > 69 | + > > | ~ > > 70 | input_data.solution_gradients[p][e][d]) / 2)*C; > > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ > > Well, what data type do you use for 'C'? The error message says something > about int[3][3], but it's not clear to me what that is. Can you show the > code > you use? > > 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/51e9c05a-78df-628c-d7af-5fcfcbb8d5fd%40colostate.edu > . > -- ************************************************************************** This e-mail is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email is strictly prohibited and appropriate legal action will be taken. ************************************************************************************************ -- 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/CAKTdrpqfJ_bnpb%3DZqE%3DCuUhdyoy6BZchLJBhO8yV%2BtAa_EXTWw%40mail.gmail.com.
