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

fixed crash when combining adaptive views with different element types

parent 34c44677
No related branches found
No related tags found
No related merge requests found
......@@ -198,8 +198,10 @@ void PViewDataList::_stat(List_T *list, int nbcomp, int nbelm, int nbnod, int nb
if(haveInterpolationMatrices()){
std::vector<gmshMatrix<double>*> im;
if(getInterpolationMatrices(nbedg, im) == 4)
int nim = getInterpolationMatrices(nbedg, im);
if(nim == 4)
nbnod = im[2]->size1();
if(nim)
nbval = nbcomp * im[0]->size1();
}
......@@ -663,13 +665,12 @@ bool PViewDataList::combineSpace(nameData &nd)
return false;
}
// copy interpolation from first merged dataset, if any
if(!i){
// copy interpolation marices
for(std::map<int, std::vector<gmshMatrix<double>*> >::iterator it =
l->_interpolation.begin(); it != l->_interpolation.end(); it++)
if(_interpolation[it->first].empty())
for(unsigned int i = 0; i < it->second.size(); i++)
_interpolation[it->first].push_back(new gmshMatrix<double>(*it->second[i]));
}
// merge elememts
List_Merge(l->SP, SP); NbSP += l->NbSP; List_Merge(l->VP, VP); NbVP += l->NbVP;
......
......@@ -15,7 +15,8 @@ int main(int argc, char **argv)
GmshInitialize(argc, argv);
//GmshSetOption("Mesh", "Algorithm", 5);
GModel *m = new GModel();
m->readGEO("../../tutorial/t5.geo");
//m->readGEO("../../tutorial/t5.geo");
GmshMergeFile("../../tutorial/t5.geo"); // will also set the bbox
m->mesh(3);
for(GModel::riter it = m->firstRegion(); it != m->lastRegion(); ++it){
GRegion *r = *it;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment