LLNL / ExaCMech

BSD 3-Clause "New" or "Revised" License
17 stars 0 forks source link

Python bindings for ECMech #15

Closed rcarson3 closed 3 years ago

rcarson3 commented 3 years ago

I've created an initial set of python bindings that covers most of the material models in the library. These bindings would allow someone to run things like evptn through python with the one difference being that we can make use of solvers from the scipy optimize library instead of SNLS. I found this useful to investigate some models I've been working on and where I needed to explore the effects of different solvers in something other than full blow C++. Since, I found my initial hack together pretty useful I figured I clean it up a bit for other people to make use of.

In order to create the bindings, I make use of pybind11 v2.7.1 which I've included as a new submodule within the library.

I still need to improve on some of the python binding documentation but this should allow people to at least start playing around with things. Also, I could probably expand on the python example and actually make one of the classes in there more flexible, so it's easier to run multiple points at a time.

rcarson3 commented 3 years ago

@nrbertin I added you as a reviewer just to see if there might be anything you might find useful for me to add to these bindings as a user.

rcarson3 commented 3 years ago

@nrbarton and @nrbertin thanks for taking a look over this PR and recommending changes here and there that've improved the new feature.

I'm excited for users to be able to use these as I believe it opens up our library to a broader audience who might not be comfortable playing around in c++ land :)