LLNL / serac

Serac is a high order nonlinear thermomechanical simulation code
BSD 3-Clause "New" or "Revised" License
186 stars 33 forks source link

Write new materials and access them from input files without modifying serac #1045

Open chapman39 opened 11 months ago

chapman39 commented 11 months ago

It would be useful if users could create their own material types and get the benefits of an input deck.

From @samuelpmish https://github.com/LLNL/serac/pull/1001#discussion_r1406723165

For example (although not necessarily a good implementation), instead of a std::variant, we could have a user-extendable std::map<std::string, std::function< ... > > of callbacks. After reading the name of the material model, it would invoke the callback in that std::map (where the user could write code to set up their custom material model, and then register it to the physics module with setMaterial).