Skip to content
Snippets Groups Projects
Select Git revision
  • 49041a7f5059255b87ecc09d49873bd034e3c32a
  • master default protected
  • cyrielle
  • ujwal_21_08_2024
  • vinayak
  • dev_mm_torchSCRU
  • dev_mm_pf
  • debug_mm_pf
  • newStructureNonLocal
  • Mohamed_stochasticDMN
  • dev_mm_bench
  • stochdmn
  • revert-351ff7aa
  • ujwal_29April2024
  • dev_mm_ann
  • mohamed_vevp
  • ujwal_debug
  • ujwal_2ndApril2024
  • ujwal_October_2023
  • gabriel
  • SFEM
  • v4.0
  • v3.2.3_multiplePhase
  • v3.5
  • v3.3.2
  • v3.4
  • v3.3
  • ver3.2
  • verJulienWork
  • ver3.1
  • ver2
  • ver1.1.2
  • ver1.1.1
  • ver1.1
34 results

j2IsotropicHardening.h

Blame
  • j2IsotropicHardening.h 11.70 KiB
    //
    // C++ Interface: terms
    //
    // Description: Define isotropic hardening laws for j" plasticity
    //
    //
    // Author:  <L. Noels>, (C) 2013
    //
    // Copyright: See COPYING file that comes with this distribution
    //
    //
    #ifndef _J2ISOTROPICHARDENING_H_
    #define _J2ISOTROPICHARDENING_H_
    #ifndef SWIG
    #include "ipstate.h"
    #include "MElement.h"
    #include "ipHardening.h"
    #endif
    class J2IsotropicHardening{
     public :
      enum hardeningname{perfectlyPlasticJ2IsotropicHardening,powerLawJ2IsotropicHardening, exponentialJ2IsotropicHardening,
                         swiftJ2IsotropicHardening, linearExponentialJ2IsotropicHardening,
                         linearFollowedByExponentialJ2IsotropicHardening, linearFollowedByPowerLawJ2IsotropicHardening,
                         polynomialJ2IsotropicHardening,
                         twoExpJ2IsotropicHaderning, tanhJ2IsotropicHaderning};
     protected :
      int _num; // number of law (must be unique !)
      bool _initialized; // to initialize law
      double _yield0;
     public:
      // constructor
    #ifndef SWIG
      J2IsotropicHardening(const int num, double yield0, const bool init=true);
      virtual ~J2IsotropicHardening(){}
      J2IsotropicHardening(const J2IsotropicHardening &source);
      J2IsotropicHardening& operator=(const J2IsotropicHardening &source);
      virtual int getNum() const{return _num;}
      virtual hardeningname getType() const=0;
      virtual void createIPVariable(IPJ2IsotropicHardening* &ipv) const=0;
      virtual void initLaws(const std::map<int,J2IsotropicHardening*> &maplaw)=0;
      virtual const bool isInitialized() {return _initialized;}
      virtual void hardening(double p, IPJ2IsotropicHardening &ipv) const=0;
      virtual double getYield0() const {return _yield0;}
      virtual J2IsotropicHardening * clone() const=0;
    #endif
    };
    
    class PerfectlyPlasticJ2IsotropicHardening : public J2IsotropicHardening
    {
     public :
      // constructor
      PerfectlyPlasticJ2IsotropicHardening(const int num, double yield0, const bool init=true);
    	#ifndef SWIG
      virtual ~PerfectlyPlasticJ2IsotropicHardening(){}
      PerfectlyPlasticJ2IsotropicHardening(const PerfectlyPlasticJ2IsotropicHardening &source);
      PerfectlyPlasticJ2IsotropicHardening& operator=(const J2IsotropicHardening &source);
      virtual int getNum() const{return _num;}
      virtual hardeningname getType() const{return J2IsotropicHardening::perfectlyPlasticJ2IsotropicHardening; };
      virtual void createIPVariable(IPJ2IsotropicHardening* &ipv) const;
      virtual void initLaws(const std::map<int,J2IsotropicHardening*> &maplaw) {}; //nothing now, we will see if we use the mapping
       virtual void hardening(double p, IPJ2IsotropicHardening &ipv) const;
      virtual J2IsotropicHardening * clone() const;
    #endif
    };
    
    class PowerLawJ2IsotropicHardening : public J2IsotropicHardening
    {
     // R = yield0 + h p^hexp if p>pth
     // R = yield0 + (h pth^hexp)/pth p if p<=pth
     protected :
      double _h, _hexp, _pth;
    
     public:
      // constructor
      PowerLawJ2IsotropicHardening(const int num,  double yield0, double h, double hexp, double pth=1.e-16, bool init=true);
    #ifndef SWIG
      virtual ~PowerLawJ2IsotropicHardening(){}
      PowerLawJ2IsotropicHardening(const PowerLawJ2IsotropicHardening &source);
      PowerLawJ2IsotropicHardening& operator=(const J2IsotropicHardening &source);
      virtual int getNum() const{return _num;}
      virtual hardeningname getType() const{return J2IsotropicHardening::powerLawJ2IsotropicHardening; };
      virtual void createIPVariable(IPJ2IsotropicHardening* &ipv) const;
      virtual void initLaws(const std::map<int,J2IsotropicHardening*> &maplaw) {}; //nothing now, we will see if we use the mapping
      virtual void hardening(double p, IPJ2IsotropicHardening &ipv) const;
      virtual J2IsotropicHardening * clone() const;
    #endif
    };
    
    class ExponentialJ2IsotropicHardening : public J2IsotropicHardening
    {
     // R = yield0 +h * (1-exp (-hexp *p))
     protected :
      double _h, _hexp;
    
     public:
      // constructor
      ExponentialJ2IsotropicHardening(const int num,  double yield0, double h, double hexp, bool init=true);
    #ifndef SWIG
      virtual ~ExponentialJ2IsotropicHardening(){}
      ExponentialJ2IsotropicHardening(const ExponentialJ2IsotropicHardening &source);
      ExponentialJ2IsotropicHardening& operator=(const J2IsotropicHardening &source);
      virtual int getNum() const{return _num;}
      virtual hardeningname getType() const{return J2IsotropicHardening::exponentialJ2IsotropicHardening; };
      virtual void createIPVariable(IPJ2IsotropicHardening* &ipv) const;
      virtual void initLaws(const std::map<int,J2IsotropicHardening*> &maplaw) {}; //nothing now, we will see if we use the mapping
      virtual void hardening(double p, IPJ2IsotropicHardening &ipv) const;
      virtual J2IsotropicHardening * clone() const;
    #endif
    };
    
    class SwiftJ2IsotropicHardening : public J2IsotropicHardening
    {
     // R = yield0 * (1+ h*p)^hexp
     protected :
      double _h, _hexp;
    
     public:
      // constructor
      SwiftJ2IsotropicHardening(const int num,  double yield0, double h, double hexp, bool init=true);
    #ifndef SWIG
      virtual ~SwiftJ2IsotropicHardening(){}
      SwiftJ2IsotropicHardening(const SwiftJ2IsotropicHardening &source);
      SwiftJ2IsotropicHardening& operator=(const J2IsotropicHardening &source);
      virtual int getNum() const{return _num;}
      virtual hardeningname getType() const{return J2IsotropicHardening::swiftJ2IsotropicHardening; };
      virtual void createIPVariable(IPJ2IsotropicHardening* &ipv) const;
      virtual void initLaws(const std::map<int,J2IsotropicHardening*> &maplaw) {}; //nothing now, we will see if we use the mapping
      virtual void hardening(double p, IPJ2IsotropicHardening &ipv) const;
      virtual J2IsotropicHardening * clone() const;
    #endif
    };
    
    class LinearExponentialJ2IsotropicHardening : public J2IsotropicHardening
    {
     // R = yield0 +h1 * p + h2* (1- exp(-hexp*p))
     protected :
      double _h1, _h2, _hexp;
    
     public:
      // constructor
      LinearExponentialJ2IsotropicHardening(const int num,  double yield0, double h1, double h2, double hexp, bool init=true);
    #ifndef SWIG
      virtual ~LinearExponentialJ2IsotropicHardening(){}
      LinearExponentialJ2IsotropicHardening(const LinearExponentialJ2IsotropicHardening &source);
      LinearExponentialJ2IsotropicHardening& operator=(const J2IsotropicHardening &source);
      virtual int getNum() const{return _num;}
      virtual hardeningname getType() const{return J2IsotropicHardening::linearExponentialJ2IsotropicHardening; };
      virtual void createIPVariable(IPJ2IsotropicHardening* &ipv) const;
      virtual void initLaws(const std::map<int,J2IsotropicHardening*> &maplaw) {}; //nothing now, we will see if we use the mapping
      virtual void hardening(double p, IPJ2IsotropicHardening &ipv) const;
      virtual J2IsotropicHardening * clone() const;
    #endif
    };
    
    
    class LinearFollowedByExponentialJ2IsotropicHardening : public J2IsotropicHardening
    {
     // R = yield0 + h1 * p
     // Then when p > p_exp 
     // R = yield0 + h1 * p + h2* (1- exp(-hexp2*(p-pexp)))
     protected :
      double _h1, _pexp, _h2, _hexp2;
    
     public:
      // constructor
      LinearFollowedByExponentialJ2IsotropicHardening(const int num,  double yield0, double h1, double pexp, double h2, double hexp2, bool init=true);
    #ifndef SWIG
      virtual ~LinearFollowedByExponentialJ2IsotropicHardening(){}
      LinearFollowedByExponentialJ2IsotropicHardening(const LinearFollowedByExponentialJ2IsotropicHardening &source);
      LinearFollowedByExponentialJ2IsotropicHardening& operator=(const J2IsotropicHardening &source);
      virtual int getNum() const{return _num;}
      virtual hardeningname getType() const{return J2IsotropicHardening::linearFollowedByExponentialJ2IsotropicHardening; };
      virtual void createIPVariable(IPJ2IsotropicHardening* &ipv) const;
      virtual void initLaws(const std::map<int,J2IsotropicHardening*> &maplaw) {}; //nothing now, we will see if we use the mapping
      virtual void hardening(double p, IPJ2IsotropicHardening &ipv) const;
      virtual J2IsotropicHardening * clone() const;
    #endif
    };
    
    
    class LinearFollowedByPowerLawJ2IsotropicHardening : public J2IsotropicHardening
    {
     // R = yield0 + h1 * p
     // Then when p > pexp 
     // R = yield0 * (1 + h1 * pexp) * (p/pexp) ^ h_exp
     protected :
      double _h1, _pexp, _hexp;
    
     public:
      // constructor
      LinearFollowedByPowerLawJ2IsotropicHardening(const int num,  double yield0, double h, double pexp, double hexp, bool init=true);
    #ifndef SWIG
      virtual ~LinearFollowedByPowerLawJ2IsotropicHardening(){}
      LinearFollowedByPowerLawJ2IsotropicHardening(const LinearFollowedByPowerLawJ2IsotropicHardening &source);
      LinearFollowedByPowerLawJ2IsotropicHardening& operator=(const J2IsotropicHardening &source);
      virtual int getNum() const{return _num;}
      virtual hardeningname getType() const{return J2IsotropicHardening::linearFollowedByPowerLawJ2IsotropicHardening; };
      virtual void createIPVariable(IPJ2IsotropicHardening* &ipv) const;
      virtual void initLaws(const std::map<int,J2IsotropicHardening*> &maplaw) {}; //nothing now, we will see if we use the mapping
      virtual void hardening(double p, IPJ2IsotropicHardening &ipv) const;
      virtual J2IsotropicHardening * clone() const;
    #endif
    };
    
    
    class PolynomialJ2IsotropicHardening : public J2IsotropicHardening{
      #ifndef SWIG
      protected:
        int _order; // order of polymonial
        fullVector<double> _coefficients; // coeff of polymonial _coefficients(0)+_coefficients(1)*eps+...
      #endif // SWIG
    
      public:
      PolynomialJ2IsotropicHardening(const int num, double yield0, int order,  bool init = true);
      void setCoefficients(const int i, const double val);
      #ifndef SWIG
      virtual ~PolynomialJ2IsotropicHardening(){}
      PolynomialJ2IsotropicHardening(const PolynomialJ2IsotropicHardening& src);
      PolynomialJ2IsotropicHardening& operator =(const J2IsotropicHardening& src);
      virtual int getNum() const{return _num;}
      virtual hardeningname getType() const{return J2IsotropicHardening::polynomialJ2IsotropicHardening; };
      virtual void createIPVariable(IPJ2IsotropicHardening* &ipv) const;
      virtual void initLaws(const std::map<int,J2IsotropicHardening*> &maplaw) {}; //nothing now, we will see if we use the mapping
      virtual void hardening(double p, IPJ2IsotropicHardening &ipv) const;
      virtual J2IsotropicHardening * clone() const;
      #endif // SWIG
    };
    
    class TwoExpJ2IsotropicHaderning : public J2IsotropicHardening{
      // R = K(exp(p)-exp(-2*p))
      #ifndef SWIG
      protected:
        double _K;
      #endif // SWIG
      public:
        TwoExpJ2IsotropicHaderning(const int num,  double yield0, double K, bool init=true);
      #ifndef SWIG
        virtual ~TwoExpJ2IsotropicHaderning(){}
        TwoExpJ2IsotropicHaderning(const TwoExpJ2IsotropicHaderning& src);
        TwoExpJ2IsotropicHaderning& operator =(const J2IsotropicHardening& src);
        virtual int getNum() const{return _num;}
        virtual hardeningname getType() const{return J2IsotropicHardening::twoExpJ2IsotropicHaderning; };
        virtual void createIPVariable(IPJ2IsotropicHardening* &ipv) const;
        virtual void initLaws(const std::map<int,J2IsotropicHardening*> &maplaw) {}; //nothing now, we will see if we use the mapping
        virtual void hardening(double p, IPJ2IsotropicHardening &ipv) const;
        virtual J2IsotropicHardening * clone() const;
      #endif // SWIG
    };
    
    class TanhJ2IsotropicHardening : public J2IsotropicHardening{
      // R = K*tang(p/p0);
      protected:
        double _K;
        double _p0;
    
      public:
        TanhJ2IsotropicHardening(const int num, double y0, double K, double p0, bool init = true);
        #ifndef SWIG
        virtual ~TanhJ2IsotropicHardening(){}
        TanhJ2IsotropicHardening(const TanhJ2IsotropicHardening& src);
        TanhJ2IsotropicHardening& operator =(const J2IsotropicHardening& src);
        virtual int getNum() const{return _num;}
        virtual hardeningname getType() const{return J2IsotropicHardening::tanhJ2IsotropicHaderning; };
        virtual void createIPVariable(IPJ2IsotropicHardening* &ipv) const;
        virtual void initLaws(const std::map<int,J2IsotropicHardening*> &maplaw) {}; //nothing now, we will see if we use the mapping
        virtual void hardening(double p, IPJ2IsotropicHardening &ipv) const;
        virtual J2IsotropicHardening * clone() const;
      #endif // SWIG
    };
    
    #endif //J2ISOTROPICHARDENING_H_