Changeset 16132
- Timestamp:
- 09/13/13 14:02:47 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/toolkits/mumps/MpiDenseMumpsSolve.cpp
r16083 r16132 262 262 packedDimsSparseArr[3+local_nnz+i]=jcn_loc[i]; 263 263 } 264 ensureContiguousLocations(local_nnz+n);265 264 IssmDouble *pack_A_rhs=xNew<IssmDouble>(local_nnz+n); 266 265 for (int i=0;i<local_nnz;++i) { … … 272 271 IssmPDouble *passivePack_A_rhs=xNew<IssmPDouble>(local_nnz+n); 273 272 IssmPDouble *passiveSol=xNew<IssmPDouble>(n); 274 ensureContiguousLocations(n);275 273 IssmDouble *sol=xNew<IssmDouble>(n); 276 274 call_ext_fct(dynamic_cast<GenericParam<Adolc_edf> * >(parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p, … … 302 300 local_irn[i]=iArr[3+i]; 303 301 local_jcn[i]=iArr[3+local_nnz+i]; 304 302 a_loc[i]=dp_x[i]; 305 303 } 306 304 IssmPDouble *rhs_sol=xNew<IssmPDouble>(n); … … 326 324 MumpsFinalize(theMumpsStruc); 327 325 // update the adjoint of the rhs: 328 for (int i=0;i< m;++i) {326 for (int i=0;i<n;++i) { 329 327 dp_Z[local_nnz+i]+=rhs_sol[i]; 330 328 } 331 // update the adjoint of the matrix: 329 // bcast dp_y (the solution of the forward system) 330 ISSM_MPI_Bcast(dp_y,n,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 331 // bcast the adjoint of the right-hand-side, i.e. this solution 332 ISSM_MPI_Bcast(rhs_sol,n,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 333 // update the adjoint of the matrix with the outer product of right-hand-side adjoint and the original solution 332 334 for (int i=0;i<local_nnz;++i) { 333 dp_Z[i] +=-dp_U[local_irn[i]-1]*dp_y[local_jcn[i]-1];335 dp_Z[i]-=rhs_sol[iArr[3+i]-1]*dp_y[iArr[3+local_nnz+i]-1]; 334 336 } 335 337 xDelete(rhs_sol);
Note:
See TracChangeset
for help on using the changeset viewer.