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

avoid crash when not using adaptive drawing on high-order views

parent 8a8db8aa
Branches
Tags
No related merge requests found
...@@ -66,7 +66,7 @@ GModel::~GModel() ...@@ -66,7 +66,7 @@ GModel::~GModel()
GModel *GModel::current(int index) GModel *GModel::current(int index)
{ {
if(list.empty()){ if(list.empty()){
Msg::Error("No current model available: creating one"); Msg::Warning("No current model available: creating one");
new GModel(); new GModel();
} }
if(index >= 0) _current = index; if(index >= 0) _current = index;
......
...@@ -947,6 +947,14 @@ static void addElementsInArrays(PView *p, bool preprocessNormalsOnly) ...@@ -947,6 +947,14 @@ static void addElementsInArrays(PView *p, bool preprocessNormalsOnly)
if(opt->skipElement(numEdges)) continue; if(opt->skipElement(numEdges)) continue;
int numComp = data->getNumComponents(opt->timeStep, ent, i); int numComp = data->getNumComponents(opt->timeStep, ent, i);
int numNodes = data->getNumNodes(opt->timeStep, ent, i); int numNodes = data->getNumNodes(opt->timeStep, ent, i);
if(numNodes > 20){
Msg::Error("Should never draw view with > 20 nodes per element: adapt?");
continue;
}
if(numComp > 9){
Msg::Error("Should never draw view with > 9 components: adapt?");
continue;
}
for(int j = 0; j < numNodes; j++){ for(int j = 0; j < numNodes; j++){
data->getNode(opt->timeStep, ent, i, j, xyz[j][0], xyz[j][1], xyz[j][2]); data->getNode(opt->timeStep, ent, i, j, xyz[j][0], xyz[j][1], xyz[j][2]);
for(int k = 0; k < numComp; k++) for(int k = 0; k < numComp; k++)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment