Ignore:
Timestamp:
03/12/12 09:35:33 (13 years ago)
Author:
Eric.Larour
Message:

Large commit, to strip out Petsc from the code. Created new Matrix and Vector
wrapper objects to the Petsc Mat and Vec objects. These wrappers make it possible
to hook up a different package to handle matrix and vector operations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/objects/Numerics/Matrix.cpp

    r11670 r11679  
    140140        _error_("not implemented yet!");
    141141        #endif
     142        return dataref;
    142143
    143144}
    144145/*}}}*/
    145146#endif
     147/*FUNCTION Matrix::Assemble{{{1*/
     148void Matrix::Assemble(void){
     149        #ifdef _HAVE_PETSC_
     150                MatAssemblyBegin(this->matrix,MAT_FINAL_ASSEMBLY);
     151                MatAssemblyEnd(this->matrix,MAT_FINAL_ASSEMBLY);
     152                #if _PETSC_MAJOR_ == 2
     153                        MatCompress(this->matrix);
     154                #endif
     155        #else
     156                /*do nothing:*/
     157        #endif
     158
     159}
     160/*}}}*/
     161/*FUNCTION Matrix::Norm{{{1*/
     162double Matrix::Norm(int norm_type){
     163       
     164        double norm=0;
     165        #ifdef _HAVE_PETSC_
     166            MatNorm(this->matrix,(NormType)norm_type,&norm);
     167        #else
     168                _error_("not implemented yet!");
     169        #endif
     170        return norm;
     171}
     172/*}}}*/
     173/*FUNCTION Matrix::GetSize{{{1*/
     174void Matrix::GetSize(int* pM,int* pN){
     175       
     176        #ifdef _HAVE_PETSC_
     177            MatGetSize(this->matrix,pM,pN);
     178        #else
     179                _error_("not implemented yet!");
     180        #endif
     181}
     182/*}}}*/
     183/*FUNCTION Matrix::GetLocalSize{{{1*/
     184void Matrix::GetLocalSize(int* pM,int* pN){
     185       
     186        #ifdef _HAVE_PETSC_
     187            MatGetLocalSize(this->matrix,pM,pN);
     188        #else
     189                _error_("not implemented yet!");
     190        #endif
     191}
     192/*}}}*/
     193/*FUNCTION Matrix::MatMult{{{1*/
     194void Matrix::MatMult(Vector* X,Vector* AX){
     195
     196        #ifdef _HAVE_PETSC_
     197            MatMultPatch(this->matrix,X->vector,AX->vector);
     198        #else
     199                _error_("not implemented yet!");
     200        #endif
     201}
     202/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.