diff --git a/Numeric/FunctionSpace.cpp b/Numeric/FunctionSpace.cpp index 8cedf26a0ebcff18c2fe2a35e8e8bd41ad6800b3..79d67fe3dbf9801dff7ce863f92616213ce42480 100644 --- a/Numeric/FunctionSpace.cpp +++ b/Numeric/FunctionSpace.cpp @@ -682,12 +682,12 @@ const gmshFunctionSpace &gmshFunctionSpaces::find(int tag) return fs[tag]; } -std::map<std::pair<int,int>, Double_Matrix> gmshFunctionSpaces::injector; +std::map<std::pair<int, int>, Double_Matrix> gmshFunctionSpaces::injector; -const Double_Matrix &gmshFunctionSpaces::findInjector(int tag1,int tag2) +const Double_Matrix &gmshFunctionSpaces::findInjector(int tag1, int tag2) { std::pair<int,int> key(tag1,tag2); - std::map<std::pair<int,int>,Double_Matrix>::const_iterator it = injector.find(key); + std::map<std::pair<int, int>, Double_Matrix>::const_iterator it = injector.find(key); if (it != injector.end()) return it->second; const gmshFunctionSpace& fs1 = find(tag1); @@ -697,11 +697,11 @@ const Double_Matrix &gmshFunctionSpaces::findInjector(int tag1,int tag2) double sf[256]; - for (int i=0;i<fs1.points.size1();i++) { - fs2.f(fs1.points(i,0),fs1.points(i,1),fs1.points(i,2),sf); - for (int j=0;j<fs2.points.size1();j++) inj(i,j) = sf[j]; + for (int i = 0; i < fs1.points.size1(); i++) { + fs2.f(fs1.points(i, 0), fs1.points(i, 1), fs1.points(i, 2), sf); + for (int j = 0; j < fs2.points.size1(); j++) inj(i, j) = sf[j]; } - injector.insert(std::make_pair(key,inj)); + injector.insert(std::make_pair(key, inj)); return injector[key]; } diff --git a/Post/adaptiveData.cpp b/Post/adaptiveData.cpp index f367cb821f24bc5176bec0afa07aa623ac9b0007..33d1d887ab9448cdf3c7a0f0219dc102fb5007f0 100644 --- a/Post/adaptiveData.cpp +++ b/Post/adaptiveData.cpp @@ -905,6 +905,7 @@ void adaptiveElements<T>::adapt(double tol, int numComp, } int numPoints = T::allPoints.size(); + if(!numPoints){ Msg::Error("No adapted points to interpolate"); return; @@ -985,9 +986,9 @@ void adaptiveElements<T>::adapt(double tol, int numComp, i++; } - if(resx){ - delete resx; delete resy; delete resz; - } + if(resx) delete resx; + if(resy) delete resy; + if(resz) delete resz; for(typename std::list<T*>::iterator it = T::all.begin(); it != T::all.end(); it++)