Changeset 16441


Ignore:
Timestamp:
10/16/13 23:22:45 (11 years ago)
Author:
Eric.Larour
Message:

CHG: fixed bug in module when allocating for ISSM matrices instead of PETSC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp

    r16438 r16441  
    3939
    4040        /*if our matrices are coming from issm, we don't do dynamic allocation like Petsc
    41          * does, and this routine is essentially useless. Force oldalloc in this case: */
     41         * does, and this routine is essentially useless. Force standard alloc in this case: */
    4242        toolkittype=ToolkitOptions::GetToolkitType();
    43         if(strcmp(toolkittype,"issm")==0)oldalloc=true;
    4443
    4544        if(oldalloc){
     
    5352                        m=flocalsize; n=flocalsize; /*local  sizes*/
    5453                        M=fsize;      N=fsize;      /*global sizes*/
    55                         MatrixNonzeros(&d_nnz,&o_nnz,femmodel,FsetEnum,FsetEnum);
    56                         Kff=new Matrix<IssmDouble>(m,n,M,N,d_nnz,o_nnz);
    57                         xDelete<int>(d_nnz);
    58                         xDelete<int>(o_nnz);
     54                        if(strcmp(toolkittype,"issm")==0){
     55                                Kff=new Matrix<IssmDouble>(m,n,M,N,NULL,NULL);
     56                        }
     57                        else{
     58                                MatrixNonzeros(&d_nnz,&o_nnz,femmodel,FsetEnum,FsetEnum);
     59                                Kff=new Matrix<IssmDouble>(m,n,M,N,d_nnz,o_nnz);
     60                                xDelete<int>(d_nnz);
     61                                xDelete<int>(o_nnz);
     62                        }
    5963                }
    6064                if(pKfs){
    6165                        m=flocalsize; n=slocalsize; /*local  sizes*/
    6266                        M=fsize;      N=ssize;      /*global sizes*/
    63                         MatrixNonzeros(&d_nnz,&o_nnz,femmodel,FsetEnum,SsetEnum);
    64                         Kfs=new Matrix<IssmDouble>(m,n,M,N,d_nnz,o_nnz);
    65                         xDelete<int>(d_nnz);
    66                         xDelete<int>(o_nnz);
     67                        if(strcmp(toolkittype,"issm")==0){
     68                                Kfs=new Matrix<IssmDouble>(m,n,M,N,NULL,NULL);
     69                        }
     70                        else{
     71                                MatrixNonzeros(&d_nnz,&o_nnz,femmodel,FsetEnum,SsetEnum);
     72                                Kfs=new Matrix<IssmDouble>(m,n,M,N,d_nnz,o_nnz);
     73                                xDelete<int>(d_nnz);
     74                                xDelete<int>(o_nnz);
     75                        }
    6776                }
    6877                if(pdf) df =new Vector<IssmDouble>(flocalsize,fsize);
Note: See TracChangeset for help on using the changeset viewer.