diff --git a/package.cmake b/package.cmake index a2978794f..df16d4415 100644 --- a/package.cmake +++ b/package.cmake @@ -1,75 +1,77 @@ #=============================================================================== # @file package.cmake # # # # @brief # # @section LICENSE # # Copyright (©) 2010-2012, 2014 EPFL (Ecole Polytechnique Fédérale de Lausanne) # Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) # #=============================================================================== package_declare(traction-at-split-node-contact DESCRIPTION "The super contact of David" DEPENDS iohelper) package_declare_sources(traction-at-split-node-contact common/synchronized_array.cc common/parameter_reader.cc common/manual_restart.cc functions/boundary_functions.cc ntn_contact/ntn_base_contact.cc ntn_contact/ntn_contact.cc ntn_contact/ntrf_contact.cc + ntn_contact/mIIasym_contact.cc ntn_contact/ntn_base_friction.cc ntn_contact/friction_regularisations/ntn_fricreg_no_regularisation.cc ntn_contact/friction_regularisations/ntn_fricreg_rubin_ampuero.cc ntn_contact/friction_regularisations/ntn_fricreg_simplified_prakash_clifton.cc ntn_contact/ntn_initiation_function.cc tasn_contact.hh # headers common/synchronized_array.hh common/parameter_reader.hh common/manual_restart.hh functions/boundary_functions.hh functions/node_filter.hh boundary_conditions/force_based_dirichlet.hh boundary_conditions/spring_bc.hh boundary_conditions/inclined_flat_dirichlet.hh ntn_contact/ntn_base_contact.hh ntn_contact/ntn_contact.hh ntn_contact/ntrf_contact.hh + ntn_contact/mIIasym_contact.hh ntn_contact/ntn_base_friction.hh ntn_contact/friction_regularisations/ntn_fricreg_no_regularisation.hh ntn_contact/friction_regularisations/ntn_fricreg_rubin_ampuero.hh ntn_contact/friction_regularisations/ntn_fricreg_simplified_prakash_clifton.hh ntn_contact/friction_laws/ntn_friclaw_coulomb.hh ntn_contact/friction_laws/ntn_friclaw_coulomb_tmpl.hh ntn_contact/friction_laws/ntn_friclaw_linear_slip_weakening.hh ntn_contact/friction_laws/ntn_friclaw_linear_slip_weakening_tmpl.hh ntn_contact/friction_laws/ntn_friclaw_linear_cohesive.hh ntn_contact/friction_laws/ntn_friclaw_linear_cohesive_tmpl.hh ntn_contact/ntn_friction.hh ntn_contact/ntn_friction_tmpl.hh ntn_contact/ntrf_friction.hh ntn_contact/ntrf_friction_tmpl.hh ntn_contact/ntn_initiation_function.hh # inlines common/synchronized_array_inline_impl.cc ntn_contact/ntn_base_contact_inline_impl.cc ) diff --git a/src/ntn_contact/mIIasym_contact.cc b/src/ntn_contact/mIIasym_contact.cc new file mode 100644 index 000000000..30b85a21f --- /dev/null +++ b/src/ntn_contact/mIIasym_contact.cc @@ -0,0 +1,66 @@ +/** + * @file mIIasym_contact.cc + * + * @author David Simon Kammer + * + * + * @brief + * + * @section LICENSE + * + * Copyright (©) 2010-2012, 2014 EPFL (Ecole Polytechnique Fédérale de Lausanne) + * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) + * + */ + +/* -------------------------------------------------------------------------- */ +// simtools +#include "mIIasym_contact.hh" + +__BEGIN_AKANTU__ + +/* -------------------------------------------------------------------------- */ +MIIASYMContact::MIIASYMContact(SolidMechanicsModel & model, + const ContactID & id, + const MemoryID & memory_id) : + NTRFContact(model,id,memory_id) +{ + AKANTU_DEBUG_IN(); + + AKANTU_DEBUG_OUT(); +} + +/* -------------------------------------------------------------------------- */ +void MIIASYMContact::computeRelativeTangentialField(const Array & field, + Array & rel_tang_field) const { + AKANTU_DEBUG_IN(); + + NTRFContact::computeRelativeTangentialField(field, rel_tang_field); + + UInt dim = this->model.getSpatialDimension(); + + for (Array::iterator< Vector > it_rtfield = rel_tang_field.begin(dim); + it_rtfield != rel_tang_field.end(dim); + ++it_rtfield) { + + // in the anti-symmetric case, the tangential fields become twice as large + *it_rtfield *= 2.; + } + + AKANTU_DEBUG_OUT(); +} + +/* -------------------------------------------------------------------------- */ +void MIIASYMContact::printself(std::ostream & stream, int indent) const { + AKANTU_DEBUG_IN(); + std::string space; + for(Int i = 0; i < indent; i++, space += AKANTU_INDENT); + + stream << space << "MIIASYMContact [" << std::endl; + NTRFContact::printself(stream,indent); + stream << space << "]" << std::endl; + + AKANTU_DEBUG_OUT(); +} + +__END_AKANTU__ diff --git a/src/ntn_contact/mIIasym_contact.hh b/src/ntn_contact/mIIasym_contact.hh new file mode 100644 index 000000000..b0bc69dac --- /dev/null +++ b/src/ntn_contact/mIIasym_contact.hh @@ -0,0 +1,62 @@ +/** + * @file mIIasym_contact.hh + * + * @author David Simon Kammer + * + * + * @brief contact for mode II anti-symmetric simulations + * + * @section LICENSE + * + * Copyright (©) 2010-2012, 2014 EPFL (Ecole Polytechnique Fédérale de Lausanne) + * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) + * + */ + +/* -------------------------------------------------------------------------- */ + +#ifndef __AST_MIIASYM_CONTACT_HH__ +#define __AST_MIIASYM_CONTACT_HH__ + +/* -------------------------------------------------------------------------- */ +// simtools +#include "ntrf_contact.hh" + +__BEGIN_AKANTU__ + +/* -------------------------------------------------------------------------- */ +class MIIASYMContact : public NTRFContact { + /* ------------------------------------------------------------------------ */ + /* Constructors/Destructors */ + /* ------------------------------------------------------------------------ */ +public: + + MIIASYMContact(SolidMechanicsModel & model, + const ContactID & id = "contact", + const MemoryID & memory_id = 0); + virtual ~MIIASYMContact() {}; + + /* ------------------------------------------------------------------------ */ + /* Methods */ + /* ------------------------------------------------------------------------ */ +public: + /// compute relative tangential field (complet array) + /// relative to master nodes + virtual void computeRelativeTangentialField(const Array & field, + Array & rel_tang_field) const; + + /// function to print the contain of the class + virtual void printself(std::ostream & stream, int indent = 0) const; + +}; + +/// standard output stream operator +inline std::ostream & operator <<(std::ostream & stream, const MIIASYMContact & _this) +{ + _this.printself(stream); + return stream; +} + +__END_AKANTU__ + +#endif /* __AST_MIIASYM_CONTACT_HH__ */ diff --git a/src/ntn_contact/ntn_initiation_function.cc b/src/ntn_contact/ntn_initiation_function.cc index ba7d9302d..a49a05c82 100644 --- a/src/ntn_contact/ntn_initiation_function.cc +++ b/src/ntn_contact/ntn_initiation_function.cc @@ -1,320 +1,323 @@ /** * @file ntn_initiation_function.cc * * @author David Simon Kammer * * * @brief implementation of initializing ntn and ntrf friction * * @section LICENSE * * Copyright (©) 2010-2012, 2014 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * */ /* -------------------------------------------------------------------------- */ // simtools +#include "mIIasym_contact.hh" #include "ntn_initiation_function.hh" #include "ntn_friction.hh" #include "ntrf_friction.hh" // friction regularisations #include "ntn_fricreg_rubin_ampuero.hh" #include "ntn_fricreg_simplified_prakash_clifton.hh" // friction laws #include "ntn_friclaw_linear_cohesive.hh" #include "ntn_friclaw_linear_slip_weakening.hh" __BEGIN_AKANTU__ NTNBaseFriction * initializeNTNFriction(NTNBaseContact * contact, ParameterReader & data) { AKANTU_DEBUG_IN(); const std::string & friction_law = data.get("friction_law"); const std::string & friction_reg = data.get("friction_regularisation"); NTNBaseFriction * friction; bool is_ntn_contact = true; - if (dynamic_cast(contact) != NULL) { + if (dynamic_cast(contact) != NULL || + dynamic_cast(contact) != NULL) { is_ntn_contact = false; } if (friction_law == "coulomb") { if (friction_reg == "no_regularisation") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); } else if (friction_reg == "rubin_ampuero") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); friction->setMixed< SynchronizedArray >("t_star", data.get("t_star")); } else if (friction_reg == "simplified_prakash_clifton") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); friction->setMixed< SynchronizedArray >("t_star", data.get("t_star")); } else { AKANTU_DEBUG_ERROR("Do not know the following friction regularisation: " << friction_reg); } friction->setMixed< SynchronizedArray >("mu_s", data.get("mu_s")); } // Friction Law: Linear Slip Weakening else if (friction_law == "linear_slip_weakening") { if (friction_reg == "no_regularisation") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); } else if (friction_reg == "rubin_ampuero") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); friction->setMixed< SynchronizedArray >("t_star", data.get("t_star")); } else if (friction_reg == "simplified_prakash_clifton") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); friction->setMixed< SynchronizedArray >("t_star", data.get("t_star")); } else { AKANTU_DEBUG_ERROR("Do not know the following friction regularisation: " << friction_reg); } friction->setMixed< SynchronizedArray >("mu_s", data.get("mu_s")); friction->setMixed< SynchronizedArray >("mu_k", data.get("mu_k")); friction->setMixed< SynchronizedArray >("d_c", data.get("d_c")); } // Friction Law: Linear Cohesive else if (friction_law == "linear_cohesive") { if (friction_reg == "no_regularisation") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); } else if (friction_reg == "rubin_ampuero") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); friction->setMixed< SynchronizedArray >("t_star", data.get("t_star")); } else if (friction_reg == "simplified_prakash_clifton") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); friction->setMixed< SynchronizedArray >("t_star", data.get("t_star")); } else { AKANTU_DEBUG_ERROR("Do not know the following friction regularisation: " << friction_reg); } friction->setMixed< SynchronizedArray >("G_c", data.get("G_c")); friction->setMixed< SynchronizedArray >("tau_c", data.get("tau_c")); friction->setMixed< SynchronizedArray >("tau_r", data.get("tau_r")); } else { AKANTU_DEBUG_ERROR("Do not know the following friction law: " << friction_law); } AKANTU_DEBUG_OUT(); return friction; } /* -------------------------------------------------------------------------- */ NTNBaseFriction * initializeNTNFriction(NTNBaseContact * contact) { AKANTU_DEBUG_IN(); std::pair sub_sect = getStaticParser().getSubSections(_st_friction); Parser::const_section_iterator it = sub_sect.first; const ParserSection & section = *it; std::string friction_law = section.getName(); std::string friction_reg = section.getOption(); if (friction_reg == "") { std::string friction_reg = "no_regularisation"; } NTNBaseFriction * friction = initializeNTNFriction(contact, friction_law, friction_reg); friction->parseSection(section); if (++it != sub_sect.second) { AKANTU_DEBUG_WARNING("There were several friction sections in input file. " << "Only first one was used and all others ignored."); } AKANTU_DEBUG_OUT(); return friction; } /* -------------------------------------------------------------------------- */ NTNBaseFriction * initializeNTNFriction(NTNBaseContact * contact, const std::string & friction_law, const std::string & friction_reg) { AKANTU_DEBUG_IN(); NTNBaseFriction * friction; - // check whether is is node-to-rigid-flat contact + // check whether is is node-to-rigid-flat contact or mIIasym (which is also ntrf) bool is_ntn_contact = true; - if (dynamic_cast(contact) != NULL) { + if (dynamic_cast(contact) != NULL || + dynamic_cast(contact) != NULL) { is_ntn_contact = false; } if (friction_law == "coulomb") { if (friction_reg == "no_regularisation") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); } else if (friction_reg == "rubin_ampuero") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); } else if (friction_reg == "simplified_prakash_clifton") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); } else { AKANTU_DEBUG_ERROR("Do not know the following friction regularisation: " << friction_reg); } } // Friction Law: Linear Slip Weakening else if (friction_law == "linear_slip_weakening") { if (friction_reg == "no_regularisation") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); } else if (friction_reg == "rubin_ampuero") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); } else if (friction_reg == "simplified_prakash_clifton") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); } else { AKANTU_DEBUG_ERROR("Do not know the following friction regularisation: " << friction_reg); } } // Friction Law: Linear Cohesive else if (friction_law == "linear_cohesive") { if (friction_reg == "no_regularisation") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); } else if (friction_reg == "rubin_ampuero") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); } else if (friction_reg == "simplified_prakash_clifton") { if (is_ntn_contact) friction = new NTNFriction(contact); else friction = new NTRFFriction(contact); } else { AKANTU_DEBUG_ERROR("Do not know the following friction regularisation: " << friction_reg); } } else { AKANTU_DEBUG_ERROR("Do not know the following friction law: " << friction_law); } AKANTU_DEBUG_OUT(); return friction; } __END_AKANTU__ diff --git a/src/tasn_contact.hh b/src/tasn_contact.hh index 01241e9db..030292455 100644 --- a/src/tasn_contact.hh +++ b/src/tasn_contact.hh @@ -1,59 +1,60 @@ /** * @file akantu_simtools.hh * * * * @brief * * @section LICENSE * * Copyright (©) 2010-2012, 2014 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * */ // ast common #include "synchronized_array.hh" #include "parameter_reader.hh" #include "manual_restart.hh" // functions #include "boundary_functions.hh" #include "node_filter.hh" // boundary conditions #include "force_based_dirichlet.hh" #include "spring_bc.hh" #include "inclined_flat_dirichlet.hh" // ntn/ntrf contact #include "ntn_base_contact.hh" #include "ntn_contact.hh" #include "ntrf_contact.hh" +#include "mIIasym_contact.hh" // ntn/ntrf friction #include "ntn_base_friction.hh" #include "ntn_friction.hh" #include "ntrf_friction.hh" // friction regularisations #include "ntn_fricreg_no_regularisation.hh" #include "ntn_fricreg_rubin_ampuero.hh" #include "ntn_fricreg_simplified_prakash_clifton.hh" // friction laws #include "ntn_friclaw_coulomb.hh" #include "ntn_friclaw_linear_slip_weakening.hh" #include "ntn_friclaw_linear_cohesive.hh" // initiation of friction #include "ntn_initiation_function.hh" /* #include "ntn_friction_coulomb.hh" #include "ntn_friction_linear_slip_weakening.hh" #include "ntrf_friction_coulomb.hh" #include "ntrf_friction_regularized_coulomb.hh" #include "ntrf_friction_linear_slip_weakening.hh" #include "ntrf_friction_mathilde.hh" */