diff --git a/Post/PViewDataList.cpp b/Post/PViewDataList.cpp index 335edf3da5c5f3b12f1e492742b1b4164f151e16..12ad9664de1825c8ed3b810171fdc4eb88447404 100644 --- a/Post/PViewDataList.cpp +++ b/Post/PViewDataList.cpp @@ -825,7 +825,7 @@ bool PViewDataList::combineTime(nameData &nd) } int PViewDataList::_getRawData(int idxtype, std::vector<double> **l, int **ne, - int *nc, int *nn) + int *nc, int *nn) { int type = 0; // No constant nn for polygons! @@ -883,7 +883,7 @@ void PViewDataList::setOrder2(int type) case TYPE_TET: typeMSH = MSH_TET_10; break; case TYPE_HEX: typeMSH = MSH_HEX_27; break; case TYPE_PRI: typeMSH = MSH_PRI_18; break; -// case TYPE_PYR: typeMSH = MSH_PYR_14; break; + // case TYPE_PYR: typeMSH = MSH_PYR_14; break; } const polynomialBasis *fs = (polynomialBasis*)BasisFactory::create(typeMSH); if(!fs){ @@ -959,3 +959,15 @@ std::vector<double> *PViewDataList::incrementList(int numComp, int type, int num } return 0; } + +void PViewDataList::import(int N[24], std::vector<double> *V[24]) +{ + for(int i = 0; i < 24; i++){ + std::vector<double> *list = 0; + int *nbe = 0, nbc, nbn; + _getRawData(i, &list, &nbe, &nbc, &nbn); + *nbe = N[i]; + *list = *V[i]; + } + finalize(); +} diff --git a/Post/PViewDataList.h b/Post/PViewDataList.h index 322593d3bf6f8392e517d51653ed708ad99afab9..4423b131f37a66d892e30257de55c2fc8ada4732 100644 --- a/Post/PViewDataList.h +++ b/Post/PViewDataList.h @@ -120,13 +120,14 @@ class PViewDataList : public PViewData { // specific to list-based data sets void setOrder2(int type); std::vector<double> *incrementList(int numComp, int type, int numNodes = 0); + void import(int N[24], std::vector<double> *V[24]); // I/O routines bool readPOS(FILE *fp, double version, bool binary); bool writePOS(const std::string &fileName, bool binary=false, bool parsed=true, bool append=false); - virtual bool writeMSH(const std::string &fileName, double version=2.2, bool binary=false, bool savemesh=true, - bool multipleView=false); + virtual bool writeMSH(const std::string &fileName, double version=2.2, bool binary=false, + bool savemesh=true, bool multipleView=false); }; #endif diff --git a/Post/PViewDataListIO.cpp b/Post/PViewDataListIO.cpp index a3f3021cb51a571aa4110e93415a3cc2b9ee7143..be49981d8ca27bcb2242ad1876679ade98417fdc 100644 --- a/Post/PViewDataListIO.cpp +++ b/Post/PViewDataListIO.cpp @@ -525,8 +525,8 @@ static void createElements(std::vector<double> &list, int nbelm, int nbnod, } } -bool PViewDataList::writeMSH(const std::string &fileName, double version, bool binary, bool savemesh, - bool multipleView) +bool PViewDataList::writeMSH(const std::string &fileName, double version, bool binary, + bool savemesh, bool multipleView) { if(_adaptive){ Msg::Warning("Writing adapted dataset (will only export current time step)"); @@ -581,7 +581,8 @@ bool PViewDataList::writeMSH(const std::string &fileName, double version, bool b fprintf(fp, "%d\n", (int)elements.size()); for(unsigned int i = 0; i < elements.size(); i++){ if(version > 2.2) - Msg::Warning("PViewDataList: Unable to writeMSH in version '%d'. Version 2.2 selected.", version); + Msg::Warning("Unable to write file in version '%g': using version 2.2", + version); elements[i]->writeMSH2(fp, 2.2, false, i + 1); } fprintf(fp, "$EndElements\n"); diff --git a/Post/PViewIO.cpp b/Post/PViewIO.cpp index 484726b40e3a330474547f0fdfbab43c8033d8e0..8cb054ab732818e045962562e63aae30faf9f790 100644 --- a/Post/PViewIO.cpp +++ b/Post/PViewIO.cpp @@ -309,7 +309,8 @@ bool PView::write(const std::string &fileName, int format, bool append) case 2: ret = _data->writePOS(fileName, false, true, append); break; // parsed case 3: ret = _data->writeSTL(fileName); break; case 4: ret = _data->writeTXT(fileName); break; - case 5: ret = _data->writeMSH(fileName, CTX::instance()->mesh.mshFileVersion, CTX::instance()->mesh.binary); break; + case 5: ret = _data->writeMSH(fileName, CTX::instance()->mesh.mshFileVersion, + CTX::instance()->mesh.binary); break; case 6: ret = _data->writeMED(fileName); break; case 10: { @@ -319,7 +320,8 @@ bool PView::write(const std::string &fileName, int format, bool append) else if(ext == ".stl") ret = _data->writeSTL(fileName); else if(ext == ".msh") - ret = _data->writeMSH(fileName, CTX::instance()->mesh.mshFileVersion, CTX::instance()->mesh.binary); + ret = _data->writeMSH(fileName, CTX::instance()->mesh.mshFileVersion, + CTX::instance()->mesh.binary); else if(ext == ".med") ret = _data->writeMED(fileName); else