Commit aa2a4e83 authored by chrmaier's avatar chrmaier
Browse files

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	Source/IO/mesh_xml_file.cpp
parents e2844e42 9e7fbcc5
This diff is collapsed.
if(USE_MESH) if(USE_MESH)
#add_subdirectory(DrawGrid) add_subdirectory(DrawGrid)
add_subdirectory(OldDrawGrid) add_subdirectory(OldDrawGrid)
add_subdirectory(GridGen) add_subdirectory(GridGen)
endif(USE_MESH) endif(USE_MESH)
......
...@@ -8,6 +8,7 @@ find_package(GLUT) ...@@ -8,6 +8,7 @@ find_package(GLUT)
if(OPENGL_FOUND) if(OPENGL_FOUND)
if(GLUT_FOUND) if(GLUT_FOUND)
message("linking DrawGrid with GLUT and OpenGL")
include_directories(${OPENGL_INCLUDE_DIR}) include_directories(${OPENGL_INCLUDE_DIR})
include_directories(${GLUT_INCLUDE_DIR}) include_directories(${GLUT_INCLUDE_DIR})
add_executable(DrawGrid ${SOURCE}) add_executable(DrawGrid ${SOURCE})
...@@ -20,9 +21,9 @@ if(OPENGL_FOUND) ...@@ -20,9 +21,9 @@ if(OPENGL_FOUND)
endif(USE_MPI) endif(USE_MPI)
install(TARGETS DrawGrid EXPORT inmost-targets RUNTIME DESTINATION bin) install(TARGETS DrawGrid EXPORT inmost-targets RUNTIME DESTINATION bin)
else(GLUT_FOUND) else(GLUT_FOUND)
message("GLUT not found") message("GLUT not found, not building DrawGrid")
endif(GLUT_FOUND) endif(GLUT_FOUND)
else(OPENGL_FOUND) else(OPENGL_FOUND)
message("OpenGL not found") message("OpenGL not found, not building DrawGrid")
endif(OPENGL_FOUND) endif(OPENGL_FOUND)
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
//#define OCTREECUTCELL_DEBUG //#define OCTREECUTCELL_DEBUG
#define DISCR_DEBUG #define DISCR_DEBUG
#include "../../inmost.h" #include "inmost.h"
#include "my_glut.h" #include "my_glut.h"
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
...@@ -20,7 +20,7 @@ double zoom = 1; ...@@ -20,7 +20,7 @@ double zoom = 1;
int width = 800, height = 800; int width = 800, height = 800;
double sleft = 1e20, sright = -1e20, sbottom = 1e20, stop = -1e20, sfar = -1e20, snear = 1e20; double sleft = 1e20, sright = -1e20, sbottom = 1e20, stop = -1e20, sfar = -1e20, snear = 1e20;
Tag mat,colort; int maxmat = -1, maxcolor = 0; Tag mat,colort; int maxmat = -1, maxcolor = 0;
std::map<GeometricData,ElementType> table; Mesh::GeomParam table;
double reset_timer = Timer(); double reset_timer = Timer();
double shift[3] = {0,0,0}; double shift[3] = {0,0,0};
int boundary = 2; int boundary = 2;
...@@ -30,7 +30,7 @@ bool perspective = false; ...@@ -30,7 +30,7 @@ bool perspective = false;
int text = 4; int text = 4;
int display_orphans = 1; int display_orphans = 1;
int badfaces = 1; int badfaces = 1;
ElementSet * problem_set, * orphan_edges, * orphan_faces; ElementSet problem_set, orphan_edges, orphan_faces;
#if defined(DISCR_DEBUG) #if defined(DISCR_DEBUG)
...@@ -44,7 +44,7 @@ static void tensor_prod3(Storage::real * K, Storage::real v[3], Storage::real ou ...@@ -44,7 +44,7 @@ static void tensor_prod3(Storage::real * K, Storage::real v[3], Storage::real ou
out[2] = v[0] * K[6] + v[1] * K[7] + v[2] * K[8]; out[2] = v[0] * K[6] + v[1] * K[7] + v[2] * K[8];
} }
void FindHarmonicPoint(Face * fKL, Cell * cK, Cell * cL, Tag tensor, Storage::real xK[3], Storage::real xL[3], Storage::real y[3], Storage::real & coef) void FindHarmonicPoint(Face & fKL, Cell & cK, Cell & cL, Tag tensor, Storage::real xK[3], Storage::real xL[3], Storage::real y[3], Storage::real & coef)
{ {
Storage::real yK[3], yL[3], xKL[3], nKL[3], dK, dL, lK, lL, lKs[3], lLs[3], D, t; Storage::real yK[3], yL[3], xKL[3], nKL[3], dK, dL, lK, lL, lKs[3], lLs[3], D, t;
Storage::real coefK, coefL, coefQ, coefDiv; Storage::real coefK, coefL, coefQ, coefDiv;
...@@ -81,7 +81,7 @@ void FindHarmonicPoint(Face * fKL, Cell * cK, Cell * cL, Tag tensor, Storage::re ...@@ -81,7 +81,7 @@ void FindHarmonicPoint(Face * fKL, Cell * cK, Cell * cL, Tag tensor, Storage::re
} }
void FindBoundaryPoint(Face * fK, Cell * cK, Tag tensor, Storage::real xK[3], Storage::real y[3]) void FindBoundaryPoint(Face & fK, Cell & cK, Tag tensor, Storage::real xK[3], Storage::real y[3])
{ {
Storage::real nK[3], lKs[3], lK, xfK[3], t; Storage::real nK[3], lKs[3], lK, xfK[3], t;
Storage::real_array KK = cK->RealArray(tensor); Storage::real_array KK = cK->RealArray(tensor);
...@@ -393,8 +393,8 @@ void keyboard(unsigned char key, int x, int y) ...@@ -393,8 +393,8 @@ void keyboard(unsigned char key, int x, int y)
{ {
unsigned visited = 0; unsigned visited = 0;
colort = mesh->CreateTag("COLOR",DATA_INTEGER,CELL,NONE,1); colort = mesh->CreateTag("COLOR",DATA_INTEGER,CELL,NONE,1);
std::vector<Cell *> queue; std::vector<Cell> queue;
adjacent<Element> around; ElementArray<Element> around;
queue.reserve(256); queue.reserve(256);
while(visited != mesh->NumberOfCells() ) while(visited != mesh->NumberOfCells() )
{ {
...@@ -404,7 +404,7 @@ void keyboard(unsigned char key, int x, int y) ...@@ -404,7 +404,7 @@ void keyboard(unsigned char key, int x, int y)
{ {
if( it->Integer(colort) == 0 ) if( it->Integer(colort) == 0 )
{ {
queue.push_back(&*it); queue.push_back(it->self());
visited++; visited++;
queue.back()->Integer(colort) = maxcolor; queue.back()->Integer(colort) = maxcolor;
break; break;
...@@ -415,7 +415,7 @@ void keyboard(unsigned char key, int x, int y) ...@@ -415,7 +415,7 @@ void keyboard(unsigned char key, int x, int y)
around = queue.back()->BridgeAdjacencies(FACE,CELL); around = queue.back()->BridgeAdjacencies(FACE,CELL);
queue.pop_back(); queue.pop_back();
for(adjacent<Element>::iterator it = around.begin(); it != around.end(); ++it) for(ElementArray<Element>::iterator it = around.begin(); it != around.end(); ++it)
if( it->Integer(colort) == 0 ) if( it->Integer(colort) == 0 )
{ {
queue.push_back(it->getAsCell()); queue.push_back(it->getAsCell());
...@@ -474,13 +474,13 @@ public: ...@@ -474,13 +474,13 @@ public:
face2gl DrawFace(Element * f, int mmat, double campos[3]) face2gl DrawFace(Element & f, int mmat, double campos[3])
{ {
double cnt[3]; double cnt[3];
face2gl ret; face2gl ret;
f->Centroid(cnt); f->Centroid(cnt);
ret.set_center(cnt,campos); ret.set_center(cnt,campos);
adjacent<Node> nodes = f->getNodes(); ElementArray<Node> nodes = f->getNodes();
if( f->nbAdjElements(CELL) == 0 ) if( f->nbAdjElements(CELL) == 0 )
ret.set_color(1,0,0,0.25); ret.set_color(1,0,0,0.25);
...@@ -494,7 +494,7 @@ face2gl DrawFace(Element * f, int mmat, double campos[3]) ...@@ -494,7 +494,7 @@ face2gl DrawFace(Element * f, int mmat, double campos[3])
ret.set_color(1-r,r,1-r,0.25); ret.set_color(1-r,r,1-r,0.25);
} }
for( adjacent<Node>::iterator kt = nodes.begin(); kt != nodes.end(); kt++) for( ElementArray<Node>::iterator kt = nodes.begin(); kt != nodes.end(); kt++)
ret.add_vert(&(kt->Coords()[0])); ret.add_vert(&(kt->Coords()[0]));
...@@ -503,7 +503,7 @@ face2gl DrawFace(Element * f, int mmat, double campos[3]) ...@@ -503,7 +503,7 @@ face2gl DrawFace(Element * f, int mmat, double campos[3])
//glLineWidth(2.0); //glLineWidth(2.0);
if( boundary == 1 ) glColor3f(0,0,1); else glColor3f(0,0,0); if( boundary == 1 ) glColor3f(0,0,1); else glColor3f(0,0,0);
glBegin(GL_LINE_LOOP); glBegin(GL_LINE_LOOP);
for( adjacent<Node>::iterator kt = nodes.begin(); kt != nodes.end(); kt++) for( ElementArray<Node>::iterator kt = nodes.begin(); kt != nodes.end(); kt++)
glVertex3dv(&(kt->Coords()[0])); glVertex3dv(&(kt->Coords()[0]));
glEnd(); glEnd();
//glLineWidth(1.0); //glLineWidth(1.0);
...@@ -596,7 +596,7 @@ void draw() ...@@ -596,7 +596,7 @@ void draw()
//glTranslated((l+r)*0.5,(b+t)*0.5,(near+far)*0.5); //glTranslated((l+r)*0.5,(b+t)*0.5,(near+far)*0.5);
int pacef = std::max(1,mesh->MaxLocalIDFACE()/10000); int pacef = std::max(1,mesh->FaceLastLocalID()/10000);
std::vector<face2gl> polygons; std::vector<face2gl> polygons;
...@@ -604,14 +604,11 @@ void draw() ...@@ -604,14 +604,11 @@ void draw()
if( badfaces ) if( badfaces )
{ {
for(INMOST_DATA_INTEGER_TYPE it = 0; it < mesh->MaxLocalIDFACE(); it += (interactive ? pacef : 1)) for(INMOST_DATA_INTEGER_TYPE it = 0; it < mesh->FaceLastLocalID(); it += (interactive ? pacef : 1)) if( mesh->isValidFace(it) )
{ {
Face * f = mesh->FaceByLocalID(it); Face f = mesh->FaceByLocalID(it);
if( f != NULL ) if( !f->CheckNormalOrientation() )
{ polygons.push_back(DrawFace(f,1,campos));
if( !f->CheckNormalOrientation() )
polygons.push_back(DrawFace(f,1,campos));
}
} }
} }
...@@ -628,8 +625,8 @@ void draw() ...@@ -628,8 +625,8 @@ void draw()
{ {
Storage::real cnt[3]; Storage::real cnt[3];
it->Centroid(cnt); it->Centroid(cnt);
adjacent<Face> faces = it->getFaces(); ElementArray<Face> faces = it->getFaces();
for(adjacent<Face>::iterator jt = faces.begin(); jt != faces.end(); ++jt) if(!jt->Boundary()) for(ElementArray<Face>::iterator jt = faces.begin(); jt != faces.end(); ++jt) if(!jt->Boundary())
{ {
Storage::real_array cc = jt->RealArray(avg_coord); Storage::real_array cc = jt->RealArray(avg_coord);
glVertex3dv(cnt); glVertex3dv(cnt);
...@@ -664,8 +661,8 @@ void draw() ...@@ -664,8 +661,8 @@ void draw()
for(Mesh::iteratorFace it = mesh->BeginFace(); it != mesh->EndFace(); ++it) if(!it->Boundary() ) for(Mesh::iteratorFace it = mesh->BeginFace(); it != mesh->EndFace(); ++it) if(!it->Boundary() )
{ {
Storage::real nrm[3], scale, f1[3], f2[3], l, cnt[3], v[3]; Storage::real nrm[3], scale, f1[3], f2[3], l, cnt[3], v[3];
Cell * c1 = it->BackCell(), * c2 = it->FrontCell(); Cell c1 = it->BackCell(), c2 = it->FrontCell();
if( c1 != NULL && c2 != NULL ) if( c1.isValid() && c2.isValid() )
{ {
it->Centroid(cnt); it->Centroid(cnt);
it->OrientedUnitNormal(c1,nrm); it->OrientedUnitNormal(c1,nrm);
...@@ -735,19 +732,19 @@ void draw() ...@@ -735,19 +732,19 @@ void draw()
{ {
for(int qq = 0; qq < show_cells.size(); qq++) for(int qq = 0; qq < show_cells.size(); qq++)
{ {
if( show_cells[qq] < 0 || show_cells[qq] >= mesh->MaxLocalIDCELL() ) continue; if( show_cells[qq] < 0 || show_cells[qq] >= mesh->CellLastLocalID() ) continue;
Element * it = mesh->ElementByLocalID(CELL,show_cells[qq]); Element it = mesh->ElementByLocalID(CELL,show_cells[qq]);
if( it != NULL ) if( it.isValid() )
{ {
Storage::integer_array mats; Storage::integer_array mats;
adjacent<Edge> edges = it->getEdges(); ElementArray<Edge> edges = it->getEdges();
Storage::real cnt[3]; Storage::real cnt[3];
for(unsigned k = 0; k < edges.size(); k++) for(unsigned k = 0; k < edges.size(); k++)
{ {
edges[k].Centroid(cnt); edges[k].Centroid(cnt);
if( mats_tag.isValid() )mats = edges[k].IntegerArray(mats_tag); if( mats_tag.isValid() )mats = edges[k].IntegerArray(mats_tag);
adjacent<Node> nodes = edges[k].getNodes(); ElementArray<Node> nodes = edges[k].getNodes();
if( matfilter == 0 || (mats_tag.isValid() && std::binary_search(mats.begin(),mats.end(),matfilter-1)) ) if( matfilter == 0 || (mats_tag.isValid() && std::binary_search(mats.begin(),mats.end(),matfilter-1)) )
...@@ -787,7 +784,7 @@ void draw() ...@@ -787,7 +784,7 @@ void draw()
} }
} }
adjacent<Face> faces = it->getFaces(); ElementArray<Face> faces = it->getFaces();
for(unsigned k = 0; k < faces.size(); k++) for(unsigned k = 0; k < faces.size(); k++)
{ {
...@@ -843,22 +840,22 @@ void draw() ...@@ -843,22 +840,22 @@ void draw()
{ {
for(int qq = 0; qq < show_faces.size(); qq++) for(int qq = 0; qq < show_faces.size(); qq++)
{ {
Element * it = NULL; Element it = InvalidElement();
if( show_faces[qq] < 0 || show_faces[qq] >= mesh->MaxLocalID(FACE) ) continue; if( show_faces[qq] < 0 || show_faces[qq] >= mesh->LastLocalID(FACE) ) continue;
it = mesh->ElementByLocalID(FACE,show_faces[qq]); it = mesh->ElementByLocalID(FACE,show_faces[qq]);
if( it != NULL ) if( it.isValid() )
{ {
Storage::integer_array mats; Storage::integer_array mats;
Storage::real cnt[3], cntf[3]; Storage::real cnt[3], cntf[3];
adjacent<Edge> edges = it->getEdges(); ElementArray<Edge> edges = it->getEdges();
it->Centroid(cntf); it->Centroid(cntf);
for(unsigned k = 0; k < edges.size(); k++) for(unsigned k = 0; k < edges.size(); k++)
//if( edges[k].nbAdjElements(CELL) == 0 ) //if( edges[k].nbAdjElements(CELL) == 0 )
{ {
if(mats_tag.isValid() ) mats = edges[k].IntegerArray(mats_tag); if(mats_tag.isValid() ) mats = edges[k].IntegerArray(mats_tag);
adjacent<Node> nodes = edges[k].getNodes(); ElementArray<Node> nodes = edges[k].getNodes();
if( matfilter == 0 || (mats_tag.isValid() &&std::binary_search(mats.begin(),mats.end(),matfilter-1)) ) if( matfilter == 0 || (mats_tag.isValid() &&std::binary_search(mats.begin(),mats.end(),matfilter-1)) )
{ {
...@@ -914,9 +911,9 @@ void draw() ...@@ -914,9 +911,9 @@ void draw()
if( text == 3 || text == 5 ) if(text) printtext(str); if( text == 3 || text == 5 ) if(text) printtext(str);
} }
#if 0 #if 0
adjacent<Cell> cells = it->getCells(); ElementArray<Cell> cells = it->getCells();
for(adjacent<Cell>::iterator jt = cells.begin(); jt != cells.end(); ++jt) for(ElementArray<Cell>::iterator jt = cells.begin(); jt != cells.end(); ++jt)
{ {
glColor3f(0,0,0); glColor3f(0,0,0);
jt->Centroid(cnt); jt->Centroid(cnt);
...@@ -948,7 +945,7 @@ void draw() ...@@ -948,7 +945,7 @@ void draw()
} }
glEnd(); glEnd();
*/ */
for(adjacent<Cell>::iterator jt = cells.begin(); jt != cells.end(); ++jt) for(ElementArray<Cell>::iterator jt = cells.begin(); jt != cells.end(); ++jt)
{ {
jt->Centroid(cnt); jt->Centroid(cnt);
...@@ -958,9 +955,9 @@ void draw() ...@@ -958,9 +955,9 @@ void draw()
glVertex3dv(cnt); glVertex3dv(cnt);
glEnd(); glEnd();
adjacent<Face> faces = jt->getFaces(); ElementArray<Face> faces = jt->getFaces();
for(adjacent<Face>::iterator qt = faces.begin(); qt != faces.end(); ++qt) for(ElementArray<Face>::iterator qt = faces.begin(); qt != faces.end(); ++qt)
{ {
qt->Centroid(cnt); qt->Centroid(cnt);
glColor3f(0,0,1); glColor3f(0,0,1);
...@@ -1042,14 +1039,14 @@ void draw() ...@@ -1042,14 +1039,14 @@ void draw()
{ {
if( parentfilter != -1 && parent_tag.isValid() && it->Integer(parent_tag) != parentfilter ) continue; if( parentfilter != -1 && parent_tag.isValid() && it->Integer(parent_tag) != parentfilter ) continue;
Storage::integer_array mats; Storage::integer_array mats;
adjacent<Edge> edges = it->getEdges(); ElementArray<Edge> edges = it->getEdges();
Storage::real cnt[3]; Storage::real cnt[3];
for(unsigned k = 0; k < edges.size(); k++) for(unsigned k = 0; k < edges.size(); k++)
{ {
edges[k].Centroid(cnt); edges[k].Centroid(cnt);
mats = edges[k].IntegerArray(mats_tag); mats = edges[k].IntegerArray(mats_tag);
adjacent<Node> nodes = edges[k].getNodes(); ElementArray<Node> nodes = edges[k].getNodes();
if( matfilter == 0 || std::binary_search(mats.begin(),mats.end(),matfilter-1) ) if( matfilter == 0 || std::binary_search(mats.begin(),mats.end(),matfilter-1) )
...@@ -1086,7 +1083,7 @@ void draw() ...@@ -1086,7 +1083,7 @@ void draw()
} }
} }
adjacent<Face> faces = it->getFaces(); ElementArray<Face> faces = it->getFaces();
for(unsigned k = 0; k < faces.size(); k++) for(unsigned k = 0; k < faces.size(); k++)
{ {
...@@ -1145,7 +1142,7 @@ void draw() ...@@ -1145,7 +1142,7 @@ void draw()
//end = mesh->MaxLocalID(EDGE); //end = mesh->MaxLocalID(EDGE);
//for(Mesh::iteratorEdge it = mesh->BeginEdge(); it != mesh->EndEdge(); it++) //for(Mesh::iteratorEdge it = mesh->BeginEdge(); it != mesh->EndEdge(); it++)
//for(int i = 0; i < end; i++) //for(int i = 0; i < end; i++)
if( orphan_edges != NULL ) for(ElementSet::iterator iit = orphan_edges->begin(); iit != orphan_edges->end(); ++iit) if( orphan_edges != NULL ) for(ElementSet::iterator iit = orphan_edges.Begin(); iit != orphan_edges.End(); ++iit)
{ {
Element * it = &*iit;//mesh->ElementByLocalID(EDGE,i); Element * it = &*iit;//mesh->ElementByLocalID(EDGE,i);
//if( it == NULL ) continue; //if( it == NULL ) continue;
...@@ -1154,7 +1151,7 @@ void draw() ...@@ -1154,7 +1151,7 @@ void draw()
Storage::integer_array mats = it->IntegerArray(mats_tag); Storage::integer_array mats = it->IntegerArray(mats_tag);
Storage::real cnt[3]; Storage::real cnt[3];
adjacent<Node> nodes = it->getNodes(); ElementArray<Node> nodes = it->getNodes();
if( matfilter == 0 || std::binary_search(mats.begin(),mats.end(),matfilter-1) ) if( matfilter == 0 || std::binary_search(mats.begin(),mats.end(),matfilter-1) )
{ {
...@@ -1203,14 +1200,14 @@ void draw() ...@@ -1203,14 +1200,14 @@ void draw()
Storage::integer_array mats; Storage::integer_array mats;
Storage::real cnt[3]; Storage::real cnt[3];
adjacent<Edge> edges = it->getEdges(); ElementArray<Edge> edges = it->getEdges();
for(unsigned k = 0; k < edges.size(); k++) for(unsigned k = 0; k < edges.size(); k++)
//if( edges[k].nbAdjElements(CELL) == 0 ) //if( edges[k].nbAdjElements(CELL) == 0 )
{ {
mats = edges[k].IntegerArray(mats_tag); mats = edges[k].IntegerArray(mats_tag);
adjacent<Node> nodes = edges[k].getNodes(); ElementArray<Node> nodes = edges[k].getNodes();
if( matfilter == 0 || std::binary_search(mats.begin(),mats.end(),matfilter-1) ) if( matfilter == 0 || std::binary_search(mats.begin(),mats.end(),matfilter-1) )
{ {
...@@ -1268,45 +1265,48 @@ void draw() ...@@ -1268,45 +1265,48 @@ void draw()
#endif #endif
if( boundary ) if( boundary )
{ {
int end = mesh->MaxLocalID(FACE); for(ElementType etype = FACE; etype <= CELL; etype = NextElementType(etype) )
//for(Mesh::iteratorFace it = mesh->BeginFace(); it != mesh->EndFace(); it++)
if( colort.isValid() )
{ {
for(int i = 0; i < end; i+= interactive ? pacef : 1) int end = mesh->LastLocalID(etype);
//for(Mesh::iteratorFace it = mesh->BeginFace(); it != mesh->EndFace(); it++)
if( colort.isValid() )
{ {
Element * it = mesh->ElementByLocalID(FACE,i); for(int i = 0; i < end; i+= interactive ? pacef : 1)
if( it == NULL ) continue;
if( it->Boundary() )
{ {
int mmat = color ? (it->getAsFace()->BackCell() == NULL ? 0 : it->getAsFace()->BackCell()->Integer(colort)) : (it->getAsFace()->BackCell() == NULL ? 0 : it->getAsFace()->BackCell()->Integer(mat)); Element it = mesh->ElementByLocalID(etype,i);
if( matfilter == 0 || matfilter-1 == mmat ) if( !it.isValid() ) continue;
polygons.push_back(DrawFace(&*it,mmat,campos)); if( it->Boundary() )
{
int mmat = color ? (!it->getAsFace()->BackCell().isValid() ? 0 : it->getAsFace()->BackCell()->Integer(colort)) : (!it->getAsFace()->BackCell().isValid() ? 0 : it->getAsFace()->BackCell()->Integer(mat));
if( matfilter == 0 || matfilter-1 == mmat )
polygons.push_back(DrawFace(it->self(),mmat,campos));
}
} }
} }
} else
else
{
for(int i = 0; i < end; i+= interactive ? pacef : 1)
{ {
Element * it = mesh->ElementByLocalID(FACE,i); for(int i = 0; i < end; i+= interactive ? pacef : 1)
if( it == NULL ) continue; {
if( it->Boundary() ) Element it = mesh->ElementByLocalID(etype,i);
polygons.push_back(DrawFace(&*it,0,campos)); if( !it.isValid() ) continue;
if( it->Boundary() )
polygons.push_back(DrawFace(it->self(),0,campos));
}
} }
} }
} }
if( display_orphans ) if( display_orphans )
{ {
if( orphan_edges != NULL ) for(ElementSet::iterator iit = orphan_edges->begin(); iit != orphan_edges->end(); ++iit) if( orphan_edges.isValid()) for(ElementSet::iterator iit = orphan_edges.Begin(); iit != orphan_edges.End(); ++iit)
{ {
Element * it = &*iit;//mesh->ElementByLocalID(EDGE,i); Element it = iit->self();//mesh->ElementByLocalID(EDGE,i);
//if( it == NULL ) continue; //if( it == NULL ) continue;
//if( it->nbAdjElements(CELL) == 0 ) //if( it->nbAdjElements(CELL) == 0 )
{ {
Storage::real cnt[3]; Storage::real cnt[3];
adjacent<Node> nodes = it->getNodes(); ElementArray<Node> nodes = it->getNodes();
{ {
glBegin(GL_LINES); glBegin(GL_LINES);
...@@ -1317,18 +1317,18 @@ void draw() ...@@ -1317,18 +1317,18 @@ void draw()
} }
} }
} }
if( orphan_faces != NULL ) for(ElementSet::iterator iit = orphan_faces->begin(); iit != orphan_faces->end(); ++iit) if( orphan_faces.isValid() ) for(ElementSet::iterator iit = orphan_faces.Begin(); iit != orphan_faces.End(); ++iit)
{ {
Element * it = &*iit; Element it = iit->self();
{