diff --git a/src/ntn_contact/friction_laws/ntn_friclaw_linear_cohesive_tmpl.hh b/src/ntn_contact/friction_laws/ntn_friclaw_linear_cohesive_tmpl.hh index 3dca6e87d..0b3d51431 100644 --- a/src/ntn_contact/friction_laws/ntn_friclaw_linear_cohesive_tmpl.hh +++ b/src/ntn_contact/friction_laws/ntn_friclaw_linear_cohesive_tmpl.hh @@ -1,170 +1,168 @@ /** * @file ntn_friclaw_linear_cohesive_tmpl.hh * * @author David Simon Kammer * * * @brief implementation of linear cohesive law * * @section LICENSE * * Copyright (©) 2010-2012, 2014 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * */ /* -------------------------------------------------------------------------- */ //#include "dumper_text.hh" __BEGIN_AKANTU__ /* -------------------------------------------------------------------------- */ template NTNFricLawLinearCohesive::NTNFricLawLinearCohesive(NTNBaseContact * contact, const FrictionID & id, const MemoryID & memory_id) : Regularisation(contact,id,memory_id), G_c(0,1,0.,id+":G_c",0.,"G_c"), tau_c(0,1,0.,id+":tau_c",0.,"tau_c"), tau_r(0,1,0.,id+":tau_r",0.,"tau_r") { AKANTU_DEBUG_IN(); Regularisation::registerSynchronizedArray(this->G_c); Regularisation::registerSynchronizedArray(this->tau_c); Regularisation::registerSynchronizedArray(this->tau_r); this->registerParam("G_c", this->G_c, _pat_parsmod, "fracture energy"); this->registerParam("tau_c", this->tau_c, _pat_parsmod, "peak shear strength"); this->registerParam("tau_r", this->tau_r, _pat_parsmod, "residual shear strength"); AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ template void NTNFricLawLinearCohesive::computeFrictionalStrength() { AKANTU_DEBUG_IN(); // get arrays const SynchronizedArray & is_in_contact = this->internalGetIsInContact(); - const SynchronizedArray & slip = this->internalGetSlip(); + //const SynchronizedArray & slip = this->internalGetSlip(); + const SynchronizedArray & slip = this->internalGetCumulativeSlip(); // array to fill SynchronizedArray & strength = this->internalGetFrictionalStrength(); UInt nb_contact_nodes = this->contact->getNbContactNodes(); for (UInt n=0; nG_c(n) == 0.) { // strength(n) = 0.; strength(n) = this->tau_r(n); } else { Real slope = (this->tau_c(n) - this->tau_r(n)) * (this->tau_c(n) - this->tau_r(n)) / (2*this->G_c(n)); // no strength < tau_r strength(n) = std::max(this->tau_c(n) - slope * slip(n), this->tau_r(n)); // strength(n) = std::max(this->tau_c(n) - slope * slip(n), 0.); // no negative strength - - // if we want to keep strength loss after restick, - // we need to do min between new strength and previous strength } } } Regularisation::computeFrictionalStrength(); AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ template void NTNFricLawLinearCohesive::registerSynchronizedArray(SynchronizedArrayBase & array) { AKANTU_DEBUG_IN(); this->G_c.registerDependingArray(array); AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ template void NTNFricLawLinearCohesive::dumpRestart(const std::string & file_name) const { AKANTU_DEBUG_IN(); this->G_c.dumpRestartFile(file_name); this->tau_c.dumpRestartFile(file_name); this->tau_r.dumpRestartFile(file_name); Regularisation::dumpRestart(file_name); AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ template void NTNFricLawLinearCohesive::readRestart(const std::string & file_name) { AKANTU_DEBUG_IN(); this->G_c.readRestartFile(file_name); this->tau_c.readRestartFile(file_name); this->tau_r.readRestartFile(file_name); Regularisation::readRestart(file_name); AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ template void NTNFricLawLinearCohesive::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 << "NTNFricLawLinearCohesive [" << std::endl; Regularisation::printself(stream, ++indent); stream << space << "]" << std::endl; AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ template void NTNFricLawLinearCohesive::addDumpFieldToDumper(const std::string & dumper_name, const std::string & field_id) { AKANTU_DEBUG_IN(); #ifdef AKANTU_USE_IOHELPER // const SynchronizedArray * nodal_filter = &(this->contact->getSlaves()); if(field_id == "G_c") { this->internalAddDumpFieldToDumper(dumper_name, field_id, new dumper::NodalField(this->G_c.getArray())); } else if(field_id == "tau_c") { this->internalAddDumpFieldToDumper(dumper_name, field_id, new dumper::NodalField(this->tau_c.getArray())); } else if(field_id == "tau_r") { this->internalAddDumpFieldToDumper(dumper_name, field_id, new dumper::NodalField(this->tau_r.getArray())); } else { Regularisation::addDumpFieldToDumper(dumper_name, field_id); } #endif AKANTU_DEBUG_OUT(); } __END_AKANTU__