Krishna Kumar, krishnak@utexas.edu
University of Texas at Austin
Kenichi Soga, Shyamini Kularathna, Jeffrey Salmond, Christopher Wilkes, Ezra Tjung, Tianchi Zhao, Thiago Araujo and Wentao Xu.
//! A helper class to register a factory function
//! \tparam Targs variadic template arguments
template <typename Tbaseclass, typename Tderivedclass, typename... Targs>
class Register {
public:
//! Register with a given key
explicit Register(const std::string& key) {
// register the class factory function
Factory<Tbaseclass, Targs...>::instance()
->template register_factory<Tderivedclass>(key);
}
};
// Quadrilateral 4-noded element
static Register<mpm::Element<2>, mpm::QuadrilateralElement<2, 4>>
quad4("ED2Q4");
// Quadrilateral 4-node-base GIMP element
static Register<mpm::Element<2>, mpm::QuadrilateralGIMPElement<2, 16>>
quad_gimp16("ED2Q16G");
// Apply a given functor to all particles making use of tbb::parallel_for_each
// \tparam Toper Type of the particle operation
// \param[in|out] oper Specific operation applied to all particles
template <unsigned Tdim>
template <typename Toper>
void mpm::Mesh<Tdim>::iterate_over_particles(Toper oper) {
tbb::parallel_for_each(particles_.cbegin(), particles_.cend(), oper);
}
// Iterate over particles to compute mass
// Compute mass
mesh_->iterate_over_particles(std::bind(
&mpm::ParticleBase<Tdim>::compute_mass, std::placeholders::_1, phase));
Non-vectorized
Vectorized