Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79733570
py_fragment_manager.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Aug 27, 23:38
Size
2 KB
Mime Type
text/x-c
Expires
Thu, Aug 29, 23:38 (2 d)
Engine
blob
Format
Raw Data
Handle
19087193
Attached To
rAKA akantu
py_fragment_manager.cc
View Options
/* -------------------------------------------------------------------------- */
#include "py_aka_array.hh"
#include <fragment_manager.hh>
#include <solid_mechanics_model_cohesive.hh>
/* -------------------------------------------------------------------------- */
#include <pybind11/pybind11.h>
/* -------------------------------------------------------------------------- */
namespace py = pybind11;
/* -------------------------------------------------------------------------- */
namespace akantu {
/* -------------------------------------------------------------------------- */
#define def_deprecated(func_name, mesg) \
def(func_name, [](py::args, py::kwargs) { AKANTU_ERROR(mesg); })
#define def_function_nocopy(func_name) \
def( \
#func_name, \
[](SolidMechanicsModel & self) -> decltype(auto) { \
return self.func_name(); \
}, \
py::return_value_policy::reference)
#define def_function(func_name) \
def(#func_name, [](FragmentManager & self) -> decltype(auto) { \
return self.func_name(); \
})
void register_fragment_manager(py::module & mod) {
py::class_<FragmentManager, GroupManager>(mod, "FragmentManager")
.def(py::init<SolidMechanicsModelCohesive &, bool, const ID &>(),
py::arg("model"), py::arg("dump_data") = true,
py::arg("ID") = "fragment_manager")
.def("buildFragments", &FragmentManager::buildFragments,
py::arg("damage_limit") = 1.)
.def_function(computeCenterOfMass)
.def_function(computeVelocity)
.def_function(computeInertiaMoments)
.def("computeAllData", &FragmentManager::computeAllData,
py::arg("damage_limit") = 1.)
.def_function(computeNbElementsPerFragment)
.def_function(getNbFragment)
.def_function(getMass)
.def_function(getVelocity)
.def_function(getMomentsOfInertia)
.def_function(getPrincipalDirections)
.def_function(getNbElementsPerFragment);
}
} // namespace akantu
Event Timeline
Log In to Comment