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

Merge branch 'vdg-cm3'

parents 056d4691 e0158a33
Branches
Tags
No related merge requests found
...@@ -155,17 +155,25 @@ nonLinearMechSolver* numericalMaterial::createMicroSolver(const int ele, const i ...@@ -155,17 +155,25 @@ nonLinearMechSolver* numericalMaterial::createMicroSolver(const int ele, const i
std::map<int,int>::const_iterator itm = _meshIdMap.find(type); std::map<int,int>::const_iterator itm = _meshIdMap.find(type);
if (itm == _meshIdMap.end() or _allPertMesh.size() ==0){ if (itm == _meshIdMap.end() or _allPertMesh.size() ==0){
/**load model**/ /**load model**/
if (_microMeshFile.length() >0){ std::map<int,std::string>::const_iterator itMestConstraint = _meshOnIP.find(type);
Msg::Info("create model from mesh file %s",_microMeshFile.c_str()); if (itMestConstraint == _meshOnIP.end()){
solver->loadModel(_microMeshFile); if (_microMeshFile.length() >0){
} Msg::Info("create model from mesh file %s",_microMeshFile.c_str());
else if (_microGeoFile.length()>0 ){ solver->loadModel(_microMeshFile);
Msg::Info("create model from geometry file %s",_microGeoFile.c_str()); }
solver->createMicroModel(_microGeoFile,_meshDim,_meshOrder,_meshIncomplete); else if (_microGeoFile.length()>0 ){
} Msg::Info("create model from geometry file %s",_microGeoFile.c_str());
else{ solver->createMicroModel(_microGeoFile,_meshDim,_meshOrder,_meshIncomplete);
Msg::Fatal("micro model file must be provided: proc %d, ele %d, GP %d",Msg::GetCommRank(),ele,gpt); }
} else{
Msg::Fatal("micro model file must be provided: proc %d, ele %d, GP %d",Msg::GetCommRank(),ele,gpt);
}
}
else{
std::string mshFile = itMestConstraint->second;
printf("create model from mesh file %s \n",mshFile.c_str());
solver->loadModel(mshFile);
}
} }
else{ else{
std::map<int,std::string>::const_iterator itstr = _allPertMesh.find(itm->second); std::map<int,std::string>::const_iterator itstr = _allPertMesh.find(itm->second);
...@@ -329,6 +337,12 @@ void numericalMaterial::addMaterialLaw(materialLaw* mlaw){ ...@@ -329,6 +337,12 @@ void numericalMaterial::addMaterialLaw(materialLaw* mlaw){
_allMaterialLaw.push_back(mlaw); _allMaterialLaw.push_back(mlaw);
}; };
void numericalMaterial::addPertutationalMeshIP(const int ele, const int ip, const std::string meshfile){
Msg::Info("pert mesh it element %d ip %d",ele,ip);
int type = numericalMaterial::createTypeWithTwoInts(ele,ip);
_meshOnIP[type] = meshfile;
};
void numericalMaterial::setPerturbationMaterialLawIP(const int ele, const int ip){ void numericalMaterial::setPerturbationMaterialLawIP(const int ele, const int ip){
int num = numericalMaterial::createTypeWithTwoInts(ele,ip); int num = numericalMaterial::createTypeWithTwoInts(ele,ip);
_pertMaterialLawIP.insert(num); _pertMaterialLawIP.insert(num);
......
...@@ -125,6 +125,8 @@ class numericalMaterial : public numericalMaterialBase{ ...@@ -125,6 +125,8 @@ class numericalMaterial : public numericalMaterialBase{
std::map<int,int> _meshIdMap; // mesh id map, std::map<int,int> _meshIdMap; // mesh id map,
std::map<int,std::string>::iterator _idIterator;// iterator to acces meshes std::map<int,std::string>::iterator _idIterator;// iterator to acces meshes
std::map<int,std::string> _allPertMesh; // all perturbed meshes std::map<int,std::string> _allPertMesh; // all perturbed meshes
std::map<int,std::string> _meshOnIP; // constraint mesh on each ip
std::string _microMeshFile; // micro meshfile std::string _microMeshFile; // micro meshfile
std::string _microGeoFile; // micro geometry std::string _microGeoFile; // micro geometry
...@@ -183,7 +185,7 @@ class numericalMaterial : public numericalMaterialBase{ ...@@ -183,7 +185,7 @@ class numericalMaterial : public numericalMaterialBase{
virtual ~numericalMaterial(); virtual ~numericalMaterial();
// create micro solver // create micro solver
virtual nonLinearMechSolver* createMicroSolver(const int ele=0, const int gpt=0) const; virtual nonLinearMechSolver* createMicroSolver(const int ele, const int gpt) const;
#endif #endif
// set micro meshes // set micro meshes
...@@ -196,7 +198,8 @@ class numericalMaterial : public numericalMaterialBase{ ...@@ -196,7 +198,8 @@ class numericalMaterial : public numericalMaterialBase{
virtual void addDomain(partDomain* domain); virtual void addDomain(partDomain* domain);
// set micro material law // set micro material law
virtual void addMaterialLaw(materialLaw* mlaw); virtual void addMaterialLaw(materialLaw* mlaw);
virtual void addPertutationalMeshIP(const int ele, const int ip, const std::string meshfile);
virtual void setPerturbationMaterialLawIP(const int ele, const int ip); virtual void setPerturbationMaterialLawIP(const int ele, const int ip);
virtual void addPerturbationMaterialLaw(materialLaw* mlaw); virtual void addPerturbationMaterialLaw(materialLaw* mlaw);
// set micro periodicity // set micro periodicity
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment