Author Topic: User materials in Python  (Read 138 times)

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1164
User materials in Python
« on: July 12, 2025, 04:51:23 PM »
For those that are interested, I have created a basic example of a user constitutive model that is evaluated in Python.  The connection between FEAP and Python is facilitated using TCP/IP sockets.  The example is very basic, but it should be modestly clear as to how to extend it for more complicated material models.  Please see http://feap.berkeley.edu/wiki/index.php?title=Python_material.

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1164
Re: User materials in Python
« Reply #1 on: July 15, 2025, 04:07:13 PM »
I've slightly updated the code to ensure that the all the sent bytes are getting read on both sides of the socket; i.e. I've implemented a receive all function in both Python and Fortran with error checking.  This makes the codes slightly more robust.  The change is probably unnecessary at the size of messages being sent but this could potentially be an issue if one started to send a lot of data this way.