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

add view solver gp

parent 773ae7ef
Branches
Tags
1 merge request!151Master
...@@ -273,11 +273,14 @@ void MultiscaleFractureByCohesive3DLaw::createIPState(const bool isSolve, IPStat ...@@ -273,11 +273,14 @@ void MultiscaleFractureByCohesive3DLaw::createIPState(const bool isSolve, IPStat
int el = ele->getNum(); int el = ele->getNum();
// need to known // need to known
if (_nummat->allInterfacesAreViewed()){ if (_nummat->allInterfacesAreViewed()){
std::set<int>::const_iterator itF = _nummat->getInterfaceGPsToAllView().find(gpt);
if (itF != _nummat->getInterfaceGPsToAllView().end()){
_nummat->setViewAllMicroProblems(el,gpt); _nummat->setViewAllMicroProblems(el,gpt);
} }
}
else{ else{
TwoNum tn = this->getMacroSolver()->getMinusAndPlusElementNumber(el); TwoNum tn = this->getMacroSolver()->getMinusAndPlusElementNumber(el);
std::map<TwoNum,std::set<int> >::const_iterator itF = _nummat->getInterfaceElementsToView().find(tn); const std::map<TwoNum,std::set<int> >::const_iterator itF = _nummat->getInterfaceElementsToView().find(tn);
if ( itF != _nummat->getInterfaceElementsToView().end()){ if ( itF != _nummat->getInterfaceElementsToView().end()){
const std::set<int>& gpToView = itF->second; const std::set<int>& gpToView = itF->second;
if (gpToView.find(gpt) != gpToView.end()){ if (gpToView.find(gpt) != gpToView.end()){
... ...
......
...@@ -16,8 +16,11 @@ void dG3DMultiscaleMaterialLawBase::setViewInterfaceElement(const int em, const ...@@ -16,8 +16,11 @@ void dG3DMultiscaleMaterialLawBase::setViewInterfaceElement(const int em, const
gpToView.insert(gp); gpToView.insert(gp);
}; };
void dG3DMultiscaleMaterialLawBase::setViewAllInterfaceElements(const bool fl){ void dG3DMultiscaleMaterialLawBase::setViewAllInterfaceElements(const bool fl, const int gp){
_allInterfacesAreViewed = fl; _allInterfacesAreViewed = fl;
if (_allInterfacesAreViewed){
_interfaceGPsToAllView.insert(gp);
}
}; };
dG3DMultiscaleMaterialLawBase::dG3DMultiscaleMaterialLawBase(const int lnum, const int tag) dG3DMultiscaleMaterialLawBase::dG3DMultiscaleMaterialLawBase(const int lnum, const int tag)
... ...
......
...@@ -22,6 +22,7 @@ class dG3DMultiscaleMaterialLawBase : public dG3DMaterialLaw, public numericalMa ...@@ -22,6 +22,7 @@ class dG3DMultiscaleMaterialLawBase : public dG3DMaterialLaw, public numericalMa
protected: protected:
std::map<TwoNum, std::set<int> > _interfaceElementsToView; std::map<TwoNum, std::set<int> > _interfaceElementsToView;
bool _allInterfacesAreViewed; bool _allInterfacesAreViewed;
std::set<int> _interfaceGPsToAllView;
public: public:
...@@ -32,7 +33,8 @@ class dG3DMultiscaleMaterialLawBase : public dG3DMaterialLaw, public numericalMa ...@@ -32,7 +33,8 @@ class dG3DMultiscaleMaterialLawBase : public dG3DMaterialLaw, public numericalMa
_lostSolutionUniquenssTolerance(src._lostSolutionUniquenssTolerance), _lostSolutionUniquenssTolerance(src._lostSolutionUniquenssTolerance),
_failureCrFollowingInterfaceNormal(src._failureCrFollowingInterfaceNormal), _failureCrFollowingInterfaceNormal(src._failureCrFollowingInterfaceNormal),
_allInterfacesAreViewed(src._allInterfacesAreViewed), _allInterfacesAreViewed(src._allInterfacesAreViewed),
_interfaceElementsToView(src._interfaceElementsToView) {}; _interfaceElementsToView(src._interfaceElementsToView),
_interfaceGPsToAllView(src._interfaceGPsToAllView) {};
virtual bool withEnergyDissipation() const { virtual bool withEnergyDissipation() const {
for (int i=0; i< _allMaterialLaw.size(); i++){ for (int i=0; i< _allMaterialLaw.size(); i++){
...@@ -49,6 +51,7 @@ class dG3DMultiscaleMaterialLawBase : public dG3DMaterialLaw, public numericalMa ...@@ -49,6 +51,7 @@ class dG3DMultiscaleMaterialLawBase : public dG3DMaterialLaw, public numericalMa
const MElement *ele=NULL, const int nbFF_=0, const IntPt *GP=NULL, const int gpt=0) const=0; const MElement *ele=NULL, const int nbFF_=0, const IntPt *GP=NULL, const int gpt=0) const=0;
const std::map<TwoNum, std::set<int> >& getInterfaceElementsToView() const {return _interfaceElementsToView;}; const std::map<TwoNum, std::set<int> >& getInterfaceElementsToView() const {return _interfaceElementsToView;};
const std::set<int> getInterfaceGPsToAllView() const {return _interfaceGPsToAllView;};
bool allInterfacesAreViewed() const {return _allInterfacesAreViewed;} bool allInterfacesAreViewed() const {return _allInterfacesAreViewed;}
#endif //SWIG #endif //SWIG
protected: protected:
...@@ -64,7 +67,7 @@ class dG3DMultiscaleMaterialLawBase : public dG3DMaterialLaw, public numericalMa ...@@ -64,7 +67,7 @@ class dG3DMultiscaleMaterialLawBase : public dG3DMaterialLaw, public numericalMa
double getBlockDamageAfterFailureOnsetTolerance() const{return _lostSolutionUniquenssTolerance;} double getBlockDamageAfterFailureOnsetTolerance() const{return _lostSolutionUniquenssTolerance;}
bool getFailureCheckFollowingInterfaceNormal() const{return _blockDamageAfterFailureOnset;}; bool getFailureCheckFollowingInterfaceNormal() const{return _blockDamageAfterFailureOnset;};
void setViewInterfaceElement(const int em, const int ep, const int gp); void setViewInterfaceElement(const int em, const int ep, const int gp);
void setViewAllInterfaceElements(const bool fl); void setViewAllInterfaceElements(const bool fl, const int gp=0);
}; };
class dG3DElasticMultiscaleMaterialLaw : public dG3DMultiscaleMaterialLawBase{ class dG3DElasticMultiscaleMaterialLaw : public dG3DMultiscaleMaterialLawBase{
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment