Skip to content
Snippets Groups Projects
Commit 73130312 authored by Van Dung NGUYEN's avatar Van Dung NGUYEN
Browse files

remove all unecessary functions

parent 120b4bcf
No related branches found
No related tags found
1 merge request!20Master
...@@ -98,7 +98,6 @@ macromat1.dirichletBC("Face",11,2,0.) ...@@ -98,7 +98,6 @@ macromat1.dirichletBC("Face",11,2,0.)
lcohNum = 13 lcohNum = 13
lawCoh = dG3DMultiscaleCohesiveLaw(lcohNum,0.7) lawCoh = dG3DMultiscaleCohesiveLaw(lcohNum,0.7)
lawCoh.setCharacteristicLength(1.) lawCoh.setCharacteristicLength(1.)
lawCoh.setExtractCohesiveLawFromMicroDamage(True)
lawCoh.setLostSolutionUniquenssTolerance(0.) lawCoh.setLostSolutionUniquenssTolerance(0.)
macromeshfile="model.msh" # name of mesh file macromeshfile="model.msh" # name of mesh file
......
...@@ -226,7 +226,7 @@ void MultiscaleFractureByCohesive3DLaw::createIPState(const bool isSolve, IPStat ...@@ -226,7 +226,7 @@ void MultiscaleFractureByCohesive3DLaw::createIPState(const bool isSolve, IPStat
// if bulk law is a multiscale law // if bulk law is a multiscale law
int el = ele->getNum(); int el = ele->getNum();
nonLinearMechSolver* solver = this->createMicroSolver(el,gpt); nonLinearMechSolver* solver = this->createMicroSolver(el,gpt);
const GeneralBulkFollwedCohesive3DLaw* interfaceLaw = dynamic_cast<const GeneralBulkFollwedCohesive3DLaw*>(_mfrac); const GeneralMultiscaleBulkFollwedCohesive3DLaw* interfaceLaw = dynamic_cast<const GeneralMultiscaleBulkFollwedCohesive3DLaw*>(_mfrac);
if (interfaceLaw != NULL){ if (interfaceLaw != NULL){
if (interfaceLaw->isDamageToCohesiveJump()){ if (interfaceLaw->isDamageToCohesiveJump()){
printf("rank %d : extract cohesive law at element %d ip %d \n",Msg::GetCommRank(),el,gpt); printf("rank %d : extract cohesive law at element %d ip %d \n",Msg::GetCommRank(),el,gpt);
...@@ -285,17 +285,11 @@ void MultiscaleFractureByCohesive3DLaw::stress(IPVariable*ipv, const IPVariable* ...@@ -285,17 +285,11 @@ void MultiscaleFractureByCohesive3DLaw::stress(IPVariable*ipv, const IPVariable*
GeneralBulkFollwedCohesive3DLaw::GeneralBulkFollwedCohesive3DLaw(const int num, const bool init):Cohesive3DLaw(num,init), GeneralBulkFollwedCohesive3DLaw::GeneralBulkFollwedCohesive3DLaw(const int num, const bool init):Cohesive3DLaw(num,init),
_L(0.),_damageToCohesiveJump(false), _stressExtractLocation(-1),_lostSolutionUniquenssTolerance(0.), _L(0.),_lostSolutionUniquenssTolerance(0.){};
_voidPartInLocalizationBand(0.),_rotateRVEFollowingInterfaceNormal(false){};
GeneralBulkFollwedCohesive3DLaw::GeneralBulkFollwedCohesive3DLaw(const GeneralBulkFollwedCohesive3DLaw& src): GeneralBulkFollwedCohesive3DLaw::GeneralBulkFollwedCohesive3DLaw(const GeneralBulkFollwedCohesive3DLaw& src):
Cohesive3DLaw(src),_L(src._L), _damageToCohesiveJump(src._damageToCohesiveJump),_stressExtractLocation(src._stressExtractLocation), Cohesive3DLaw(src),_L(src._L),
_lostSolutionUniquenssTolerance(src._lostSolutionUniquenssTolerance), _lostSolutionUniquenssTolerance(src._lostSolutionUniquenssTolerance){}
_voidPartInLocalizationBand(src._voidPartInLocalizationBand),
_rotateRVEFollowingInterfaceNormal(src._rotateRVEFollowingInterfaceNormal){}
void GeneralBulkFollwedCohesive3DLaw::setExtractCohesiveLawFromMicroDamage(const bool flag){
_damageToCohesiveJump = flag;
};
void GeneralBulkFollwedCohesive3DLaw::setLostSolutionUniquenssTolerance(const double tol){ void GeneralBulkFollwedCohesive3DLaw::setLostSolutionUniquenssTolerance(const double tol){
_lostSolutionUniquenssTolerance = tol; _lostSolutionUniquenssTolerance = tol;
...@@ -317,9 +311,15 @@ void GeneralBulkFollwedCohesive3DLaw::createIPVariable(IPVariable* &ipv,const ME ...@@ -317,9 +311,15 @@ void GeneralBulkFollwedCohesive3DLaw::createIPVariable(IPVariable* &ipv,const ME
ipv = new BulkFollowedCohesive3DIPVariable(); ipv = new BulkFollowedCohesive3DIPVariable();
} }
GeneralMultiscaleBulkFollwedCohesive3DLaw::GeneralMultiscaleBulkFollwedCohesive3DLaw(const int num, const bool init):GeneralBulkFollwedCohesive3DLaw(num,init){}; GeneralMultiscaleBulkFollwedCohesive3DLaw::GeneralMultiscaleBulkFollwedCohesive3DLaw(const int num, const bool init):
GeneralBulkFollwedCohesive3DLaw(num,init),
_stressExtractLocation(-1),_voidPartInLocalizationBand(0.),_rotateRVEFollowingInterfaceNormal(false)
{};
GeneralMultiscaleBulkFollwedCohesive3DLaw::GeneralMultiscaleBulkFollwedCohesive3DLaw(const GeneralMultiscaleBulkFollwedCohesive3DLaw& src): GeneralMultiscaleBulkFollwedCohesive3DLaw::GeneralMultiscaleBulkFollwedCohesive3DLaw(const GeneralMultiscaleBulkFollwedCohesive3DLaw& src):
GeneralBulkFollwedCohesive3DLaw(src){} GeneralBulkFollwedCohesive3DLaw(src),
_stressExtractLocation(src._stressExtractLocation),
_voidPartInLocalizationBand(src._voidPartInLocalizationBand),
_rotateRVEFollowingInterfaceNormal(src._rotateRVEFollowingInterfaceNormal){}
void GeneralMultiscaleBulkFollwedCohesive3DLaw::createIPState(IPStateBase* &ips,const bool* state_, void GeneralMultiscaleBulkFollwedCohesive3DLaw::createIPState(IPStateBase* &ips,const bool* state_,
const MElement *ele, const int nbFF_, const IntPt *GP, const int gpt) const const MElement *ele, const int nbFF_, const IntPt *GP, const int gpt) const
...@@ -338,7 +338,8 @@ void GeneralMultiscaleBulkFollwedCohesive3DLaw::createIPVariable(IPVariable* &ip ...@@ -338,7 +338,8 @@ void GeneralMultiscaleBulkFollwedCohesive3DLaw::createIPVariable(IPVariable* &ip
dG3DMultiscaleCohesiveLaw::dG3DMultiscaleCohesiveLaw(const int num, const double surfaceRatio): dG3DMultiscaleCohesiveLaw::dG3DMultiscaleCohesiveLaw(const int num, const double surfaceRatio):
GeneralMultiscaleBulkFollwedCohesive3DLaw(num,true),_surfaceReductionRatio(surfaceRatio){}; GeneralMultiscaleBulkFollwedCohesive3DLaw(num,true),_surfaceReductionRatio(surfaceRatio)
{};
dG3DMultiscaleCohesiveLaw::dG3DMultiscaleCohesiveLaw(const dG3DMultiscaleCohesiveLaw& src): dG3DMultiscaleCohesiveLaw::dG3DMultiscaleCohesiveLaw(const dG3DMultiscaleCohesiveLaw& src):
GeneralMultiscaleBulkFollwedCohesive3DLaw(src),_surfaceReductionRatio(src._surfaceReductionRatio){} GeneralMultiscaleBulkFollwedCohesive3DLaw(src),_surfaceReductionRatio(src._surfaceReductionRatio){}
......
...@@ -127,11 +127,7 @@ class MultiscaleFractureByCohesive3DLaw : public FractureByCohesive3DLaw, ...@@ -127,11 +127,7 @@ class MultiscaleFractureByCohesive3DLaw : public FractureByCohesive3DLaw,
class GeneralBulkFollwedCohesive3DLaw : public Cohesive3DLaw{ class GeneralBulkFollwedCohesive3DLaw : public Cohesive3DLaw{
protected: protected:
double _L; // RVE length perpendicular to the localization band double _L; // RVE length perpendicular to the localization band
bool _damageToCohesiveJump; // can be modifed during creating microscopic solver-->avoid problems with readonly function
double _lostSolutionUniquenssTolerance; double _lostSolutionUniquenssTolerance;
int _stressExtractLocation;
double _voidPartInLocalizationBand;
bool _rotateRVEFollowingInterfaceNormal; // true if performing rotation of RVE following local basis
public: public:
#ifndef SWIG #ifndef SWIG
...@@ -148,22 +144,21 @@ class GeneralBulkFollwedCohesive3DLaw : public Cohesive3DLaw{ ...@@ -148,22 +144,21 @@ class GeneralBulkFollwedCohesive3DLaw : public Cohesive3DLaw{
virtual void transferInterfaceDataToBulk(IPVariable* ipv, const IPVariable* ipvprev, const bool stiff) const = 0; virtual void transferInterfaceDataToBulk(IPVariable* ipv, const IPVariable* ipvprev, const bool stiff) const = 0;
virtual bool brokenCheck(IPVariable* ipv) const =0; virtual bool brokenCheck(IPVariable* ipv) const =0;
virtual materialLaw* clone() const = 0; virtual materialLaw* clone() const = 0;
bool isDamageToCohesiveJump() const {return _damageToCohesiveJump;};
double getLostSolutionUniquenssTolerance() const {return _lostSolutionUniquenssTolerance;}; double getLostSolutionUniquenssTolerance() const {return _lostSolutionUniquenssTolerance;};
int getLocationForStressExtraction() const {return _stressExtractLocation;};
bool getRotationOfRVEFollowingInterfaceLocalBasis() const {return _rotateRVEFollowingInterfaceNormal;};
#endif // SWIG #endif // SWIG
void setCharacteristicLength(const double L) {_L= L;} void setCharacteristicLength(const double L) {_L= L;}
void setExtractCohesiveLawFromMicroDamage(const bool flag);
void setLostSolutionUniquenssTolerance(const double tol); void setLostSolutionUniquenssTolerance(const double tol);
void setLocationForStressExtraction(const int loc){_stressExtractLocation = loc;};
void setVoidPartInLocalizationBand(const double vp){_voidPartInLocalizationBand = vp;};
void setRotationOfRVEFollowingInterfaceLocalBasis(const bool fl) {_rotateRVEFollowingInterfaceNormal = fl;};
}; };
class GeneralMultiscaleBulkFollwedCohesive3DLaw : public GeneralBulkFollwedCohesive3DLaw{ class GeneralMultiscaleBulkFollwedCohesive3DLaw : public GeneralBulkFollwedCohesive3DLaw{
protected:
int _stressExtractLocation;
double _voidPartInLocalizationBand;
bool _rotateRVEFollowingInterfaceNormal; // true if performing rotation of RVE following local basis
public: public:
#ifndef SWIG #ifndef SWIG
GeneralMultiscaleBulkFollwedCohesive3DLaw(const int num, const bool init = true); GeneralMultiscaleBulkFollwedCohesive3DLaw(const int num, const bool init = true);
...@@ -178,7 +173,16 @@ class GeneralMultiscaleBulkFollwedCohesive3DLaw : public GeneralBulkFollwedCohes ...@@ -178,7 +173,16 @@ class GeneralMultiscaleBulkFollwedCohesive3DLaw : public GeneralBulkFollwedCohes
virtual void checkCohesiveInsertion(IPStateBase* ipsm, IPStateBase* ipsp, const bool forcedInsert= false) const = 0; virtual void checkCohesiveInsertion(IPStateBase* ipsm, IPStateBase* ipsp, const bool forcedInsert= false) const = 0;
virtual void transferInterfaceDataToBulk(IPVariable* ipv, const IPVariable* ipvprev, const bool stiff) const = 0; virtual void transferInterfaceDataToBulk(IPVariable* ipv, const IPVariable* ipvprev, const bool stiff) const = 0;
virtual materialLaw* clone() const = 0; virtual materialLaw* clone() const = 0;
virtual bool isDamageToCohesiveJump() const = 0;
int getLocationForStressExtraction() const {return _stressExtractLocation;};
bool getRotationOfRVEFollowingInterfaceLocalBasis() const {return _rotateRVEFollowingInterfaceNormal;};
#endif // SWIG #endif // SWIG
void setLocationForStressExtraction(const int loc){_stressExtractLocation = loc;};
void setVoidPartInLocalizationBand(const double vp){_voidPartInLocalizationBand = vp;};
void setRotationOfRVEFollowingInterfaceLocalBasis(const bool fl) {_rotateRVEFollowingInterfaceNormal = fl;};
}; };
class dG3DMultiscaleCohesiveLaw : public GeneralMultiscaleBulkFollwedCohesive3DLaw { class dG3DMultiscaleCohesiveLaw : public GeneralMultiscaleBulkFollwedCohesive3DLaw {
...@@ -194,6 +198,7 @@ class dG3DMultiscaleCohesiveLaw : public GeneralMultiscaleBulkFollwedCohesive3DL ...@@ -194,6 +198,7 @@ class dG3DMultiscaleCohesiveLaw : public GeneralMultiscaleBulkFollwedCohesive3DL
virtual void checkCohesiveInsertion(IPStateBase* ipsm, IPStateBase* ipsp, const bool forcedInsert= false) const; virtual void checkCohesiveInsertion(IPStateBase* ipsm, IPStateBase* ipsp, const bool forcedInsert= false) const;
virtual void transferInterfaceDataToBulk(IPVariable* ipv, const IPVariable* ipvprev, const bool stiff) const; virtual void transferInterfaceDataToBulk(IPVariable* ipv, const IPVariable* ipvprev, const bool stiff) const;
virtual materialLaw* clone() const {return new dG3DMultiscaleCohesiveLaw(*this);}; virtual materialLaw* clone() const {return new dG3DMultiscaleCohesiveLaw(*this);};
virtual bool isDamageToCohesiveJump() const {return false;}
#endif // SWIG #endif // SWIG
}; };
...@@ -211,6 +216,7 @@ class TwoFieldMultiscaleCohesive3DLaw : public GeneralMultiscaleBulkFollwedCohes ...@@ -211,6 +216,7 @@ class TwoFieldMultiscaleCohesive3DLaw : public GeneralMultiscaleBulkFollwedCohes
virtual void checkCohesiveInsertion(IPStateBase* ipsm, IPStateBase* ipsp, const bool forcedInsert= false) const; virtual void checkCohesiveInsertion(IPStateBase* ipsm, IPStateBase* ipsp, const bool forcedInsert= false) const;
virtual void transferInterfaceDataToBulk(IPVariable* ipv, const IPVariable* ipvprev, const bool stiff) const; virtual void transferInterfaceDataToBulk(IPVariable* ipv, const IPVariable* ipvprev, const bool stiff) const;
virtual materialLaw* clone() const {return new TwoFieldMultiscaleCohesive3DLaw(*this);}; virtual materialLaw* clone() const {return new TwoFieldMultiscaleCohesive3DLaw(*this);};
virtual bool isDamageToCohesiveJump() const {return true;}
#endif // SWIG #endif // SWIG
}; };
...@@ -228,6 +234,7 @@ class TwoFieldMultiscaleAdhesive3DLaw : public GeneralMultiscaleBulkFollwedCohes ...@@ -228,6 +234,7 @@ class TwoFieldMultiscaleAdhesive3DLaw : public GeneralMultiscaleBulkFollwedCohes
virtual void checkCohesiveInsertion(IPStateBase* ipsm, IPStateBase* ipsp, const bool forcedInsert= false) const; virtual void checkCohesiveInsertion(IPStateBase* ipsm, IPStateBase* ipsp, const bool forcedInsert= false) const;
virtual void transferInterfaceDataToBulk(IPVariable* ipv, const IPVariable* ipvprev, const bool stiff) const; virtual void transferInterfaceDataToBulk(IPVariable* ipv, const IPVariable* ipvprev, const bool stiff) const;
virtual materialLaw* clone() const {return new TwoFieldMultiscaleAdhesive3DLaw(*this);}; virtual materialLaw* clone() const {return new TwoFieldMultiscaleAdhesive3DLaw(*this);};
virtual bool isDamageToCohesiveJump() const {return false;}
#endif // SWIG #endif // SWIG
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment