Skip to content
Snippets Groups Projects
Commit 513fd900 authored by Ludovic Noels's avatar Ludovic Noels
Browse files

make GModel as current

parent 0ad90d4d
No related branches found
No related tags found
No related merge requests found
......@@ -287,6 +287,7 @@ cutMeshByBox::cutMeshByBox(): _pModel(NULL),_g(NULL),_gVolume(NULL){}
void cutMeshByBox::addModel(std::string meshFileName){
_pModel = new GModel();
_pModel->setAsCurrent();
_pModel->readMSH(meshFileName.c_str());
int dim = _pModel->getNumRegions() ? 3 : 2;
_g = new elementGroup();
......
......@@ -20,6 +20,7 @@ getTotalVolume::~getTotalVolume(){
void getTotalVolume::loadModel(const std::string filename){
GModel* pModel = new GModel();
pModel->setAsCurrent(); //to check
pModel->readMSH(filename.c_str());
int dim = pModel->getNumRegions() ? 3 : 2;
std::map<int, std::vector<GEntity*> > groups[4];
......
......@@ -166,6 +166,7 @@ void imperfectionPart::addAllEntities(){
void imperfectionToMesh::loadModel(const std::string meshFileName)
{
_pModel = new GModel();
_pModel->setAsCurrent(); //to check
_pModel->readMSH(meshFileName.c_str());
_meshFileName = meshFileName;
}
......@@ -182,6 +183,7 @@ void imperfectionToMesh::addImperfection(imperfectionPart* ip){
void imperfectionToMesh::imposeImperfection(const std::string fname){
Msg::Info("Begin writing perturbed mesh");
GModel* dispgmodel = new GModel();
dispgmodel->setAsCurrent(); //to check
dispgmodel->readMSH(_meshFileName.c_str());
std::set<MVertex*> allPerturbedVertices;
for (int i=0; i<_allImperfectionPart.size(); i++){
......
......@@ -26,6 +26,7 @@ void meshModification::loadModel(const std::string meshFileName)
{
if (_pModel) delete _pModel;
_pModel = new GModel();
_pModel->setAsCurrent(); //to check
_pModel->readMSH(meshFileName.c_str());
_meshFileName = meshFileName;
};
......@@ -34,6 +35,7 @@ void meshModification::loadGeo(const std::string geoFile, int dimToMesh, int ord
{
if (_pModel) delete _pModel;
_pModel = new GModel();
_pModel->setAsCurrent(); //to check
_pModel->readGEO(geoFile);
// Overwrite options
CTX::instance()->mesh.order = order;
......@@ -314,6 +316,7 @@ void QuadToTriangle::loadModel(const std::string meshFileName)
{
if (_pModel) delete _pModel;
_pModel = new GModel();
_pModel->setAsCurrent(); //to check
_pModel->readMSH(meshFileName.c_str());
};
......
......@@ -17103,6 +17103,7 @@ void nonLinearMechSolver::setDisturbedEigenMode(int num, double val, bool flag){
void nonLinearMechSolver::writeDisturbedMeshByEigenVector(eigenSolver& eigS, int numberMode, double fact){
Msg::Info("Begin writing deformed mesh");
GModel* dispgmodel = new GModel();
dispgmodel->setAsCurrent();
dispgmodel->readMSH(_meshFileName.c_str());
std::set<MVertex*> computedVertex;
 
......@@ -17158,6 +17159,7 @@ void nonLinearMechSolver::setWriteDeformedMeshToFile(bool flag){
void nonLinearMechSolver::writeDeformedMesh(int step){
Msg::Info("Begin writing deformed mesh");
GModel* dispgmodel = new GModel();
dispgmodel->setAsCurrent();
dispgmodel->readMSH(_meshFileName.c_str());
std::set<MVertex*> computedVertex;
 
......
......@@ -13,6 +13,7 @@
showDataOnMesh::showDataOnMesh(const std::string meshFileName)
{
_pModel = new GModel();
_pModel->setAsCurrent(); //to check
_pModel->readMSH(meshFileName.c_str());
_meshFileName = meshFileName;
......@@ -35,6 +36,7 @@ void showDataOnMesh::dataOnPhysical(int dim, int phys, const std::string partMes
write_MSH2(_gr,partMeshFile.c_str());
_part = new GModel();
_part->setAsCurrent(); //to check
_part->readMSH(partMeshFile.c_str());
}
......
......@@ -28,6 +28,7 @@ strainMapping::~strainMapping(){
void strainMapping::readMesh(const std::string meshFileName){
_meshFileName = meshFileName;
_pModel = new GModel();
_pModel->setAsCurrent(); //to check
_pModel->readMSH(meshFileName.c_str());
int dim = _pModel->getNumRegions() ? 3 : 2;
_g = new elementGroup();
......
......@@ -118,6 +118,7 @@ void GeometryRotation::exportRotatedModel(const double e1x, const double e1y, co
n3.normalize();
GModel* pModel = new GModel();
pModel->setAsCurrent(); //to check
pModel->readMSH(inMeshFile.c_str());
pModel->setFileName(inMeshFile);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment