diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bd339343..1a66cbe2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,372 +1,373 @@ #=============================================================================== # @file CMakeLists.txt # @author Nicolas Richart # @date Fri Jun 11 09:46:59 2010 # # @section LICENSE # # Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) # Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) # # Akantu is free software: you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) any # later version. # # Akantu is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License # along with Akantu. If not, see . # # @section DESCRIPTION # #=============================================================================== #=============================================================================== # _ ,-, _ # ,--, /: :\/': :`\/: :\ # |`; ' `,' `.; `: | _ _ # | | | ' | |. | | | | # | : | F E | A S | T++ || __ _| | ____ _ _ __ | |_ _ _ # | :. | : | : | : | \ / _` | |/ / _` | '_ \| __| | | | # \__/: :.. : :.. | :.. | ) | (_| | < (_| | | | | |_| |_| | # `---',\___/,\___/ /' \__,_|_|\_\__,_|_| |_|\__|\__,_| # `==._ .. . /' # `-::-' #=============================================================================== #=============================================================================== # CMake Project #=============================================================================== cmake_minimum_required(VERSION 2.6) project(AKANTU) enable_language(CXX) #=============================================================================== # Misc. #=============================================================================== set(AKANTU_CMAKE_DIR "${AKANTU_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries.") INCLUDE(${AKANTU_CMAKE_DIR}/AkantuMacros.cmake) #=============================================================================== # Version Number #=============================================================================== # AKANTU version number. An even minor number corresponds to releases. set(AKANTU_MAJOR_VERSION 0) set(AKANTU_MINOR_VERSION 1) set(AKANTU_BUILD_VERSION 0) set(AKANTU_VERSION "${AKANTU_MAJOR_VERSION}.${AKANTU_MINOR_VERSION}.${AKANTU_BUILD_VERSION}" ) # Append the library version information to the library target properties if(NOT AKANTU_NO_LIBRARY_VERSION) set(AKANTU_LIBRARY_PROPERTIES ${AKANTU_LIBRARY_PROPERTIES} VERSION "${AKANTU_VERSION}" SOVERSION "${AKANTU_MAJOR_VERSION}.${AKANTU_MINOR_VERSION}" ) endif(NOT AKANTU_NO_LIBRARY_VERSION) #=============================================================================== # Options #=============================================================================== option(AKANTU_DEBUG "Compiles akantu with the debug messages" ON) option(AKANTU_DOCUMENTATION "Build source documentation using Doxygen." OFF) # compilation switch option(AKANTU_BUILD_CONTACT "Build the contact algorithm" OFF) option(AKANTU_BUILD_HEAT_TRANSFER "Build the heat transfer model" OFF) option(AKANTU_BUILD_STRUCTURAL_MECHANICS "Build the structural mechanics model" OFF) # features add_optional_package(IOHelper "Add IOHelper support in akantu" OFF) add_optional_package(QVIEW "Add QView support in akantu" OFF) add_optional_package(MPI "Add MPI support in akantu" OFF) add_optional_package(Mumps "Add Mumps support in akantu" OFF) add_optional_package(PTScotch "Add PTScotch support in akantu" OFF) add_optional_package(Scotch "Add Scotch support in akantu" OFF) add_optional_package(BLAS "Use BLAS for arithmetic operations" OFF) add_optional_package(EPSN "Use EPSN streering environment" OFF) if(AKANTU_SCOTCH_ON OR AKANTU_PTSCOTCH_ON) set(AKANTU_PARTITIONER_ON ON) else() set(AKANTU_PARTITIONER_ON OFF) endif() if(AKANTU_PTSCOTCH_ON) add_definitions(-DAKANTU_USE_${_u_package}) endif() # Debug if(NOT AKANTU_DEBUG) add_definitions(-DAKANTU_NDEBUG) endif(NOT AKANTU_DEBUG) #=========================================================================== # Dependencies #=========================================================================== find_package(Boost REQUIRED) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) endif() #check_for_isnan(AKANTU_ISNAN) #message("ISNAN = "${AKANTU_ISNAN}) #=============================================================================== # Library #=============================================================================== set(AKANTU_COMMON_SRC common/aka_common.cc common/aka_error.cc common/aka_extern.cc common/aka_static_memory.cc common/aka_memory.cc common/aka_vector.cc common/aka_math.cc fem/shape_lagrange.cc fem/shape_linked.cc fem/integrator_gauss.cc fem/mesh.cc fem/fem.cc fem/element_class.cc fem/fem_template.cc model/model.cc model/solid_mechanics/solid_mechanics_model.cc model/solid_mechanics/solid_mechanics_model_mass.cc model/solid_mechanics/solid_mechanics_model_boundary.cc model/solid_mechanics/solid_mechanics_model_material.cc model/solid_mechanics/material.cc model/solid_mechanics/materials/material_non_local.cc model/solid_mechanics/materials/material_elastic.cc model/solid_mechanics/materials/material_elastic_caughey.cc model/solid_mechanics/materials/material_damage.cc model/solid_mechanics/materials/material_mazars.cc model/solid_mechanics/materials/material_neohookean.cc model/solid_mechanics/materials/material_damage_non_local.cc model/solid_mechanics/materials/material_mazars_non_local.cc model/solid_mechanics/materials/material_damage_linear.cc mesh_utils/mesh_io.cc mesh_utils/mesh_pbc.cc mesh_utils/mesh_io/mesh_io_msh.cc mesh_utils/mesh_io/mesh_io_msh_struct.cc mesh_utils/mesh_io/mesh_io_diana.cc mesh_utils/mesh_partition.cc mesh_utils/mesh_utils.cc solver/sparse_matrix.cc solver/solver.cc synchronizer/synchronizer_registry.cc synchronizer/synchronizer.cc synchronizer/distributed_synchronizer.cc synchronizer/pbc_synchronizer.cc synchronizer/data_accessor.cc synchronizer/static_communicator.cc # synchronizer/grid_synchronizer.cc synchronizer/dof_synchronizer.cc ) set(AKANTU_CONTACT_SRC model/solid_mechanics/contact.cc model/solid_mechanics/contact_search.cc model/solid_mechanics/contact_neighbor_structure.cc model/solid_mechanics/contact/contact_2d_explicit.cc model/solid_mechanics/contact/contact_search_2d_explicit.cc model/solid_mechanics/contact/regular_grid_neighbor_structure.cc model/solid_mechanics/contact/contact_search_explicit.cc model/solid_mechanics/contact/contact_3d_explicit.cc model/solid_mechanics/contact/grid_2d_neighbor_structure.cc model/solid_mechanics/contact/contact_rigid.cc model/solid_mechanics/contact/friction_coefficient.cc model/solid_mechanics/contact/friction_coefficient/unique_constant_fric_coef.cc model/solid_mechanics/contact/friction_coefficient/velocity_weakening_coulomb.cc model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef.cc model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential.cc + model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano.cc model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano_modified.cc model/solid_mechanics/contact/friction_coefficient/simplified_dieterich_fric_coef.cc model/solid_mechanics/contact/friction_coefficient/simplified_dieterich_fric_coef/ruina_slowness_fric_coef.cc - #model/solid_mechanics/contact/friction_coefficient/historic_velocity_fric_coef.cc + model/solid_mechanics/contact/friction_coefficient/historic_velocity_fric_coef.cc ) if(AKANTU_BUILD_CONTACT) set(AKANTU_COMMON_SRC ${AKANTU_COMMON_SRC} ${AKANTU_CONTACT_SRC}) endif() set(AKANTU_STRUCTURAL_MECHANICS_SRC model/structural_mechanics/structural_mechanics_model.cc model/structural_mechanics/structural_mechanics_model_boundary.cc ) if(AKANTU_BUILD_STRUCTURAL_MECHANICS) set(AKANTU_COMMON_SRC ${AKANTU_COMMON_SRC} ${AKANTU_STRUCTURAL_MECHANICS_SRC}) endif() set(AKANTU_HEAT_TRANSFER_SRC model/heat_transfer/heat_transfer_model.cc ) if(AKANTU_BUILD_HEAT_TRANSFER) set(AKANTU_COMMON_SRC ${AKANTU_COMMON_SRC} ${AKANTU_HEAT_TRANSFER_SRC}) endif() if(AKANTU_MPI_ON) set(AKANTU_COMMON_SRC ${AKANTU_COMMON_SRC} synchronizer/static_communicator_mpi.cc ) endif() if(AKANTU_SCOTCH_ON OR AKANTU_PTSCOTCH_ON) set(AKANTU_COMMON_SRC ${AKANTU_COMMON_SRC} mesh_utils/mesh_partition/mesh_partition_scotch.cc ) endif() if(AKANTU_MUMPS_ON) set(AKANTU_COMMON_SRC ${AKANTU_COMMON_SRC} solver/solver_mumps.cc ) endif() set(AKANTU_INCLUDE_DIRS common fem/ mesh_utils/ mesh_utils/mesh_io/ mesh_utils/mesh_partition/ model/ model/integration_scheme model/solid_mechanics model/solid_mechanics/materials model/solid_mechanics/contact model/solid_mechanics/contact/friction_coefficient model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef model/solid_mechanics/contact/friction_coefficient/simplified_dieterich_fric_coef model/heat_transfer model/structural_mechanics synchronizer/ solver/ ) set(AKANTU_COMMON_HDR_TO_PRECOMPILE common/aka_vector.hh common/aka_math.hh common/aka_types.hh fem/by_element_type.hh fem/element_class.hh ) set(AKANTU_PRECOMPILE_HDR_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/common/ ${CMAKE_BINARY_DIR}/fem/ ) include_directories( ${AKANTU_INCLUDE_DIRS} ${AKANTU_PRECOMPILE_HDR_INCLUDE_DIRS} ${AKANTU_EXTERNAL_LIB_INCLUDE_PATH} ) if(CMAKE_COMPILER_IS_GNUCXX) include(cmake/PCHgcc.cmake) foreach(_header ${AKANTU_COMMON_HDR_TO_PRECOMPILE}) add_pch_rule(${_header} AKANTU_COMMON_SRC) endforeach() endif() add_library(akantu ${AKANTU_COMMON_SRC}) set_target_properties(akantu PROPERTIES ${AKANTU_LIBRARY_PROPERTIES}) #include(cmake/PCHSupport.cmake) #if(PCHSupport_FOUND) # foreach(_header ${AKANTU_COMMON_HDR_TO_PRECOMPILE}) # add_precompiled_header(akantu ${_header}) # endforeach() #endif() #=========================================================================== # Documentation #=========================================================================== if(AKANTU_DOCUMENTATION) find_package(Doxygen REQUIRED) if(DOXYGEN_FOUND) set(DOXYGEN_WARNINGS NO) set(DOXYGEN_QUIET YES) if(CMAKE_VERBOSE_MAKEFILE) set(DOXYGEN_WARNINGS YES) set(DOXYGEN_QUIET NO) endif(CMAKE_VERBOSE_MAKEFILE) add_subdirectory(doc/doxygen) endif(DOXYGEN_FOUND) endif(AKANTU_DOCUMENTATION) #=============================================================================== # Tests #=============================================================================== ENABLE_TESTING() INCLUDE(CTest) INCLUDE(${AKANTU_CMAKE_DIR}/AkantuTestAndExamples.cmake) option(AKANTU_TESTS "Activate tests" OFF) if(AKANTU_TESTS) find_package(GMSH REQUIRED) add_subdirectory(test) endif(AKANTU_TESTS) #=============================================================================== # Examples #=============================================================================== option(AKANTU_EXAMPLES "Activate examples" OFF) if(AKANTU_EXAMPLES) find_package(GMSH REQUIRED) add_subdirectory(examples) endif(AKANTU_EXAMPLES) #=============================================================================== # Install rules #=============================================================================== install(TARGETS akantu LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) file(GLOB_RECURSE include_file_list "${CMAKE_SOURCE_DIR}/*.hh") file(GLOB_RECURSE inline_include_file_list "${CMAKE_SOURCE_DIR}/*inline*.cc") file(GLOB_RECURSE element_class_include_file_list "${CMAKE_SOURCE_DIR}/*element_class_*.cc") install(FILES ${include_file_list} ${inline_include_file_list} ${element_class_include_file_list} DESTINATION include ) diff --git a/model/solid_mechanics/contact/friction_coefficient/historic_velocity_fric_coef.cc b/model/solid_mechanics/contact/friction_coefficient/historic_velocity_fric_coef.cc new file mode 100644 index 000000000..a539fc521 --- /dev/null +++ b/model/solid_mechanics/contact/friction_coefficient/historic_velocity_fric_coef.cc @@ -0,0 +1,327 @@ +/** + * @file historic_velocity_fric_coef.cc + * @author David Kammer + * @date Tue Nov 1 14:34:01 2011 + * + * @brief implementation of historic velocity dependent friction coefficient + * + * @section LICENSE + * + * Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) + * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) + * + * Akantu is free software: you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) any + * later version. + * + * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Akantu. If not, see . + * + */ + +/* -------------------------------------------------------------------------- */ +#include "historic_velocity_fric_coef.hh" + +/* -------------------------------------------------------------------------- */ + +__BEGIN_AKANTU__ + +/* -------------------------------------------------------------------------- */ +HistoricVelocityFricCoef::HistoricVelocityFricCoef(ContactRigid & contact, + const Surface & master_surface, + const Real beta) : + FrictionCoefficient(contact, master_surface), + spatial_dimension(contact.getSpatialDimension()), + beta(beta), + nodes(0,1), + active(0,1), + contact_time(0,1) { + AKANTU_DEBUG_IN(); + + // compute time range of history + Real tolerance_epsilon = 1e-5; + Real total_time = log(1/tolerance_epsilon) / beta; + Real time_step = this->contact.getModel().getTimeStep(); + UInt nb_time_steps = (UInt)ceil(total_time / time_step) + 1; + + std::cout << " * Historic Velocity Friction Coefficient: total history time = " << total_time << " with numbers of time steps = " << nb_time_steps << std::endl; + + // declare vector + this->weights = new Vector(nb_time_steps,1); + this->historic_velocities = new CircularVector< Vector * >(nb_time_steps, 1); + + // fill the weights vector + Real time = 0.; + for (Int i=nb_time_steps-1; i>=0; --i) { + (*weights)(i) = exp(-beta*time); + time += time_step; + } + + this->generalized_sliding_velocities = new Vector(0,1); + this->node_stick_status = new Vector(0,1); + + AKANTU_DEBUG_OUT(); +} + +/* -------------------------------------------------------------------------- */ +HistoricVelocityFricCoef::HistoricVelocityFricCoef(ContactRigid & contact, + const Surface & master_surface) : + FrictionCoefficient(contact, master_surface), + spatial_dimension(contact.getSpatialDimension()), + beta(1.), + nodes(0,1), + active(0,1), + contact_time(0,1) { + AKANTU_DEBUG_IN(); + + std::cout << " * Historic Velocity Friction Coefficient: not used, only inherited from." << std::endl; + + // declare vector + this->weights = new Vector(0,1); + this->historic_velocities = new CircularVector< Vector * >(0, 1); + this->generalized_sliding_velocities = new Vector(0,1); + this->node_stick_status = new Vector(0,1); + + AKANTU_DEBUG_OUT(); +} + +/* -------------------------------------------------------------------------- */ +HistoricVelocityFricCoef::~HistoricVelocityFricCoef() { + AKANTU_DEBUG_IN(); + + delete this->weights; + + for (UInt i=0; igetSize(); ++i) + delete ((*historic_velocities)(i)); + delete this->historic_velocities; + + delete this->generalized_sliding_velocities; + delete this->node_stick_status; + + AKANTU_DEBUG_OUT(); +} + +/* -------------------------------------------------------------------------- */ +void HistoricVelocityFricCoef::initializeComputeFricCoef() { + AKANTU_DEBUG_IN(); + + /* + Find if more nodes have to be considered + */ + + // get access to impactors information + const ContactRigid::SurfaceToImpactInfoMap & imp_info = this->contact.getImpactorsInformation(); + ContactRigid::SurfaceToImpactInfoMap::const_iterator it; + + it = imp_info.find(this->master_surface); + AKANTU_DEBUG_ASSERT(it != imp_info.end(), + "Couldn't find impactor information object for master surface " << master_surface); + ContactRigid::ImpactorInformationPerMaster * impactor_info = it->second; + Vector * active_nodes = impactor_info->active_impactor_nodes; + UInt nb_active_nodes = active_nodes->getSize(); + + Real time_step = this->contact.getModel().getTimeStep(); + + // check if in nodes vector. if no, put it. + this->active.clear(); + for (UInt i=0; inodes.find(node); + if (pos == -1) { + nodes.push_back(node); + active.push_back(true); + contact_time.push_back(0.); + } + else { + active(pos) = true; + contact_time(pos) += time_step; + } + } + UInt nb_nodes = this->nodes.getSize(); + + // resize the vectors in the historic velocities + UInt nb_historic_velocities = this->historic_velocities->getSize(); + for (UInt i=0; i * historic_velocity = (*historic_velocities)(i); + if (historic_velocity != NULL) { + historic_velocity->resize(nb_nodes); // the new values are initialized to zero + } + } + + /* + find the velocities of this time step and put in vector + */ + + // advance circular vector and access the velocities + historic_velocities->makeStep(); + if ((*historic_velocities)(nb_historic_velocities-1) == NULL) + (*historic_velocities)(nb_historic_velocities-1) = new Vector(nb_nodes,1); + else { + (*historic_velocities)(nb_historic_velocities-1)->clear(); + } + Vector * current_velocities = (*historic_velocities)(nb_historic_velocities-1); + Real * velocity_val = this->contact.getModel().getVelocity().values; + + // access the master normals + Vector * master_normals = impactor_info->master_normals; + Real * master_normals_val = master_normals->values; + + // norms for each point + Vector norms(nb_nodes,1); + + // loop over all nodes in here + for(UInt n = 0; n < nb_nodes; ++n) { + // if node is not active set velocity to zero + if (!active(n)) { + (*current_velocities)(n) = 0.; + contact_time(n) = 0.; // put contact_time to zero for non active nodes + } + + // OTHERWISE ... + else { + + // ... COMPUTE TANGENTIAL + UInt impactor = nodes(n); + + // get indexes in the vectors + UInt master_normal_index = active_nodes->find(impactor) * this->spatial_dimension; + UInt velocity_index = impactor * this->spatial_dimension; + + // project slave velocity + Real projected_length; + if(this->spatial_dimension == 2) + projected_length = Math::vectorDot2(&master_normals_val[master_normal_index], &velocity_val[velocity_index]); + else if(this->spatial_dimension == 3) + projected_length = Math::vectorDot3(&master_normals_val[master_normal_index], &velocity_val[velocity_index]); + + Real tangential_impactor_velocity[3]; + for(UInt i=0; ispatial_dimension; ++i) { + tangential_impactor_velocity[i] = velocity_val[velocity_index + i] - projected_length * master_normals_val[master_normal_index + i]; + } + + // get master velocity + Real tangential_master_velocity[3]; + computeTangentialMasterVelocity(n, impactor_info, tangential_master_velocity); + + // compute relative sliding speed + Real relative_sliding_speed; + Real relative_sliding_velocity[3]; + for(UInt i =0; ispatial_dimension; ++i) + relative_sliding_velocity[i] = tangential_impactor_velocity[i] - tangential_master_velocity[i]; + if(this->spatial_dimension == 2) + relative_sliding_speed = Math::norm2(relative_sliding_velocity); + else if(this->spatial_dimension == 3) + relative_sliding_speed = Math::norm3(relative_sliding_velocity); + + (*current_velocities)(n) = relative_sliding_speed; + + // ... COMPUTE NORM + if (contact_time(n)/time_step < 1e-14) + norms(n) = 1.; // there should be only the instant velocity + else { + norms(n) = beta / (1 - exp(-beta*contact_time(n))); + } + } + } + + /* + Compute the weighted average of sliding velocity + */ + + Vector results(nb_nodes, 1); + for (UInt i=0; i * velocities = (*historic_velocities)(i); + if (velocities == NULL) continue; + + // set inactive nodes to zero + for (UInt j=0; j weighted_velocities(0,1); + weighted_velocities.copy(*velocities); + weighted_velocities *= weight * time_step; + + // add up + results += weighted_velocities; + } + + // divide by normalized velocity + for (UInt j=0; jgeneralized_sliding_velocities->resize(nb_active_nodes); + this->node_stick_status->resize(nb_active_nodes); + Vector * stick_info = impactor_info->node_is_sticking; + + for (UInt i=0; icontact.getType(); + if(contact_type == _ct_rigid /* do not change for general contact */) { + for (UInt i=0; ispatial_dimension; ++i) + tangential_master_velocity[i] = 0.; + } + else { + + // compute the tangential master velocity + ElementType type = impactor_info->master_element_type->at(impactor_index); + switch(type) { + case _not_defined: { + AKANTU_DEBUG_ERROR("Not a valid surface element type : " << type << " for computation of tangential velocity of master element"); + break; + } + case _segment_2: + case _segment_3: + case _triangle_3: + case _triangle_6: + case _tetrahedron_4: + case _tetrahedron_10: + case _quadrangle_4: + case _quadrangle_8: + case _hexahedron_8: + case _point: + case _bernoulli_beam_2: + case _max_element_type: { + AKANTU_DEBUG_ERROR("Not a valid surface element type : " << type << " for computation of tangential velocity of master element"); + break; + } + } + } + + AKANTU_DEBUG_OUT(); +} + + +__END_AKANTU__ diff --git a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef.hh b/model/solid_mechanics/contact/friction_coefficient/historic_velocity_fric_coef.hh similarity index 66% copy from model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef.hh copy to model/solid_mechanics/contact/friction_coefficient/historic_velocity_fric_coef.hh index c72e11a3b..95088d883 100644 --- a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef.hh +++ b/model/solid_mechanics/contact/friction_coefficient/historic_velocity_fric_coef.hh @@ -1,106 +1,137 @@ /** - * @file velocity_dependent_fric_coef.hh + * @file historic_velocity_fric_coef.hh * @author David Kammer - * @date Mon Jun 20 15:19:49 2011 + * @date Tue Nov 1 10:48:22 2011 * - * @brief implementation of velocity dependence for friction coefficient + * @brief friction coefficient that depends on the historic of velocity * * @section LICENSE * * Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * * Akantu is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with Akantu. If not, see . * */ /* -------------------------------------------------------------------------- */ -#ifndef __AKANTU_VELOCITY_DEPENDENT_FRIC_COEF_HH__ -#define __AKANTU_VELOCITY_DEPENDENT_FRIC_COEF_HH__ +#ifndef __AKANTU_HISTORIC_VELOCITY_FRIC_COEF_HH__ +#define __AKANTU_HISTORIC_VELOCITY_FRIC_COEF_HH__ /* -------------------------------------------------------------------------- */ #include "aka_common.hh" +#include "aka_circular_vector.hh" #include "contact_rigid.hh" #include "friction_coefficient.hh" -/* -------------------------------------------------------------------------- */ __BEGIN_AKANTU__ -class VelocityDependentFricCoef : public FrictionCoefficient { +class HistoricVelocityFricCoef : public virtual FrictionCoefficient { /* ------------------------------------------------------------------------ */ /* Constructors/Destructors */ /* ------------------------------------------------------------------------ */ public: - - VelocityDependentFricCoef(ContactRigid & contact, - const Surface & master_surface); - virtual ~VelocityDependentFricCoef(); + /// \warning DO NOT USE THIS CLASS !!! + + HistoricVelocityFricCoef(ContactRigid & contact, + const Surface & master_surface, + const Real beta); + + // constructur when this class is not used + HistoricVelocityFricCoef(ContactRigid & contact, + const Surface & master_surface); + + virtual ~HistoricVelocityFricCoef(); /* ------------------------------------------------------------------------ */ /* Methods */ /* ------------------------------------------------------------------------ */ public: - /// compute the relative sliding velocity + /// compute the history of relative sliding velocity virtual void initializeComputeFricCoef(); /// implementation of the friction coefficient formula virtual Real computeFricCoef(UInt impactor_node_index) = 0; - + // virtual Real computeFricCoef(UInt impactor_node_index) { return 0.;}; // for testing + /// function to print the contain of the class //virtual void printself(std::ostream & stream, int indent = 0) const; - + private: // computes the tangential velocity of the master element void computeTangentialMasterVelocity(UInt impactor_index, ContactRigid::ImpactorInformationPerMaster * impactor_info, Real * tangential_master_velocity); - + /* ------------------------------------------------------------------------ */ /* Accessors */ /* ------------------------------------------------------------------------ */ public: - + /* ------------------------------------------------------------------------ */ /* Class Members */ /* ------------------------------------------------------------------------ */ -protected: +private: /// spatial dimension of contact Real spatial_dimension; +protected: + /// weight parameter + Real beta; + + /// weights + Vector * weights; + + /// history of sliding velocities + CircularVector< Vector * > * historic_velocities; + + /// order of information + Vector nodes; + + /// if node is active in this time step + Vector active; + + /// time since node came in contact + Vector contact_time; + + /// keep information about stick status of active impactor node + Vector * node_stick_status; + + //public: // for testing /// relative sliding velocities for each active impactor node - Vector * relative_sliding_velocities; + Vector * generalized_sliding_velocities; }; /* -------------------------------------------------------------------------- */ /* inline functions */ /* -------------------------------------------------------------------------- */ -//#include "velocity_dependent_fric_coef_inline_impl.cc" +//#include "historic_velocity_fric_coef_inline_impl.cc" /* /// standard output stream operator -inline std::ostream & operator <<(std::ostream & stream, const VelocityDependentFricCoef & _this) +inline std::ostream & operator <<(std::ostream & stream, const HistoricVelocityFricCoef & _this) { _this.printself(stream); return stream; } */ - __END_AKANTU__ -#endif /* __AKANTU_VELOCITY_DEPENDENT_FRIC_COEF_HH__ */ + +#endif /* __AKANTU_HISTORIC_VELOCITY_FRIC_COEF_HH__ */ diff --git a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef.cc b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef.cc index 3d8b7750e..b4a29ad2f 100644 --- a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef.cc +++ b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef.cc @@ -1,167 +1,169 @@ /** * @file velocity_dependent_fric_coef.cc * @author David Kammer * @date Mon Jun 20 15:24:21 2011 * * @brief implementation for velocity dependence of friction coefficient * * @section LICENSE * * Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * * Akantu is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with Akantu. If not, see . * */ /* -------------------------------------------------------------------------- */ #include "velocity_dependent_fric_coef.hh" #include "contact_rigid.hh" /* -------------------------------------------------------------------------- */ __BEGIN_AKANTU__ /* -------------------------------------------------------------------------- */ VelocityDependentFricCoef::VelocityDependentFricCoef(ContactRigid & contact, - const Surface & master_surface) : FrictionCoefficient(contact, master_surface), spatial_dimension(this->contact.getSpatialDimension()) { + const Surface & master_surface) : + FrictionCoefficient(contact, master_surface), + spatial_dimension(this->contact.getSpatialDimension()) { AKANTU_DEBUG_IN(); this->relative_sliding_velocities = new Vector(0,1); AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ VelocityDependentFricCoef::~VelocityDependentFricCoef() { AKANTU_DEBUG_IN(); delete this->relative_sliding_velocities; AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ void VelocityDependentFricCoef::initializeComputeFricCoef() { AKANTU_DEBUG_IN(); // find impactor_information for given master const ContactRigid::SurfaceToImpactInfoMap & imp_info = this->contact.getImpactorsInformation(); ContactRigid::SurfaceToImpactInfoMap::const_iterator it; it = imp_info.find(this->master_surface); AKANTU_DEBUG_ASSERT(it != imp_info.end(), "Couldn't find impactor information object for master surface " << master_surface); ContactRigid::ImpactorInformationPerMaster * impactor_info = it->second; Vector * active_nodes = impactor_info->active_impactor_nodes; UInt * active_nodes_val = active_nodes->values; Vector * master_normals = impactor_info->master_normals; Real * master_normals_val = master_normals->values; Real * velocity_val = this->contact.getModel().getVelocity().values; // resize the relative sliding velocity vector to the nb of active impactor nodes this->relative_sliding_velocities->resize(active_nodes->getSize()); Real * relative_sliding_velocities_val = this->relative_sliding_velocities->values; for(UInt n = 0; n < active_nodes->getSize(); ++n) { UInt impactor = active_nodes_val[n]; UInt master_normal_index = n * this->spatial_dimension; UInt velocity_index = impactor * this->spatial_dimension; Real projected_length; if(this->spatial_dimension == 2) projected_length = Math::vectorDot2(&master_normals_val[master_normal_index], &velocity_val[velocity_index]); else if(this->spatial_dimension == 3) projected_length = Math::vectorDot3(&master_normals_val[master_normal_index], &velocity_val[velocity_index]); Real tangential_impactor_velocity[3]; for(UInt i=0; ispatial_dimension; ++i) { tangential_impactor_velocity[i] = velocity_val[velocity_index + i] - projected_length * master_normals_val[master_normal_index + i]; } Real tangential_master_velocity[3]; //Real * tangential_master_velocity_p = &(tangential_master_velocity[0]); computeTangentialMasterVelocity(n, impactor_info, tangential_master_velocity); Real relative_sliding_speed; Real relative_sliding_velocity[3]; //Real * relative_sliding_velocity_p = &(relative_sliding_velocity_p[0]); for(UInt i =0; ispatial_dimension; ++i) relative_sliding_velocity[i] = tangential_impactor_velocity[i] - tangential_master_velocity[i]; if(this->spatial_dimension == 2) relative_sliding_speed = Math::norm2(relative_sliding_velocity); else if(this->spatial_dimension == 3) relative_sliding_speed = Math::norm3(relative_sliding_velocity); relative_sliding_velocities_val[n] = relative_sliding_speed; } AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ void VelocityDependentFricCoef::computeTangentialMasterVelocity(UInt impactor_index, ContactRigid::ImpactorInformationPerMaster * impactor_info, Real * tangential_master_velocity) { AKANTU_DEBUG_IN(); // for ContactRigid, the master velocity is by definition zero const ContactType contact_type = this->contact.getType(); if(contact_type == _ct_rigid /* do not change for general contact */) { for (UInt i=0; ispatial_dimension; ++i) tangential_master_velocity[i] = 0.; } else { // compute the tangential master velocity ElementType type = impactor_info->master_element_type->at(impactor_index); switch(type) { /* case _segment_2: { //computeComponentsOfProjectionSegment2(impactor_node, surface_element, normal, gap, projected_position); break; } */ /* case _triangle_3: { //computeComponentsOfProjectionTriangle3(impactor_node, surface_element, normal, gap, projected_position); break; } */ case _not_defined: { AKANTU_DEBUG_ERROR("Not a valid surface element type : " << type << " for computation of tangential velocity of master element"); break; } case _segment_2: case _segment_3: case _triangle_3: case _triangle_6: case _tetrahedron_4: case _tetrahedron_10: case _quadrangle_4: case _quadrangle_8: case _hexahedron_8: case _point: case _bernoulli_beam_2: case _max_element_type: { AKANTU_DEBUG_ERROR("Not a valid surface element type : " << type << " for computation of tangential velocity of master element"); break; } } } AKANTU_DEBUG_OUT(); } __END_AKANTU__ diff --git a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef.hh b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef.hh index c72e11a3b..03af65cda 100644 --- a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef.hh +++ b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef.hh @@ -1,106 +1,106 @@ /** * @file velocity_dependent_fric_coef.hh * @author David Kammer * @date Mon Jun 20 15:19:49 2011 * * @brief implementation of velocity dependence for friction coefficient * * @section LICENSE * * Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * * Akantu is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with Akantu. If not, see . * */ /* -------------------------------------------------------------------------- */ #ifndef __AKANTU_VELOCITY_DEPENDENT_FRIC_COEF_HH__ #define __AKANTU_VELOCITY_DEPENDENT_FRIC_COEF_HH__ /* -------------------------------------------------------------------------- */ #include "aka_common.hh" #include "contact_rigid.hh" #include "friction_coefficient.hh" /* -------------------------------------------------------------------------- */ __BEGIN_AKANTU__ -class VelocityDependentFricCoef : public FrictionCoefficient { +class VelocityDependentFricCoef : public virtual FrictionCoefficient { /* ------------------------------------------------------------------------ */ /* Constructors/Destructors */ /* ------------------------------------------------------------------------ */ public: VelocityDependentFricCoef(ContactRigid & contact, const Surface & master_surface); virtual ~VelocityDependentFricCoef(); /* ------------------------------------------------------------------------ */ /* Methods */ /* ------------------------------------------------------------------------ */ public: /// compute the relative sliding velocity virtual void initializeComputeFricCoef(); /// implementation of the friction coefficient formula virtual Real computeFricCoef(UInt impactor_node_index) = 0; /// function to print the contain of the class //virtual void printself(std::ostream & stream, int indent = 0) const; private: // computes the tangential velocity of the master element void computeTangentialMasterVelocity(UInt impactor_index, ContactRigid::ImpactorInformationPerMaster * impactor_info, Real * tangential_master_velocity); /* ------------------------------------------------------------------------ */ /* Accessors */ /* ------------------------------------------------------------------------ */ public: /* ------------------------------------------------------------------------ */ /* Class Members */ /* ------------------------------------------------------------------------ */ protected: /// spatial dimension of contact Real spatial_dimension; /// relative sliding velocities for each active impactor node Vector * relative_sliding_velocities; }; /* -------------------------------------------------------------------------- */ /* inline functions */ /* -------------------------------------------------------------------------- */ //#include "velocity_dependent_fric_coef_inline_impl.cc" /* /// standard output stream operator inline std::ostream & operator <<(std::ostream & stream, const VelocityDependentFricCoef & _this) { _this.printself(stream); return stream; } */ __END_AKANTU__ #endif /* __AKANTU_VELOCITY_DEPENDENT_FRIC_COEF_HH__ */ diff --git a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano_modified.cc b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano.cc similarity index 80% copy from model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano_modified.cc copy to model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano.cc index 054c4fc69..de99b56b5 100644 --- a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano_modified.cc +++ b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano.cc @@ -1,72 +1,73 @@ /** - * @file rice_kuwano_modified.cc + * @file rice_kuwano.cc * @author David Kammer * @date Fri Nov 4 13:27:09 2011 * * @brief implementation of the functions * * @section LICENSE * * Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * * Akantu is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with Akantu. If not, see . * */ /* -------------------------------------------------------------------------- */ -#include "rice_kuwano_modified.hh" +#include "rice_kuwano.hh" /* -------------------------------------------------------------------------- */ __BEGIN_AKANTU__ /* -------------------------------------------------------------------------- */ -RiceKuwanoModified::RiceKuwanoModified(ContactRigid & contact, - const Surface & master_surface, - const Real static_friction_coefficient, - const Real dynamic_friction_coefficient, - const Real reference_velocity, - const Real alpha) : +RiceKuwano::RiceKuwano(ContactRigid & contact, + const Surface & master_surface, + const Real static_friction_coefficient, + const Real dynamic_friction_coefficient, + const Real reference_velocity, + const Real alpha) : + FrictionCoefficient(contact, master_surface), VelocityDependentFricCoef(contact, master_surface), static_friction_coefficient(static_friction_coefficient), dynamic_friction_coefficient(dynamic_friction_coefficient), reference_velocity(reference_velocity), alpha(alpha) { AKANTU_DEBUG_IN(); AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ -RiceKuwanoModified::~RiceKuwanoModified() { +RiceKuwano::~RiceKuwano() { AKANTU_DEBUG_IN(); AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ -void RiceKuwanoModified::initializeComputeFricCoef() { +void RiceKuwano::initializeComputeFricCoef() { AKANTU_DEBUG_IN(); // compute relative sliding velocities VelocityDependentFricCoef::initializeComputeFricCoef(); AKANTU_DEBUG_OUT(); } __END_AKANTU__ diff --git a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential.hh b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano.hh similarity index 72% copy from model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential.hh copy to model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano.hh index 66aa218a7..dd3f50259 100644 --- a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential.hh +++ b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano.hh @@ -1,117 +1,119 @@ /** - * @file velocity_weakening_exponential.hh + * @file rice_kuwano.hh * @author David Kammer - * @date Mon Jun 20 14:46:57 2011 + * @date Fri Nov 4 13:18:56 2011 * - * @brief implementation of a exponential velocity weakening friction coeff. + * @brief implementation of a modified rice-kuwano friction law (velocity + * weakening-strenghening friction coefficient) * * @section LICENSE * * Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * * Akantu is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with Akantu. If not, see . * */ + /* -------------------------------------------------------------------------- */ -#ifndef __AKANTU_VELOCITY_WEAKENING_EXPONENTIAL_HH__ -#define __AKANTU_VELOCITY_WEAKENING_EXPONENTIAL_HH__ +#ifndef __AKANTU_RICE_KUWANO_HH__ +#define __AKANTU_RICE_KUWANO_HH__ /* -------------------------------------------------------------------------- */ #include "aka_common.hh" #include "velocity_dependent_fric_coef.hh" /* -------------------------------------------------------------------------- */ __BEGIN_AKANTU__ -class VelocityWeakeningExponential : public VelocityDependentFricCoef { + +class RiceKuwano : public VelocityDependentFricCoef { /* ------------------------------------------------------------------------ */ /* Constructors/Destructors */ /* ------------------------------------------------------------------------ */ public: + + RiceKuwano(ContactRigid & contact, + const Surface & master_surface, + const Real static_friction_coefficient, + const Real dynamic_friction_coefficient, + const Real reference_velocity, + const Real alpha); - VelocityWeakeningExponential(ContactRigid & contact, - const Surface & master_surface); - - VelocityWeakeningExponential(ContactRigid & contact, - const Surface & master_surface, - const Real static_friction_coefficient, - const Real dynamic_friction_coefficient, - const Real power); - - virtual ~VelocityWeakeningExponential(); + virtual ~RiceKuwano(); /* ------------------------------------------------------------------------ */ /* Methods */ /* ------------------------------------------------------------------------ */ public: /// no initialization of variables for friction coefficient computation virtual void initializeComputeFricCoef(); /// fill table with friction coefficient - inline virtual Real computeFricCoef(UInt impactor_node_index); + inline Real computeFricCoef(UInt impactor_node_index); /// compute the alpha parameter - inline virtual void computeAlpha(); + inline void computeAlpha(); /// function to print the contain of the class - //virtual void printself(std::ostream & stream, int indent = 0) const; + // virtual void printself(std::ostream & stream, int indent = 0) const; /* ------------------------------------------------------------------------ */ /* Accessors */ /* ------------------------------------------------------------------------ */ public: /* ------------------------------------------------------------------------ */ /* Class Members */ /* ------------------------------------------------------------------------ */ protected: /// static friction coefficient Real static_friction_coefficient; /// dynamic friction coefficient Real dynamic_friction_coefficient; - /// power of friction dissipation - Real power; + /// reference velocity Vw + Real reference_velocity; - /// exponential parameter + /// linear parameter Real alpha; }; - /* -------------------------------------------------------------------------- */ /* inline functions */ /* -------------------------------------------------------------------------- */ __END_AKANTU__ #include "contact_rigid.hh" __BEGIN_AKANTU__ -#include "velocity_weakening_exponential_inline_impl.cc" +#include "rice_kuwano_inline_impl.cc" + /* /// standard output stream operator -inline std::ostream & operator <<(std::ostream & stream, const VelocityWeakeningExponential & _this) +inline std::ostream & operator <<(std::ostream & stream, const RiceKuwano & _this) { _this.printself(stream); return stream; } */ __END_AKANTU__ -#endif /* __AKANTU_VELOCITY_WEAKENING_EXPONENTIAL_HH__ */ + +#endif /* __AKANTU_RICE_KUWANO_HH__ */ diff --git a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano_inline_impl.cc b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano_inline_impl.cc new file mode 100644 index 000000000..395f72192 --- /dev/null +++ b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano_inline_impl.cc @@ -0,0 +1,46 @@ +/** + * @file rice_kuwano_inline_impl.cc + * @author David Kammer + * @date Fri Nov 4 13:39:02 2011 + * + * @brief implementation of inlined functions + * + * @section LICENSE + * + * Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) + * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) + * + * Akantu is free software: you can redistribute it and/or modify it under the + * terms of the GNU Lesser General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) any + * later version. + * + * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Akantu. If not, see . + * + */ + +/* -------------------------------------------------------------------------- */ +inline Real RiceKuwano::computeFricCoef(UInt impactor_node_index) { + AKANTU_DEBUG_IN(); + + Real friction_coefficient = 0.; + + Real rel_sliding_vel = (*relative_sliding_velocities)(impactor_node_index); + + if (rel_sliding_vel < this->reference_velocity) + friction_coefficient = this->static_friction_coefficient; + else { + friction_coefficient = (this->static_friction_coefficient - this->dynamic_friction_coefficient) * reference_velocity / rel_sliding_vel; + friction_coefficient += this->dynamic_friction_coefficient; + friction_coefficient += this->alpha * rel_sliding_vel; + } + + AKANTU_DEBUG_OUT(); + return friction_coefficient; +} diff --git a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano_modified.cc b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano_modified.cc index 054c4fc69..9fe268689 100644 --- a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano_modified.cc +++ b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/rice_kuwano_modified.cc @@ -1,72 +1,73 @@ /** * @file rice_kuwano_modified.cc * @author David Kammer * @date Fri Nov 4 13:27:09 2011 * * @brief implementation of the functions * * @section LICENSE * * Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * * Akantu is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with Akantu. If not, see . * */ /* -------------------------------------------------------------------------- */ #include "rice_kuwano_modified.hh" /* -------------------------------------------------------------------------- */ __BEGIN_AKANTU__ /* -------------------------------------------------------------------------- */ RiceKuwanoModified::RiceKuwanoModified(ContactRigid & contact, const Surface & master_surface, const Real static_friction_coefficient, const Real dynamic_friction_coefficient, const Real reference_velocity, const Real alpha) : + FrictionCoefficient(contact, master_surface), VelocityDependentFricCoef(contact, master_surface), static_friction_coefficient(static_friction_coefficient), dynamic_friction_coefficient(dynamic_friction_coefficient), reference_velocity(reference_velocity), alpha(alpha) { AKANTU_DEBUG_IN(); AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ RiceKuwanoModified::~RiceKuwanoModified() { AKANTU_DEBUG_IN(); AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ void RiceKuwanoModified::initializeComputeFricCoef() { AKANTU_DEBUG_IN(); // compute relative sliding velocities VelocityDependentFricCoef::initializeComputeFricCoef(); AKANTU_DEBUG_OUT(); } __END_AKANTU__ diff --git a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential.cc b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential.cc index f9b3b6eda..2efb8fad5 100644 --- a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential.cc +++ b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential.cc @@ -1,84 +1,99 @@ /** * @file velocity_weakening_exponential.cc * @author David Kammer * @date Mon Jun 20 15:02:47 2011 * * @brief implementation of an exponential velocity weakening friction coef * * @section LICENSE * * Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * * Akantu is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with Akantu. If not, see . * */ /* -------------------------------------------------------------------------- */ #include "velocity_weakening_exponential.hh" /* -------------------------------------------------------------------------- */ __BEGIN_AKANTU__ /* -------------------------------------------------------------------------- */ VelocityWeakeningExponential::VelocityWeakeningExponential(ContactRigid & contact, - const Surface & master_surface) : - VelocityDependentFricCoef(contact, master_surface), static_friction_coefficient(0.), - dynamic_friction_coefficient(0.), power(1.) { + const Surface & master_surface, + const Real static_friction_coefficient, + const Real dynamic_friction_coefficient, + const Real power) : + FrictionCoefficient(contact, master_surface), + VelocityDependentFricCoef(contact, master_surface), + HistoricVelocityFricCoef(contact, master_surface), + static_friction_coefficient(static_friction_coefficient), + dynamic_friction_coefficient(dynamic_friction_coefficient), + power(power), + instant_velocity(true) { AKANTU_DEBUG_IN(); - + computeAlpha(); AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ VelocityWeakeningExponential::VelocityWeakeningExponential(ContactRigid & contact, const Surface & master_surface, const Real static_friction_coefficient, const Real dynamic_friction_coefficient, - const Real power) : + const Real power, + const Real beta) : + FrictionCoefficient(contact, master_surface), VelocityDependentFricCoef(contact, master_surface), + HistoricVelocityFricCoef(contact, master_surface, beta), static_friction_coefficient(static_friction_coefficient), dynamic_friction_coefficient(dynamic_friction_coefficient), - power(power) { + power(power), + instant_velocity(false) { AKANTU_DEBUG_IN(); computeAlpha(); AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ VelocityWeakeningExponential::~VelocityWeakeningExponential() { AKANTU_DEBUG_IN(); AKANTU_DEBUG_OUT(); } /* -------------------------------------------------------------------------- */ void VelocityWeakeningExponential::initializeComputeFricCoef() { AKANTU_DEBUG_IN(); // compute relative sliding velocities - VelocityDependentFricCoef::initializeComputeFricCoef(); + if (instant_velocity) + VelocityDependentFricCoef::initializeComputeFricCoef(); + else + HistoricVelocityFricCoef::initializeComputeFricCoef(); AKANTU_DEBUG_OUT(); } __END_AKANTU__ diff --git a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential.hh b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential.hh index 66aa218a7..b308fae29 100644 --- a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential.hh +++ b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential.hh @@ -1,117 +1,126 @@ /** * @file velocity_weakening_exponential.hh * @author David Kammer * @date Mon Jun 20 14:46:57 2011 * * @brief implementation of a exponential velocity weakening friction coeff. * * @section LICENSE * * Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * * Akantu is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with Akantu. If not, see . * */ /* -------------------------------------------------------------------------- */ #ifndef __AKANTU_VELOCITY_WEAKENING_EXPONENTIAL_HH__ #define __AKANTU_VELOCITY_WEAKENING_EXPONENTIAL_HH__ /* -------------------------------------------------------------------------- */ #include "aka_common.hh" #include "velocity_dependent_fric_coef.hh" +#include "historic_velocity_fric_coef.hh" /* -------------------------------------------------------------------------- */ __BEGIN_AKANTU__ -class VelocityWeakeningExponential : public VelocityDependentFricCoef { +class VelocityWeakeningExponential : public VelocityDependentFricCoef, HistoricVelocityFricCoef { /* ------------------------------------------------------------------------ */ /* Constructors/Destructors */ /* ------------------------------------------------------------------------ */ public: - VelocityWeakeningExponential(ContactRigid & contact, - const Surface & master_surface); - VelocityWeakeningExponential(ContactRigid & contact, const Surface & master_surface, const Real static_friction_coefficient, const Real dynamic_friction_coefficient, const Real power); + VelocityWeakeningExponential(ContactRigid & contact, + const Surface & master_surface, + const Real static_friction_coefficient, + const Real dynamic_friction_coefficient, + const Real power, + const Real beta); + virtual ~VelocityWeakeningExponential(); /* ------------------------------------------------------------------------ */ /* Methods */ /* ------------------------------------------------------------------------ */ public: /// no initialization of variables for friction coefficient computation virtual void initializeComputeFricCoef(); /// fill table with friction coefficient - inline virtual Real computeFricCoef(UInt impactor_node_index); + inline Real computeFricCoef(UInt impactor_node_index); /// compute the alpha parameter - inline virtual void computeAlpha(); + inline void computeAlpha(); /// function to print the contain of the class //virtual void printself(std::ostream & stream, int indent = 0) const; /* ------------------------------------------------------------------------ */ /* Accessors */ /* ------------------------------------------------------------------------ */ public: /* ------------------------------------------------------------------------ */ /* Class Members */ /* ------------------------------------------------------------------------ */ +private: + // use instant_velocity + bool instant_velocity; + protected: /// static friction coefficient Real static_friction_coefficient; /// dynamic friction coefficient Real dynamic_friction_coefficient; /// power of friction dissipation Real power; /// exponential parameter Real alpha; }; /* -------------------------------------------------------------------------- */ /* inline functions */ /* -------------------------------------------------------------------------- */ __END_AKANTU__ #include "contact_rigid.hh" __BEGIN_AKANTU__ #include "velocity_weakening_exponential_inline_impl.cc" /* /// standard output stream operator inline std::ostream & operator <<(std::ostream & stream, const VelocityWeakeningExponential & _this) { _this.printself(stream); return stream; } */ __END_AKANTU__ #endif /* __AKANTU_VELOCITY_WEAKENING_EXPONENTIAL_HH__ */ diff --git a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential_inline_impl.cc b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential_inline_impl.cc index f8bf5c303..4474169e8 100644 --- a/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential_inline_impl.cc +++ b/model/solid_mechanics/contact/friction_coefficient/velocity_dependent_fric_coef/velocity_weakening_exponential_inline_impl.cc @@ -1,55 +1,64 @@ /** * @file velocity_weakening_exponential_inline_impl.cc * @author David Kammer * @date Mon Jun 20 15:39:52 2011 * * @brief implementation of exponential velocity weakening friction coefficient * * @section LICENSE * * Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne) * Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides) * * Akantu is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * Akantu is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with Akantu. If not, see . * */ /* -------------------------------------------------------------------------- */ inline Real VelocityWeakeningExponential::computeFricCoef(UInt impactor_node_index) { AKANTU_DEBUG_IN(); Real friction_coefficient = 0.; - Real * relative_sliding_velocities_val = this->relative_sliding_velocities->values; - Real velocity_term = 1 - exp((-1.) * this->alpha * relative_sliding_velocities_val[impactor_node_index]); + Real * relative_sliding_velocities_val; + if (instant_velocity) + relative_sliding_velocities_val = this->relative_sliding_velocities->values; + else + relative_sliding_velocities_val = this->generalized_sliding_velocities->values; + + if (!instant_velocity && (*node_stick_status)(impactor_node_index)) + friction_coefficient = this->static_friction_coefficient; + else { + Real velocity_term = 1 - exp((-1.) * this->alpha * relative_sliding_velocities_val[impactor_node_index]); - friction_coefficient = this->static_friction_coefficient; - friction_coefficient += (this->dynamic_friction_coefficient - this->static_friction_coefficient) * velocity_term; + friction_coefficient = this->static_friction_coefficient; + friction_coefficient += (this->dynamic_friction_coefficient - this->static_friction_coefficient) * velocity_term; + } AKANTU_DEBUG_OUT(); return friction_coefficient; } /* -------------------------------------------------------------------------- */ inline void VelocityWeakeningExponential::computeAlpha() { AKANTU_DEBUG_IN(); const Real tolerance = std::numeric_limits::epsilon(); AKANTU_DEBUG_ASSERT(std::abs(power) > tolerance, "Power is equal zero!! Cannot be the case: division by zero"); this->alpha = std::sqrt((this->static_friction_coefficient - this->dynamic_friction_coefficient) / this->power); AKANTU_DEBUG_OUT(); }