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

getListPointers to access internal data

parent 5003e764
Branches
Tags
No related merge requests found
...@@ -960,14 +960,25 @@ std::vector<double> *PViewDataList::incrementList(int numComp, int type, int num ...@@ -960,14 +960,25 @@ std::vector<double> *PViewDataList::incrementList(int numComp, int type, int num
return 0; return 0;
} }
void PViewDataList::import(int N[24], std::vector<double> *V[24]) void PViewDataList::importLists(int N[24], std::vector<double> *V[24])
{ {
for(int i = 0; i < 24; i++){ for(int i = 0; i < 24; i++){
std::vector<double> *list = 0; std::vector<double> *list = 0;
int *nbe = 0, nbc, nbn; int *nbe = 0, nbc, nbn;
_getRawData(i, &list, &nbe, &nbc, &nbn); _getRawData(i, &list, &nbe, &nbc, &nbn);
*nbe = N[i]; *nbe = N[i];
*list = *V[i]; *list = *V[i]; // deep copy
} }
finalize(); finalize();
} }
void PViewDataList::getListPointers(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);
N[i] = *nbe;
V[i] = list; // copy pointer only
}
}
...@@ -120,7 +120,8 @@ class PViewDataList : public PViewData { ...@@ -120,7 +120,8 @@ class PViewDataList : public PViewData {
// specific to list-based data sets // specific to list-based data sets
void setOrder2(int type); void setOrder2(int type);
std::vector<double> *incrementList(int numComp, int type, int numNodes = 0); std::vector<double> *incrementList(int numComp, int type, int numNodes = 0);
void import(int N[24], std::vector<double> *V[24]); void importLists(int N[24], std::vector<double> *V[24]);
void getListPointers(int N[24], std::vector<double> *V[24]);
// I/O routines // I/O routines
bool readPOS(FILE *fp, double version, bool binary); bool readPOS(FILE *fp, double version, bool binary);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment