#ifdef HAVE_PETSC #include #include #include #include #include #include #include "common_c.h" #include "FCMangle.h" #define fillsparsecpetscs FortranCInterface_GLOBAL_(fillsparsecpetscs, FILLSPARSECPETSCS) #define fillsparsecpetscc FortranCInterface_GLOBAL_(fillsparsecpetscc, FILLSPARSECPETSCC) #define COLMAJ2D(row,col,numrow) (row-1)+(col-1)*numrow #define COLMAJ3D(a,b,c,amax,bmax,cmax) (a-1)+amax*((b-1)+bmax*(c-1)) #define ROWMAJ2D_ONE(row,col,numcol) (row-1)*numcol+(col-1) typedef long long int gcorp_t; void fillsparsecpetscs(gcorp_t* ieng, double* EGmass, Mat* lhsP) { int npro = propar.npro; int nshl = shpdat.nshl; double* mb = (double*) malloc(sizeof(double)*nshl*nshl); //block to insert int e,i,j,aa; //following along with fillsparse.f PetscInt* locat = (PetscInt*) malloc(sizeof(PetscInt)*nshl); for(e=0;e=0); for (i=0; i=0); for (i=0; i