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

add pertur mesh at a specific IP

parent 8213aeac
No related branches found
No related tags found
No related merge requests found
...@@ -155,6 +155,8 @@ nonLinearMechSolver* numericalMaterial::createMicroSolver(const int ele, const i ...@@ -155,6 +155,8 @@ 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**/
std::map<int,std::string>::const_iterator itMestConstraint = _meshOnIP.find(type);
if (itMestConstraint == _meshOnIP.end()){
if (_microMeshFile.length() >0){ if (_microMeshFile.length() >0){
Msg::Info("create model from mesh file %s",_microMeshFile.c_str()); Msg::Info("create model from mesh file %s",_microMeshFile.c_str());
solver->loadModel(_microMeshFile); solver->loadModel(_microMeshFile);
...@@ -167,6 +169,12 @@ nonLinearMechSolver* numericalMaterial::createMicroSolver(const int ele, const i ...@@ -167,6 +169,12 @@ nonLinearMechSolver* numericalMaterial::createMicroSolver(const int ele, const i
Msg::Fatal("micro model file must be provided: proc %d, ele %d, GP %d",Msg::GetCommRank(),ele,gpt); 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);
std::string mshFile = itstr->second; std::string mshFile = itstr->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);
......
...@@ -126,6 +126,8 @@ class numericalMaterial : public numericalMaterialBase{ ...@@ -126,6 +126,8 @@ class numericalMaterial : public numericalMaterialBase{
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
int _meshOrder; // mesh ord int _meshOrder; // mesh ord
...@@ -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
...@@ -197,6 +199,7 @@ class numericalMaterial : public numericalMaterialBase{ ...@@ -197,6 +199,7 @@ class numericalMaterial : public numericalMaterialBase{
// 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