# Segmentation fault while using UMAT in CalculiX

**URL:** <https://calculix.discourse.group/t/segmentation-fault-while-using-umat-in-calculix/611>\
**Category:** Uncategorized\
**Created:** [June 10, 2021, 10:48pm UTC](https://calculix.discourse.group/t/segmentation-fault-while-using-umat-in-calculix/611 "2021-06-10T22:48:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhanups1991](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/bhanups1991/32/287_2.png) [@bhanups1991](https://calculix.discourse.group/u/bhanups1991)\
**Post date:** [June 10, 2021, 10:48pm UTC](https://calculix.discourse.group/t/segmentation-fault-while-using-umat-in-calculix/611/1 "2021-06-10T22:48:55Z")

</div>

Any idea about segmentation fault??

I get this error when I try to run a static analysis. I am using a USER defined UMAT (elasto-plastic). I suspect that the error is because of this UMAT only because without it there’s no segmentation fault whatever.

Just for information, I have taken this UMAT code from ABAQUS documentation (file-name: cylbillet\_slow\_usr\_umat\_umatht.f) so I don’t think there’s any error inside the UMAT code as such. Or maybe it is. Comments??

CalculiX documentation does give some hits on searching ''segmentation fault" but none are linked/related to the use of UMAT (at least that is what I gathered).

Can anyone help?

---

<div class="post-metadata">

**Author:** ![jbr](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@jbr](https://calculix.discourse.group/u/jbr)\
**Post date:** [June 11, 2021, 4:48am UTC](https://calculix.discourse.group/t/segmentation-fault-while-using-umat-in-calculix/611/2 "2021-06-11T04:48:37Z")

</div>

Hi @bhanups1991, this happens when your program breaks some fundamental rule set by the operating system.

Did you use the umat.f as your template? I think that is the correct approach for compatibility with Abaqus UMATs. However, I do recall there are some differences in the names of the variables - this could be part of the issue.

---

<div class="post-metadata">

**Author:** ![bhanups1991](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/bhanups1991/32/287_2.png) [@bhanups1991](https://calculix.discourse.group/u/bhanups1991)\
**Post date:** [June 13, 2021, 7:26am UTC](https://calculix.discourse.group/t/segmentation-fault-while-using-umat-in-calculix/611/3 "2021-06-13T07:26:18Z")

</div>

Thanks.  
Yes, I used the umat.f template file.

Actually, I think the error was because of different measures of strain being used in CalculiX (lagrangian) and ABAQUS (logarithmic).

Earlier I entered my UMAT code inside the umat\_user.f and then compiled ccx which resulted in the error I mentioned.

I’ve now deleted the required UMAT code from umat\_user.f and saved it in a new “my\_mat.f” file which I call via the umat\_abaqus.f. This “umat\_abaqus.f” actually converts the ABAQUS strain/stress measures to CalculiX strain/stress measures which is the reason I am not seeing any segmentation error this time.

Thanks

---

<div class="post-metadata">

**Author:** ![rafal.brzegowy](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rafal.brzegowy](https://calculix.discourse.group/u/rafal.brzegowy)\
**Post date:** [June 13, 2021, 8:27am UTC](https://calculix.discourse.group/t/segmentation-fault-while-using-umat-in-calculix/611/4 "2021-06-13T08:27:02Z")

</div>

Hi, did you see MFRONT?

[http://tfel.sourceforge.net/calculix.html](http://tfel.sourceforge.net/calculix.html)

---

<div class="post-metadata">

**Author:** ![jbr](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@jbr](https://calculix.discourse.group/u/jbr)\
**Post date:** [June 13, 2021, 6:13pm UTC](https://calculix.discourse.group/t/segmentation-fault-while-using-umat-in-calculix/611/5 "2021-06-13T18:13:07Z")

</div>

Hi @bhanups1991, I do recall some differences due to the different strain measures but in my case, it did not go to a segmentation fault, it only gave me the wrong numbers.  
It would be good to find out what happened to see if there is a bug in the code or if it is something else.

---

<div class="post-metadata">

**Author:** ![bhanups1991](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/bhanups1991/32/287_2.png) [@bhanups1991](https://calculix.discourse.group/u/bhanups1991)\
**Post date:** [June 13, 2021, 7:26pm UTC](https://calculix.discourse.group/t/segmentation-fault-while-using-umat-in-calculix/611/6 "2021-06-13T19:26:12Z")

</div>

@rafal.brzegowy  
Thanks for this reminder. I actually had visited this page sometime back but forgot to check it for this particular case.

To be honest, the last time I visited this page, I was kind of confused and reluctant to use this. It is a code generator utility, right?

Anyway, I’ll check this once again, but can we not directly call a UMAT code as I’ve done?

Thanks

---

<div class="post-metadata">

**Author:** ![bhanups1991](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/bhanups1991/32/287_2.png) [@bhanups1991](https://calculix.discourse.group/u/bhanups1991)\
**Post date:** [June 13, 2021, 7:39pm UTC](https://calculix.discourse.group/t/segmentation-fault-while-using-umat-in-calculix/611/7 "2021-06-13T19:39:49Z")

</div>

@jbr  
Yes that could also be a possibility.

Since I am still working on it. Let me get back here if I find something.
