Tutorials
Dynamic objects of classes with fixed-size vectorizable Eigen object members

  • Many of the Chrono classes now have members that are fixed-size vecorizable Eigen types. These classes overload their operator new to generate 16-bye-aligned pointers (using an Eigen-provided macro).
  • This takes care of situations where one must dynamically create objects of such classes; for more details, see the Eigen documentation.
  • f you need to create STL containers of such classes, you should use a custom allocator that always allocates aligned memory (such as the Eigen-provided Eigen:aligned_allocator); for more details, see the Eigen documentation.
  • Finally, this requirement for aligned memory allocation has implications on creation of shared pointers. Indeed, std::make_shared uses placement new instead of operator new. To address this issue and preserve encapsulation (as much as possible), Chrono provides custom replacement functions for make_shared, available in the chrono_types namespace. These functions will automatically infer if they can safely fallback on std::make_shared or else create a shared pointer with an alternative mechanism that ensures use of aligned memory.
    As such, user code should always use chrono_types::make_shared as in
    auto my_body = chrono_types::make_shared<ChBody>();

Core module

Optional modules

Other tools

Chrono training materials

Documentation guides

  • Documentation tutorials

    Guidelines on writing technical documentation for Chrono (for developers of new modules/features).