Null Contact Model Implementation

See this page for the documentation of this contact model.

contactmodelmechanicalnull.h

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
// contactmodelmechanicalnull.h

#include "contactmodel/src/contactmodelmechanical.h"

#ifdef NULL_LIB
#  define NULL_EXPORT EXPORT_TAG
#elif defined(NO_MODEL_IMPORT)
#  define NULL_EXPORT
#else
#  define NULL_EXPORT IMPORT_TAG
#endif

namespace cmodelsxd {
    using namespace itasca;

    class  ContactModelMechanicalNull : public ContactModelMechanical {
    public:
        NULL_EXPORT ContactModelMechanicalNull();
        NULL_EXPORT virtual ~ContactModelMechanicalNull();
        virtual ContactModelMechanicalNull *clone() const { return NEWC(ContactModelMechanicalNull()); }
        virtual QString     getName() const { return "null"; }
        virtual void        setIndex(int i) { index_=i;}
        virtual int         getIndex() const {return index_;}
        virtual QString     getProperties() const { return QString(); }
        virtual QVariant    getProperty(uint ,const IContact * =0) const {return QVariant();}
        virtual bool        setProperty(uint ,const QVariant &,IContact * =0) {return false;}
        virtual uint        getMinorVersion() const;
        virtual bool        validate(ContactModelMechanicalState *,const double &) {return false;}
        virtual bool        endPropertyUpdated(const QString &,const IContactMechanical *) {return false;}
        virtual bool        forceDisplacementLaw(ContactModelMechanicalState *,const double &) {return false;}
        virtual double      getActivityDistance() const {return 0.0;}
        virtual void        resetForcesAndMoments() { }
        virtual void        setForce(const DVect &,IContact *) { }
        virtual void        setArea(const double &) { }

    private:
        static int index_;

    };
} // namespace itascaxd
// EoF

Top

contactmodelmechanicalnull.cpp

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// contactmodelmechanicalnull.cpp
#include "contactmodelmechanicalnull.h"
#include "../version.txt"

#ifdef NULL_LIB
  int __stdcall DllMain(void *,unsigned, void *)
  {
    return 1;
  }

  extern "C" EXPORT_TAG const char *getName() 
  {
#if DIM==3
    return "contactmodelmechanical3dnull";
#else
    return "contactmodelmechanical2dnull";
#endif
  }

  extern "C" EXPORT_TAG unsigned getMajorVersion()
  {
    return MAJOR_VERSION;
  }

  extern "C" EXPORT_TAG unsigned getMinorVersion()
  {
    return MINOR_VERSION;
  }

  extern "C" EXPORT_TAG void *createInstance() 
  {
    cmodelsxd::ContactModelMechanicalNull *m = NEWC(cmodelsxd::ContactModelMechanicalNull());
    return (void *)m;
  }
#endif // NULL_LIB

namespace cmodelsxd {
    int ContactModelMechanicalNull::index_ = -1;
    UInt ContactModelMechanicalNull::getMinorVersion() const { return MINOR_VERSION;}
    ContactModelMechanicalNull::ContactModelMechanicalNull() {}
    ContactModelMechanicalNull::~ContactModelMechanicalNull() {}
} // namespace itascaxd
// EoF

Top