Changeset 11713
- Timestamp:
- 03/14/12 15:37:29 (13 years ago)
- Location:
- issm/trunk-jpl/src/c/objects/Numerics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/objects/Numerics/Matrix.cpp
r11695 r11713 183 183 void Matrix::Assemble(void){ 184 184 #ifdef _HAVE_PETSC_ 185 _assert_(this->matrix); 185 186 MatAssemblyBegin(this->matrix,MAT_FINAL_ASSEMBLY); 186 187 MatAssemblyEnd(this->matrix,MAT_FINAL_ASSEMBLY); … … 199 200 double norm=0; 200 201 #ifdef _HAVE_PETSC_ 201 MatNorm(this->matrix,ISSMToPetscNormMode(norm_type),&norm); 202 _assert_(this->matrix); 203 MatNorm(this->matrix,ISSMToPetscNormMode(norm_type),&norm); 202 204 #else 203 205 _error_("not implemented yet!"); … … 210 212 211 213 #ifdef _HAVE_PETSC_ 212 MatGetSize(this->matrix,pM,pN); 214 _assert_(this->matrix); 215 MatGetSize(this->matrix,pM,pN); 213 216 #else 214 217 _error_("not implemented yet!"); … … 220 223 221 224 #ifdef _HAVE_PETSC_ 222 MatGetLocalSize(this->matrix,pM,pN); 225 _assert_(this->matrix); 226 MatGetLocalSize(this->matrix,pM,pN); 223 227 #else 224 228 _error_("not implemented yet!"); … … 230 234 231 235 #ifdef _HAVE_PETSC_ 232 MatMultPatch(this->matrix,X->vector,AX->vector); 236 _assert_(this->matrix); 237 _assert_(X->vector); 238 MatMultPatch(this->matrix,X->vector,AX->vector); 233 239 #else 234 240 _error_("not implemented yet!"); … … 244 250 245 251 #ifdef _HAVE_PETSC 252 _assert_(this->matrix); 246 253 MatDuplicate(this->matrix,MAT_COPY_VALUES,&output->matrix); 247 254 #else -
issm/trunk-jpl/src/c/objects/Numerics/Vector.cpp
r11704 r11713 150 150 151 151 #ifdef _HAVE_PETSC_ 152 _assert_(this->vector); 152 153 VecAssemblyBegin(this->vector); 153 154 VecAssemblyEnd(this->vector); … … 163 164 164 165 #ifdef _HAVE_PETSC_ 166 _assert_(this->vector); 165 167 VecSetValues(this->vector,ssize,list,values,ISSMToPetscInsertMode(mode)); 166 168 #else … … 173 175 void Vector::SetValue(int dof, double value, InsMode mode){ 174 176 175 176 #ifdef _HAVE_PETSC_177 #ifdef _HAVE_PETSC_ 178 _assert_(this->vector); 177 179 VecSetValues(this->vector,1,&dof,&value,ISSMToPetscInsertMode(mode)); 178 180 #else … … 185 187 void Vector::GetValue(double* pvalue,int dof){ 186 188 187 188 #ifdef _HAVE_PETSC_ 189 VecGetValues(this->vector,1,&dof,pvalue); 190 #else 191 _error_("not implemented yet!"); 192 #endif 193 194 } 195 /*}}}*/ 196 189 #ifdef _HAVE_PETSC_ 190 _assert_(this->vector); 191 VecGetValues(this->vector,1,&dof,pvalue); 192 #else 193 _error_("not implemented yet!"); 194 #endif 195 } 196 /*}}}*/ 197 197 /*FUNCTION Vector::GetSize{{{1*/ 198 198 void Vector::GetSize(int* pM){ 199 199 200 200 #ifdef _HAVE_PETSC_ 201 _assert_(this->vector); 201 202 VecGetSize(this->vector,pM); 202 203 #else … … 210 211 211 212 #ifdef _HAVE_PETSC_ 213 _assert_(this->vector); 212 214 VecGetLocalSize(this->vector,pM); 213 215 #else … … 224 226 #ifdef _HAVE_PETSC_ 225 227 Vec vec_output=NULL; 228 _assert_(this->vector); 226 229 VecDuplicate(this->vector,&vec_output); 227 230 output->vector=vec_output; … … 238 241 239 242 #ifdef _HAVE_PETSC_ 243 _assert_(this->vector); 240 244 VecSet(this->vector,value); 241 245 #else … … 249 253 250 254 #ifdef _HAVE_PETSC_ 255 _assert_(this->vector); 251 256 VecAXPY(this->vector,a,X->vector); 252 257 #else … … 259 264 260 265 #ifdef _HAVE_PETSC_ 266 _assert_(this->vector); 261 267 VecAYPX(this->vector,a,X->vector); 262 268 #else … … 297 303 double norm=0; 298 304 #ifdef _HAVE_PETSC_ 299 VecNorm(this->vector,ISSMToPetscNormMode(norm_type),&norm); 305 _assert_(this->vector); 306 VecNorm(this->vector,ISSMToPetscNormMode(norm_type),&norm); 300 307 #else 301 308 _error_("not implemented yet!"); … … 308 315 309 316 #ifdef _HAVE_PETSC_ 310 VecScale(this->vector,scale_factor); 311 #else 312 _error_("not implemented yet!"); 313 #endif 314 } 315 /*}}}*/ 316 /*FUNCTION Vector::Scale{{{1*/ 317 _assert_(this->vector); 318 VecScale(this->vector,scale_factor); 319 #else 320 _error_("not implemented yet!"); 321 #endif 322 } 323 /*}}}*/ 324 /*FUNCTION Vector::Dot{{{1*/ 317 325 double Vector::Dot(Vector* vector){ 318 326 319 327 double dot; 320 328 #ifdef _HAVE_PETSC_ 321 VecDot(this->vector,vector->vector,&dot); 329 _assert_(this->vector); 330 VecDot(this->vector,vector->vector,&dot); 322 331 #else 323 332 _error_("not implemented yet!"); … … 330 339 331 340 #ifdef _HAVE_PETSC_ 341 _assert_(this->vector); 332 342 VecPointwiseDivide(this->vector,x->vector,y->vector); 333 343 #else
Note:
See TracChangeset
for help on using the changeset viewer.