1 /* ---------------------------------------------------------------------- 2 This is the 3 4 ██╗ ██╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗████████╗███████╗ 5 ██║ ██║██╔════╝ ██╔════╝ ██╔════╝ ██║ ██║╚══██╔══╝██╔════╝ 6 ██║ ██║██║ ███╗██║ ███╗██║ ███╗███████║ ██║ ███████╗ 7 ██║ ██║██║ ██║██║ ██║██║ ██║██╔══██║ ██║ ╚════██║ 8 ███████╗██║╚██████╔╝╚██████╔╝╚██████╔╝██║ ██║ ██║ ███████║ 9 ╚══════╝╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝® 10 11 DEM simulation engine, released by 12 DCS Computing Gmbh, Linz, Austria 13 http://www.dcs-computing.com, office@dcs-computing.com 14 15 LIGGGHTS® is part of CFDEM®project: 16 http://www.liggghts.com | http://www.cfdem.com 17 18 Core developer and main author: 19 Christoph Kloss, christoph.kloss@dcs-computing.com 20 21 LIGGGHTS® is open-source, distributed under the terms of the GNU Public 22 License, version 2 or later. It is distributed in the hope that it will 23 be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 24 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have 25 received a copy of the GNU General Public License along with LIGGGHTS®. 26 If not, see http://www.gnu.org/licenses . See also top-level README 27 and LICENSE files. 28 29 LIGGGHTS® and CFDEM® are registered trade marks of DCS Computing GmbH, 30 the producer of the LIGGGHTS® software and the CFDEM®coupling software 31 See http://www.cfdem.com/terms-trademark-policy for details. 32 33 ------------------------------------------------------------------------- 34 Contributing author and copyright for this file: 35 (if not contributing author is listed, this file has been contributed 36 by the core developer) 37 Arno Mayrhofer (DCS Computing GmbH, Linz) 38 39 Copyright 2017- DCS Computing GmbH, Linz 40 ------------------------------------------------------------------------- */ 41 42 #ifndef NORMAL_MODEL 43 44 #ifndef NORMAL_MODEL_BASE_H 45 #define NORMAL_MODEL_BASE_H 46 47 #include "contact_models.h" 48 #include "contact_interface.h" 49 namespace LIGGGHTS 50 { 51 namespace ContactModels 52 { 53 54 class NormalModelBase : protected Pointers 55 { 56 public: NormalModelBase(LAMMPS * lmp,IContactHistorySetup *,class ContactModelBase *)57 NormalModelBase(LAMMPS * lmp, IContactHistorySetup*, class ContactModelBase *) : 58 Pointers(lmp) 59 {} 60 61 virtual void registerSettings(Settings& settings) = 0; 62 virtual void postSettings(IContactHistorySetup * hsetup, ContactModelBase *cmb) = 0; 63 virtual void connectToProperties(PropertyRegistry&) = 0; 64 virtual double stressStrainExponent() = 0; 65 virtual void surfacesIntersect(SurfacesIntersectData & sidata, ForceData&, ForceData&) = 0; 66 virtual void surfacesClose(SurfacesCloseData &scdata, ForceData&, ForceData&) = 0; 67 virtual void beginPass(SurfacesIntersectData&, ForceData&, ForceData&) = 0; 68 virtual void endPass(SurfacesIntersectData&, ForceData&, ForceData&) = 0; 69 }; 70 71 template<int Model> 72 class NormalModel : public NormalModelBase 73 { 74 public: 75 NormalModel(LAMMPS * lmp, IContactHistorySetup * hsetup, class ContactModelBase *cmb = 0); 76 inline void beginPass(SurfacesIntersectData & sidata, ForceData & i_forces, ForceData & j_forces); 77 inline void endPass(SurfacesIntersectData & sidata, ForceData & i_forces, ForceData & j_forces); 78 inline void registerSettings(Settings & settings); 79 inline void postSettings(IContactHistorySetup * hsetup, ContactModelBase *cmb); 80 inline void connectToProperties(PropertyRegistry & registry); 81 inline void surfacesIntersect(SurfacesIntersectData & sidata, ForceData & i_forces, ForceData & j_forces); 82 inline void surfacesClose(SurfacesCloseData & scdata, ForceData & i_forces, ForceData & j_forces); 83 84 inline double stressStrainExponent(); 85 }; 86 87 template<> 88 class NormalModel<NORMAL_OFF> : public NormalModelBase 89 { 90 public: NormalModel(LAMMPS * lmp,IContactHistorySetup * hsetup,class ContactModelBase * c)91 NormalModel(LAMMPS * lmp, IContactHistorySetup * hsetup ,class ContactModelBase *c) : NormalModelBase(lmp, hsetup, c) {} beginPass(SurfacesIntersectData &,ForceData &,ForceData &)92 void beginPass(SurfacesIntersectData&, ForceData&, ForceData&){} endPass(SurfacesIntersectData &,ForceData &,ForceData &)93 void endPass(SurfacesIntersectData&, ForceData&, ForceData&){} connectToProperties(PropertyRegistry &)94 void connectToProperties(PropertyRegistry&){} registerSettings(Settings &)95 void registerSettings(Settings&){} surfacesIntersect(SurfacesIntersectData &,ForceData &,ForceData &)96 void surfacesIntersect(SurfacesIntersectData&, ForceData&, ForceData&){} surfacesClose(SurfacesCloseData &,ForceData &,ForceData &)97 void surfacesClose(SurfacesCloseData&, ForceData&, ForceData&){} postSettings(IContactHistorySetup * hsetup,ContactModelBase * cmb)98 inline void postSettings(IContactHistorySetup * hsetup, ContactModelBase *cmb) {} stressStrainExponent()99 inline double stressStrainExponent() { return 0.0; } 100 }; 101 102 } 103 } 104 105 #endif 106 107 #endif 108