<div dir="ltr"><div><div><div><div><div><div>Hello all,<br><br></div>I have a version of gmsh (3.0.4) almost fully integrated into my applciation. I have the source code directly in the project and I am not using gmsh as a library/<br><br></div>Anyways, I am not sure if I discovered a bug in the source code or if I am doing something incorrectly. Either way, I would like to get to the bottom of this. After I generate a mesh, I call this function(p_meshModel->indexMeshVertices(true);) in order to index all of the mesh indicies to prepare the model for me to access the mesh elements.<br><br></div>I need to access this data so that I can display the final mesh onto the screen for the user to see. I am doing this rather simply since I am working with OPENGL. Once the mesh is generated and indexed, I access the mesh elements by the tags. I have pasted the code snippet that I use to access the mesh elements<br><br>        p_modelMesh->getEntities(entityList, 4);<br>        <br>        glBegin(GL_LINES);<br>            int numOfElements = 0;<br>            for(unsigned int i = 0; i < entityList.size(); i++)<br>            {<br>                int temp = entityList[i]->getNumMeshElements();    <br>                for(unsigned int j = 0; j < entityList[i]->getNumMeshElements(); j++)<br>                {<br>                    numOfElements++;<br>                    int test = entityList[i]->getMeshElement(j)->getNumVertices() - 1;<br>                    for(unsigned int k = 0; k < entityList[i]->getMeshElement(j)->getNumVertices() - 1; k++)<br>                    {<br>                        glVertex2d(entityList[i]->getMeshElement(j)->getVertex(k)->x(), entityList[i]->getMeshElement(j)->getVertex(k)->y());<br>                        glVertex2d(entityList[i]->getMeshElement(j)->getVertex(k + 1)->x(), entityList[i]->getMeshElement(j)->getVertex(k + 1)->y());<br>                    }<br>                }<br>            }<br><br></div>Now, the error that I am seeing is that not all of the mesh elements are drawn on the screen. However, if I were the export the mesh as a VTK file, all of the mesh elements are exported properly.<br><br></div>So I was wondering, what is the proper method for accessing the mesh elements for drawing on the screen? Is what I have correct and I discovered a bug in the code (If so, I can help with properly recording it with examples and what not). Or, is there a more robust method that I should be using?<br><br></div>Thank you and any help will be appricated<br></div>