diff --git a/Post/PViewDataGModelIO.cpp b/Post/PViewDataGModelIO.cpp index 7aed6e2249bf7b452d0429ccbc403a4bef40e3a5..51119e94939cb025f458d7b324ac6b20deb02882 100644 --- a/Post/PViewDataGModelIO.cpp +++ b/Post/PViewDataGModelIO.cpp @@ -16,6 +16,13 @@ bool PViewDataGModel::addData(GModel *model, std::map<int, std::vector<double> > { if(data.empty()) return false; + if (numComp < 0){ + numComp = 9; + for(std::map<int, std::vector<double> >::iterator it = data.begin(); + it != data.end(); it++) + numComp = std::min(numComp, (int)it->second.size()); + } + while(step >= (int)_steps.size()) _steps.push_back(new stepData<double>(model, numComp));