-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔁 Merge branch 'develop' into refactor/serialization
- Loading branch information
Showing
27 changed files
with
1,473 additions
and
624 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef MPM_CONTACT_H_ | ||
#define MPM_CONTACT_H_ | ||
|
||
#include "mesh.h" | ||
|
||
namespace mpm { | ||
|
||
//! Contact class | ||
//! \brief Contact base class | ||
//! \tparam Tdim Dimension | ||
template <unsigned Tdim> | ||
class Contact { | ||
public: | ||
//! Default constructor with mesh class | ||
Contact(const std::shared_ptr<mpm::Mesh<Tdim>>& mesh); | ||
|
||
//! Intialize | ||
virtual inline void initialise(){}; | ||
|
||
//! Compute contact forces | ||
virtual inline void compute_contact_forces(){}; | ||
|
||
protected: | ||
//! Mesh object | ||
std::shared_ptr<mpm::Mesh<Tdim>> mesh_; | ||
}; // Contact class | ||
} // namespace mpm | ||
|
||
#include "contact.tcc" | ||
|
||
#endif // MPM_CONTACT_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//! Constructor of contact with mesh | ||
template <unsigned Tdim> | ||
mpm::Contact<Tdim>::Contact(const std::shared_ptr<mpm::Mesh<Tdim>>& mesh) { | ||
// Assign mesh | ||
mesh_ = mesh; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef MPM_CONTACT_FRICTION_H_ | ||
#define MPM_CONTACT_FRICTION_H_ | ||
|
||
#include "contact.h" | ||
|
||
namespace mpm { | ||
|
||
//! ContactFriction class | ||
//! \brief ContactFriction base class | ||
//! \tparam Tdim Dimension | ||
template <unsigned Tdim> | ||
class ContactFriction : public Contact<Tdim> { | ||
public: | ||
//! Default constructor with mesh class | ||
ContactFriction(const std::shared_ptr<mpm::Mesh<Tdim>>& mesh); | ||
|
||
//! Intialize | ||
virtual inline void initialise() override; | ||
|
||
//! Compute contact forces | ||
virtual inline void compute_contact_forces() override; | ||
|
||
protected: | ||
//! Mesh object | ||
using mpm::Contact<Tdim>::mesh_; | ||
}; // Contactfriction class | ||
} // namespace mpm | ||
|
||
#include "contact_friction.tcc" | ||
|
||
#endif // MPM_CONTACT_FRICTION_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
//! Constructor of contact with mesh | ||
template <unsigned Tdim> | ||
mpm::ContactFriction<Tdim>::ContactFriction( | ||
const std::shared_ptr<mpm::Mesh<Tdim>>& mesh) | ||
: mpm::Contact<Tdim>(mesh) {} | ||
|
||
//! Initialize nodal properties | ||
template <unsigned Tdim> | ||
inline void mpm::ContactFriction<Tdim>::initialise() { | ||
// Initialise nodal properties | ||
mesh_->initialise_nodal_properties(); | ||
|
||
// Append material ids to nodes | ||
mesh_->iterate_over_particles( | ||
std::bind(&mpm::ParticleBase<Tdim>::append_material_id_to_nodes, | ||
std::placeholders::_1)); | ||
} | ||
|
||
//! Compute contact forces | ||
template <unsigned Tdim> | ||
inline void mpm::ContactFriction<Tdim>::compute_contact_forces() { | ||
|
||
// Map multimaterial properties from particles to nodes | ||
mesh_->iterate_over_particles(std::bind( | ||
&mpm::ParticleBase<Tdim>::map_multimaterial_mass_momentum_to_nodes, | ||
std::placeholders::_1)); | ||
|
||
// Map multimaterial displacements from particles to nodes | ||
mesh_->iterate_over_particles(std::bind( | ||
&mpm::ParticleBase<Tdim>::map_multimaterial_displacements_to_nodes, | ||
std::placeholders::_1)); | ||
|
||
// Map multimaterial domain gradients from particles to nodes | ||
mesh_->iterate_over_particles(std::bind( | ||
&mpm::ParticleBase<Tdim>::map_multimaterial_domain_gradients_to_nodes, | ||
std::placeholders::_1)); | ||
|
||
// Compute multimaterial change in momentum | ||
mesh_->iterate_over_nodes( | ||
std::bind(&mpm::NodeBase<Tdim>::compute_multimaterial_change_in_momentum, | ||
std::placeholders::_1)); | ||
|
||
// Compute multimaterial separation vector | ||
mesh_->iterate_over_nodes( | ||
std::bind(&mpm::NodeBase<Tdim>::compute_multimaterial_separation_vector, | ||
std::placeholders::_1)); | ||
|
||
// Compute multimaterial normal unit vector | ||
mesh_->iterate_over_nodes( | ||
std::bind(&mpm::NodeBase<Tdim>::compute_multimaterial_normal_unit_vector, | ||
std::placeholders::_1)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.