#ifndef __CMODEL_CM3MODEL_H
#define __CMODEL_CM3MODEL_H

#ifndef __CMODEL_CONTMODEL_H
#include "base/contmodel.h"
#endif


//------------ built-in, user-defined contact model "ductile" -----------
const unsigned long ulModelCM3 = 3;
class CM3 : public ContactModel {
  private:
    double kn;
    double ratks;
    double ratfs;
    double fric;
    double FTmax;
    double kduc;
    double kun;
    double broken;
    double softened;
    double ut;
    double FT;

  public:
    // Creators
    EXPORT CM3(bool bRegister=false);
    EXPORT ~CM3(void) { }

    // Accessors
    EXPORT const char *Name(void) const;
    EXPORT const char **PropNames(void) const;
    EXPORT ContactModel *Clone(PropBlock * =0) const { return(new CM3); }
    EXPORT double  ReturnProp(int n) const;
    EXPORT double  KnEstimate(void) const { return kn; }
    EXPORT double  KsEstimate(void) const { return kn*ratks; }
    EXPORT unsigned long   Version(void) const { return 3; }

    // Manipulators
    EXPORT void AcceptProp(int n, double v);
    EXPORT const char *PreCycle(PropBlock &pb);
    EXPORT void FDlaw(FdBlock &fb, char cDim);
    EXPORT const char *SaveRestore(ModelSaveObject *mso);
};



#endif

