Changeset 13869


Ignore:
Timestamp:
11/02/12 14:42:38 (12 years ago)
Author:
Mathieu Morlighem
Message:

NEW: added AllocationInfo method for matrices

Location:
issm/trunk-jpl/src/c
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/matrix/Matrix.h

    r13801 r13869  
    189189                }
    190190                /*}}}*/
     191                /*FUNCTION AllocationInfo{{{*/
     192                void AllocationInfo(void){
     193                        _assert_(this);
     194                        if(type==PetscMatType){
     195                                #ifdef _HAVE_PETSC_
     196                                this->pmatrix->AllocationInfo();
     197                                #endif
     198                        }
     199                        else if(type==SeqMatType){
     200                                //this->smatrix->AllocationInfo();
     201                        }
     202                        else _error_("Matrix type: " << type << " not supported yet!");
     203                }/*}}}*/
    191204                /*FUNCTION Assemble{{{*/
    192205                void Assemble(void){
  • issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp

    r13868 r13869  
    4040}
    4141/*}}}*/
    42 /*FUNCTION PetscMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){{{*/
     42/*FUNCTION PetscMat::PetscMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){{{*/
    4343PetscMat::PetscMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){
    4444
     
    7777
    7878/*PetscMat specific routines: */
     79/*FUNCTION PetscMat::AllocationInfo{{{*/
     80void PetscMat::AllocationInfo(void){
     81
     82        MatInfo info;
     83        MatGetInfo(this->matrix,MAT_GLOBAL_SUM,&info);
     84        _pprintLine_("=========================== Stiffness matrix allocation info ===========================");
     85        _pprintLine_("");
     86        _pprintLine_(" nz_allocated: "<<info.nz_allocated);
     87        _pprintLine_(" nz_used     : "<<info.nz_used);
     88        _pprintLine_(" nz_unneeded : "<<info.nz_unneeded<<" ("<<double(info.nz_unneeded)/double(info.nz_allocated)*100.<<"%)");
     89        _pprintLine_("");
     90        _pprintLine_("========================================================================================");
     91}
     92/*}}}*/
    7993/*FUNCTION PetscMat::Echo{{{*/
    8094void PetscMat::Echo(void){
  • issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.h

    r13623 r13869  
    4040                /*}}}*/
    4141                /*PetscMat specific routines {{{*/
     42                void AllocationInfo(void);
    4243                void Echo(void);
    4344                void Assemble(void);
Note: See TracChangeset for help on using the changeset viewer.