Skip to content

Problems initializing own constitutive model #11560

Answered by matekelemen
scja1991 asked this question in Q&A
Discussion options

You must be logged in to vote

Right, so far so good. However, it's not enough to include the header of your class, you have to define its bindings manually. You can take a look at the rest of add_custom_constitutive_laws_to_python.cpp for examples. You'll probably have to define your bindings like this:

    py::class_<VonMisesLinearElasticSwiftPlasticityModel, VonMisesLinearElasticSwiftPlasticityModel::Pointer, ConsitutiveLaw>(m, "VonMisesLinearElasticSwiftPlasticityModel")
        .def(py::init<>())
        ;

Details

This is just extra info if you want to know more about python bindings - it's not strictly necessary to understand it to solve your problem at hand.

We're using pybind to create python bindings for C++ c…

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@matekelemen
Comment options

Answer selected by scja1991
Comment options

You must be logged in to vote
1 reply
@scja1991
Comment options

Comment options

You must be logged in to vote
2 replies
@scja1991
Comment options

@AlejandroCornejo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants