Skip to content
Snippets Groups Projects
Commit 2efa9acc authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix

parent 70fc390b
Branches
Tags
No related merge requests found
// Gmsh - Copyright (C) 1997-2016 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@onelab.info>.
#include <stdlib.h> #include <stdlib.h>
#include <vector> #include <vector>
// general // general
...@@ -30,7 +35,9 @@ ...@@ -30,7 +35,9 @@
// triangles are defining the boundary // triangles are defining the boundary
// internal points are allowed // internal points are allowed
// This has been done for HEXTREME // This has been done for HEXTREME
GRegion * createDiscreteRegionFromRawData ( GModel *gm, fullMatrix<double> & pts, fullMatrix<int> &triangles) { GRegion * createDiscreteRegionFromRawData(GModel *gm, fullMatrix<double> &pts,
fullMatrix<int> &triangles)
{
GRegion *gr = new discreteRegion(gm, NEWREG()); GRegion *gr = new discreteRegion(gm, NEWREG());
GFace *gf = new discreteFace(gm, NEWREG()); GFace *gf = new discreteFace(gm, NEWREG());
gm->add(gr); gm->add(gr);
...@@ -38,8 +45,8 @@ GRegion * createDiscreteRegionFromRawData ( GModel *gm, fullMatrix<double> & pt ...@@ -38,8 +45,8 @@ GRegion * createDiscreteRegionFromRawData ( GModel *gm, fullMatrix<double> & pt
std::list<GFace*> faces; faces.push_back(gf); gr->set(faces); std::list<GFace*> faces; faces.push_back(gf); gr->set(faces);
// get boundary nodes // get boundary nodes
std::set<int> bnd; std::set<int> bnd;
int nbTriangles = triangles.size1(); unsigned int nbTriangles = triangles.size1();
int nbPts = pts.size1(); unsigned int nbPts = pts.size1();
for (unsigned int i = 0; i < nbTriangles; i++) { for (unsigned int i = 0; i < nbTriangles; i++) {
bnd.insert(triangles(i, 0)); bnd.insert(triangles(i, 0));
bnd.insert(triangles(i, 1)); bnd.insert(triangles(i, 1));
...@@ -73,8 +80,9 @@ GRegion * createDiscreteRegionFromRawData ( GModel *gm, fullMatrix<double> & pt ...@@ -73,8 +80,9 @@ GRegion * createDiscreteRegionFromRawData ( GModel *gm, fullMatrix<double> & pt
return gr; return gr;
} }
GRegion * createTetrahedralMesh ( GModel *gm, fullMatrix<double> & pts, fullMatrix<int> &triangles ) { GRegion *createTetrahedralMesh(GModel *gm, fullMatrix<double> &pts,
fullMatrix<int> &triangles)
{
GRegion *gr = createDiscreteRegionFromRawData(gm, pts, triangles); GRegion *gr = createDiscreteRegionFromRawData(gm, pts, triangles);
try{ try{
meshGRegionBoundaryRecovery(gr); meshGRegionBoundaryRecovery(gr);
...@@ -87,7 +95,5 @@ GRegion * createTetrahedralMesh ( GModel *gm, fullMatrix<double> & pts, fullMatr ...@@ -87,7 +95,5 @@ GRegion * createTetrahedralMesh ( GModel *gm, fullMatrix<double> & pts, fullMatr
Msg::Error("Could not recover boundary: error %d", err); Msg::Error("Could not recover boundary: error %d", err);
} }
} }
return gr;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment