#ifndef __CMODEL_CM4MODEL_H
#define __CMODEL_CM4MODEL_H

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


//------------ built-in, user-defined contact model "softening" -----------
const unsigned long ulModelCM4 = 4;
class CM4 : public ContactModel {
  private:
    double knc;
    double knt;
    double ks;
    double FTmax;
    double FSmax;
    double fric;
    double rfric;
    double uplim;
    double broken;
    double softened;
    double overlap;
    double uplas;

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

    // Accessors
    EXPORT const char *Name(void) const;
    EXPORT const char **PropNames(void) const;
    EXPORT ContactModel *Clone(PropBlock * =0) const { return(new CM4); }
    EXPORT double  ReturnProp(int n) const;
    EXPORT double  KnEstimate(void) const { return knc; }
    EXPORT double  KsEstimate(void) const { return ks; }
    EXPORT unsigned long   Version(void) const { return 2; }

    // 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
