Changeset 11739
- Timestamp:
- 03/19/12 20:58:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/objects/Numerics/Vector.cpp
r11737 r11739 112 112 113 113 #ifdef _HAVE_PETSC_ 114 VecView(this->vector,PETSC_VIEWER_STDOUT_WORLD); 114 if(!this->vector){ 115 printf("Vector size: 0\n"); 116 } 117 else VecView(this->vector,PETSC_VIEWER_STDOUT_WORLD); 115 118 #else 116 119 this->vector->Echo(); … … 209 212 210 213 #ifdef _HAVE_PETSC_ 211 _assert_(this->vector);212 VecGetSize(this->vector,pM);214 if(!this->vector)*pM=0; 215 else VecGetSize(this->vector,pM); 213 216 #else 214 217 this->vector->GetSize(pM); … … 221 224 222 225 #ifdef _HAVE_PETSC_ 223 _assert_(this->vector);224 VecGetLocalSize(this->vector,pM);226 if(!this->vector)*pM=0; 227 else VecGetLocalSize(this->vector,pM); 225 228 #else 226 229 this->vector->GetLocalSize(pM); … … 236 239 #ifdef _HAVE_PETSC_ 237 240 Vec vec_output=NULL; 238 _assert_(this->vector); 239 VecDuplicate(this->vector,&vec_output); 240 output->vector=vec_output; 241 if(!this->vector){ 242 VecDuplicate(this->vector,&vec_output); 243 output->vector=vec_output; 244 } 241 245 #else 242 246 output->vector=this->vector->Duplicate(); … … 300 304 301 305 #ifdef _HAVE_PETSC_ 302 VecCopy(this->vector,to->vector);306 if(this->vector) VecCopy(this->vector,to->vector); 303 307 #else 304 308 this->vector->Copy(to->vector);
Note:
See TracChangeset
for help on using the changeset viewer.