There might be many things that can be done to improve the speed of this function. You can ask yourselve the following question as guidance: - Does the function allocate memory? - Could it be inlined? - Are you calling the function inside the DOF loops or inside the quadrature loop?
Then I would time the function to measure if this is actually the real culprit or if it could be something else. If you copy/paste the content of your assembly code and the function, I would be glad to give it a look (and I am sure others here will help you too). On Saturday, January 7, 2023 at 12:02:13 a.m. UTC-5 ce21...@smail.iitm.ac.in wrote: > Sorry for the confusion. I think I made a mistake while writing the first > email. > > H_plus is being called in Assemble_damage and not assemble_elastic. It > uses elastic solution, cell and gauss point to evaluate strain at a gauss > point. Then some quantity is evaluated based on the strain. > > Similarly I have another function damage_gauss which is being called in > assemble_elastic that evaluates damage at a gauss point using the damage > solution, cell and gauss point. > > Wasim Niyaz > Research scholar > CE Dept. > IITM > > On Sat, 7 Jan, 2023, 10:15 am Wasim Niyaz Munshi ce21d400, < > ce21...@smail.iitm.ac.in> wrote: > >> I use it to evaluate strain at Gauss points. Then, i evaluate some >> quantity which is a function of this strain. >> >> Wasim Niyaz >> Research scholar >> CE Dept. >> IITM >> >> On Sat, 7 Jan, 2023, 3:09 am Wolfgang Bangerth, <bang...@colostate.edu> >> wrote: >> >>> On 1/6/23 13:53, Wasim Niyaz Munshi ce21d400 wrote: >>> > I am using 65536 elements. For step-8 the assembly takes very less >>> time >>> > (around 0.15second) while for my assemble_elastic, it takes around 5 >>> seconds. >>> > The only difference between my assemble_elastic function and the >>> assemble >>> > function of step-8 is that for each Gauss point, I additionally call >>> a >>> > function(H_plus) that takes the laplace solution, the current cell and >>> Gauss >>> > point as input and evaluates some quantity using this information. >>> > The H_plus function is called 4*65536 times but the function is very >>> simple. >>> > My doubt is whether such a huge increase in cost (from 0.15 sec to 5 >>> sec) is >>> > expected for this problem or is there something that I am doing that >>> is >>> > increasing the cost so much. >>> >>> Wasim, the question is what you do with "the laplace solution, the >>> current >>> cell and Gauss point". If you show us what H_plus does, we may be able >>> to advise. >>> >>> Best >>> W. >>> >>> -- >>> ------------------------------------------------------------------------ >>> Wolfgang Bangerth email: bang...@colostate.edu >>> 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 a topic in the >>> Google Groups "deal.II User Group" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/dealii/-6ndTW_k5fQ/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> dealii+un...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/dealii/895a079c-2b85-b14f-94ee-b4b78336884d%40colostate.edu >>> . >>> >> -- 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 dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/2684682a-932e-4408-982d-0016d0955296n%40googlegroups.com.