Go to the source code of this file.
|
void | SeqDenseMumpsSolve (IssmDouble *uf, int uf_M, int uf_n, IssmDouble *Kff, int Kff_M, int Kff_N, int Kff_m, IssmDouble *pf, int pf_M, int pf_m, Parameters *parameters) |
|
◆ SeqDenseMumpsSolve()
void SeqDenseMumpsSolve |
( |
IssmDouble * |
uf, |
|
|
int |
uf_M, |
|
|
int |
uf_n, |
|
|
IssmDouble * |
Kff, |
|
|
int |
Kff_M, |
|
|
int |
Kff_N, |
|
|
int |
Kff_m, |
|
|
IssmDouble * |
pf, |
|
|
int |
pf_M, |
|
|
int |
pf_m, |
|
|
Parameters * |
parameters |
|
) |
| |
Definition at line 296 of file MumpsSolve.cpp.
305 if (Kff_M!=Kff_N)
_error_(
"stiffness matrix Kff should be square");
306 if (Kff_M!=Kff_m)
_error_(
"stiffness matrix Kff is not serial");
307 if (uf_M!=Kff_M || uf_M!=pf_M)
_error_(
"solution vector should be the same size as stiffness matrix Kff and load vector pf");
308 if (uf_m!=Kff_m || uf_m!=pf_m)
_error_(
"solution vector should be locally the same size as stiffness matrix Kff and load vector pf");
313 for(
int i=0;i<Kff_M;i++){
314 for(
int j=0;j<Kff_N;j++){
315 if(Kff[i*Kff_N+j]!=0)nnz++;
321 irn_loc = xNew<int>(nnz);
322 jcn_loc = xNew<int>(nnz);
323 a_loc = xNew<IssmDouble>(nnz);
328 for(
int i=0;i<Kff_M;i++){
329 for(
int j=0;j<Kff_N;j++){
330 if(Kff[i*Kff_N+j]!=0){
331 irn_loc[count] = i+1;
332 jcn_loc[count] = j+1;
333 a_loc[count] = Kff[i*Kff_N+j];
343 rhs=xNew<IssmDouble>(pf_M,
"t");
345 rhs=xNew<IssmDouble>(pf_M);
347 xMemCpy<IssmDouble>(rhs,pf,Kff_M);
349 MumpsSolve(Kff_M,nnz,nnz,irn_loc,jcn_loc,a_loc,rhs,parameters);
352 xMemCpy<IssmDouble>(uf,rhs,Kff_M);
355 xDelete<int>(irn_loc);
356 xDelete<int>(jcn_loc);
357 xDelete<IssmDouble>(a_loc);
358 xDelete<IssmDouble>(rhs);
void MumpsSolve(int n, int nnz, int local_nnz, int *irn_loc, int *jcn_loc, IssmPDouble *a_loc, IssmPDouble *rhs, Parameters *parameters=0)