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

fix model name search

parent 402fdfff
No related branches found
No related tags found
No related merge requests found
// $Id: GModel.cpp,v 1.81 2008-03-30 17:45:11 geuzaine Exp $
// $Id: GModel.cpp,v 1.82 2008-03-30 21:35:07 geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
......@@ -76,7 +76,8 @@ GModel *GModel::current()
GModel *GModel::findByName(std::string name)
{
for(unsigned int i = 0; i < list.size(); i++)
// return last mesh with given name
for(int i = list.size() - 1; i >= 0; i--)
if(list[i]->getName() == name) return list[i];
return 0;
}
......
// $Id: PViewDataGModelIO.cpp,v 1.26 2008-03-30 20:45:27 geuzaine Exp $
// $Id: PViewDataGModelIO.cpp,v 1.27 2008-03-30 21:35:07 geuzaine Exp $
//
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
//
......@@ -229,12 +229,12 @@ bool PViewDataGModel::readMED(std::string fileName, int fileIndex)
// create step data
if(!pair){
int numCompMsh = (numComp == 1) ? 1 : (numComp < 3) ? 3 : 9;
GModel *m = GModel::findByName(meshName);
if(!m){
Msg(GERROR, "Could not find mesh <<%s>>", meshName);
return false;
}
int numCompMsh = (numComp == 1) ? 1 : (numComp < 3) ? 3 : 9;
while(step >= (int)_steps.size())
_steps.push_back(new stepData<double>(m, numCompMsh));
_steps[step]->setFileName(fileName);
......@@ -325,7 +325,7 @@ bool PViewDataGModel::readMED(std::string fileName, int fileIndex)
// before storing it, using med2msh()). Also: what should we
// do with Gauss point data?
for(int j = 0; j < numComp * mult; j++)
d[j] = val[numComp * i + j];
d[j] = val[numComp * mult * i + j];
double s = ComputeScalarRep(_steps[step]->getNumComponents(), d);
_steps[step]->setMin(std::min(_steps[step]->getMin(), s));
_steps[step]->setMax(std::max(_steps[step]->getMax(), s));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment