diff --git a/spm.c b/spm.c index 124241664bc582678797bc996794d1b426a13343..3694575619335115115b90809bfde0e49a4e7e74 100644 --- a/spm.c +++ b/spm.c @@ -219,6 +219,11 @@ spmBase( pastix_spm_t *spm, spm->loc2glob[i] += baseadj; } } + if (spm->dofs != NULL) { + for (i = 0; i < n; i++) { + spm->dofs[i] += baseadj; + } + } return; } diff --git a/spm.h b/spm.h index 524ba72dbef999a20963c645ab69580bbaf1a68b..37daba94d1ac87327212a0bb6f164911d0f23855 100644 --- a/spm.h +++ b/spm.h @@ -114,7 +114,25 @@ void spmIntSort1Asc1(void * const pbase, const pastix_int_t n); void spmIntSort2Asc1(void * const pbase, const pastix_int_t n); void spmIntSort2Asc2(void * const pbase, const pastix_int_t n); +/** + * Subroutines to print elements of spm structures + */ +static inline void z_spmPrintElt( FILE *f, pastix_int_t i, pastix_int_t j, pastix_complex64_t A ){ + fprintf( f, "%ld %ld %e %e\n", i, j, creal(A), cimag(A) ); +} +static inline void c_spmPrintElt( FILE *f, pastix_int_t i, pastix_int_t j, pastix_complex32_t A ){ + fprintf( f, "%ld %ld %e %e\n", i, j, crealf(A), cimagf(A) ); +} +static inline void d_spmPrintElt( FILE *f, pastix_int_t i, pastix_int_t j, double A ){ + fprintf( f, "%ld %ld %e\n", i, j, A ); +} +static inline void s_spmPrintElt( FILE *f, pastix_int_t i, pastix_int_t j, float A ){ + fprintf( f, "%ld %ld %e\n", i, j, A ); +} +/** + * SPM subroutines + */ int spmLoad( pastix_spm_t *spm, FILE *infile ); int spmSave( pastix_spm_t *spm, FILE *outfile ); @@ -137,9 +155,15 @@ pastix_int_t spmSymmetrize( pastix_spm_t *spm ); pastix_spm_t *spmCheckAndCorrect( pastix_spm_t *spm ); +/** + * SPM multi-dof subroutines + */ pastix_spm_t *spmExpand(const pastix_spm_t* spm); pastix_spm_t *spmDofExtend( const int type, const int dof, const pastix_spm_t *spm ); +/** + * SPM read driver access + */ int spmReadDriver( pastix_driver_t driver, char *filename, pastix_spm_t *spm,