Changeset 12987


Ignore:
Timestamp:
08/10/12 15:35:47 (13 years ago)
Author:
Eric.Larour
Message:

CHG: changed the default constructor, according to which library
is available. This way, if Petsc is not available, Matrix and
Vector constructors default to SeqMat and SeqVec structures.

Location:
issm/trunk-jpl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl

    • Property svn:ignore
      •  

        old new  
         1projects
        12autom4te.cache
        23aclocal.m4
  • issm/trunk-jpl/src/c/classes/matrix/Matrix.cpp

    r12899 r12987  
    154154                #ifdef _HAVE_PETSC_
    155155                this->pmatrix->Echo();
    156                 #else
    157                 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
    158156                #endif
    159157        }
     
    171169                #ifdef _HAVE_PETSC_
    172170                this->pmatrix->Assemble();
    173                 #else
    174                 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
    175171                #endif
    176172        }
     
    191187                #ifdef _HAVE_PETSC_
    192188                norm=this->pmatrix->Norm(norm_type);
    193                 #else
    194                 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
    195189                #endif
    196190        }
     
    209203                #ifdef _HAVE_PETSC_
    210204                this->pmatrix->GetSize(pM,pN);
    211                 #else
    212                 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
    213205                #endif
    214206        }
     
    226218                #ifdef _HAVE_PETSC_
    227219                this->pmatrix->GetLocalSize(pM,pN);
    228                 #else
    229                 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
    230220                #endif
    231221        }
     
    243233                #ifdef _HAVE_PETSC_
    244234                this->pmatrix->MatMult(X->pvector,AX->pvector);
    245                 #else
    246                 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
    247235                #endif
    248236        }
     
    264252                #ifdef _HAVE_PETSC_
    265253                output->pmatrix=this->pmatrix->Duplicate();
    266                 #else
    267                 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
    268254                #endif
    269255        }
     
    284270                #ifdef _HAVE_PETSC_
    285271                output=this->pmatrix->ToSerial();
    286                 #else
    287                 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
    288272                #endif
    289273        }
     
    303287                #ifdef _HAVE_PETSC_
    304288                this->pmatrix->SetValues(m,idxm,n,idxn,values,mode);
    305                 #else
    306                 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
    307289                #endif
    308290        }
     
    319301                #ifdef _HAVE_PETSC_
    320302                this->pmatrix->Convert(newtype);
    321                 #else
    322                 _error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
    323303                #endif
    324304        }
  • issm/trunk-jpl/src/c/classes/matrix/Matrix.h

    r12860 r12987  
    3232                /*Matrix constructors, destructors {{{*/
    3333                Matrix();
     34                #ifdef _HAVE_PETSC_
    3435                Matrix(int M,int N,int type=PetscMatType);
    3536                Matrix(int M,int N,IssmDouble sparsity,int type=PetscMatType);
    3637                Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int type=PetscMatType);
    3738                Matrix(int M,int N,int connectivity,int numberofdofspernode,int type=PetscMatType);
     39                #else
     40                Matrix(int M,int N,int type=SeqMatType);
     41                Matrix(int M,int N,IssmDouble sparsity,int type=SeqMatType);
     42                Matrix(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity,int type=SeqMatType);
     43                Matrix(int M,int N,int connectivity,int numberofdofspernode,int type=SeqMatType);
     44                #endif
    3845                ~Matrix();
    3946                /*}}}*/
  • issm/trunk-jpl/src/c/classes/matrix/Vector.h

    r12910 r12987  
    3434                /*Vector constructors, destructors {{{*/
    3535                Vector();
     36                #ifdef _HAVE_PETSC_
     37                Vector(Vec petsc_vector);
    3638                Vector(int M,bool fromlocalsize=false,int type=PetscVecType);
    3739                Vector(IssmDouble* serial_vec,int pM,int type=PetscVecType);
    38                 #ifdef _HAVE_PETSC_
    39                 Vector(Vec petsc_vector);
     40                #else
     41                Vector(int M,bool fromlocalsize=false,int type=SeqVecType);
     42                Vector(IssmDouble* serial_vec,int pM,int type=SeqVecType);
    4043                #endif
     44
    4145                ~Vector();
    4246                /*}}}*/
Note: See TracChangeset for help on using the changeset viewer.