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 TANGENTIAL_MODEL
43 
44 #ifndef TANGENTIAL_MODEL_BASE_H
45 #define TANGENTIAL_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 TangentialModelBase : protected Pointers
55 {
56   public:
TangentialModelBase(LAMMPS * lmp,IContactHistorySetup *,class ContactModelBase *)57     TangentialModelBase(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 void surfacesIntersect(const SurfacesIntersectData & sidata, ForceData & i_forces, ForceData & j_forces) = 0;
65     virtual void surfacesClose(SurfacesCloseData &scdata, ForceData&, ForceData&) = 0;
66     virtual void beginPass(SurfacesIntersectData&, ForceData&, ForceData&) = 0;
67     virtual void endPass(SurfacesIntersectData&, ForceData&, ForceData&) = 0;
68 };
69 
70   template<int Model>
71   class TangentialModel : public TangentialModelBase
72   {
73   public:
74     TangentialModel(LAMMPS * lmp, IContactHistorySetup * hsetup, class ContactModelBase *cmb = 0);
75     inline void beginPass(SurfacesIntersectData & sidata, ForceData & i_forces, ForceData & j_forces);
76     inline void endPass(SurfacesIntersectData & sidata, ForceData & i_forces, ForceData & j_forces);
77     inline void registerSettings(Settings & settings);
78     inline void connectToProperties(PropertyRegistry & registry);
79     inline void surfacesIntersect(const SurfacesIntersectData & sidata, ForceData & i_forces, ForceData & j_forces);
80     inline void surfacesClose(SurfacesCloseData & scdata, ForceData & i_forces, ForceData & j_forces);
81   };
82 
83   template<>
84   class TangentialModel<TANGENTIAL_OFF> : public TangentialModelBase
85   {
86   public:
TangentialModel(LAMMPS * lmp,IContactHistorySetup * hsetup,class ContactModelBase * c)87     TangentialModel(LAMMPS * lmp, IContactHistorySetup * hsetup, class ContactModelBase *c) : TangentialModelBase(lmp, hsetup, c) {}
beginPass(SurfacesIntersectData &,ForceData &,ForceData &)88     void beginPass(SurfacesIntersectData&, ForceData&, ForceData&){}
endPass(SurfacesIntersectData &,ForceData &,ForceData &)89     void endPass(SurfacesIntersectData&, ForceData&, ForceData&){}
connectToProperties(PropertyRegistry &)90     void connectToProperties(PropertyRegistry&){}
registerSettings(Settings &)91     void registerSettings(Settings&){}
surfacesIntersect(const SurfacesIntersectData &,ForceData &,ForceData &)92     void surfacesIntersect(const SurfacesIntersectData&, ForceData&, ForceData&){}
surfacesClose(SurfacesCloseData &,ForceData &,ForceData &)93     void surfacesClose(SurfacesCloseData&, ForceData&, ForceData&){}
postSettings(IContactHistorySetup * hsetup,ContactModelBase * cmb)94     inline void postSettings(IContactHistorySetup * hsetup, ContactModelBase *cmb) {}
95   };
96 
97 }
98 }
99 
100 #endif
101 
102 #endif
103