/[escript]/trunk/paso/src/Smoother.c
ViewVC logotype

Diff of /trunk/paso/src/Smoother.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3250 by caltinay, Thu Oct 7 01:49:18 2010 UTC revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC
# Line 58  Paso_Preconditioner_Smoother* Paso_Preco Line 58  Paso_Preconditioner_Smoother* Paso_Preco
58        
59    /* allocations: */      /* allocations: */  
60    Paso_Preconditioner_Smoother* out=MEMALLOC(1,Paso_Preconditioner_Smoother);    Paso_Preconditioner_Smoother* out=MEMALLOC(1,Paso_Preconditioner_Smoother);
61    if (! Paso_checkPtr(out)) {    if (! Esys_checkPtr(out)) {
62       out->localSmoother=Paso_Preconditioner_LocalSmoother_alloc(A_p->mainBlock,jacobi,verbose);       out->localSmoother=Paso_Preconditioner_LocalSmoother_alloc(A_p->mainBlock,jacobi,verbose);
63       out->is_local=is_local;       out->is_local=is_local;
64    }    }
65    if (Paso_MPIInfo_noError(A_p->mpi_info)) {    if (Esys_MPIInfo_noError(A_p->mpi_info)) {
66       return out;       return out;
67    } else {    } else {
68       Paso_Preconditioner_Smoother_free(out);       Paso_Preconditioner_Smoother_free(out);
69       return NULL;       return NULL;
70    }    }
71  }  }
72  Paso_Preconditioner_LocalSmoother* Paso_Preconditioner_LocalSmoother_alloc(Paso_SparseMatrix * A_p, const bool_t jacobi, const bool_t verbose)  Paso_Preconditioner_LocalSmoother* Paso_Preconditioner_LocalSmoother_alloc(Paso_SparseMatrix * A_p, const bool_t jacobi, bool_t verbose)
73  {  {
74        
75     dim_t n=A_p->numRows;     dim_t n=A_p->numRows;
76     dim_t n_block=A_p->row_block_size;     dim_t n_block=A_p->row_block_size;
77     dim_t block_size=A_p->block_size;     dim_t block_size=A_p->block_size;
78        
79     double time0=Paso_timer();     double time0=Esys_timer();
80     /* allocations: */       /* allocations: */  
81     Paso_Preconditioner_LocalSmoother* out=MEMALLOC(1,Paso_Preconditioner_LocalSmoother);     Paso_Preconditioner_LocalSmoother* out=MEMALLOC(1,Paso_Preconditioner_LocalSmoother);
82     if (! Paso_checkPtr(out)) {     if (! Esys_checkPtr(out)) {
83                
84        out->diag=MEMALLOC( ((size_t) n) * ((size_t) block_size),double);        out->diag=MEMALLOC( ((size_t) n) * ((size_t) block_size),double);
85        out->pivot=MEMALLOC( ((size_t) n) * ((size_t)  n_block), index_t);        out->pivot=MEMALLOC( ((size_t) n) * ((size_t)  n_block), index_t);
86        out->buffer=MEMALLOC( ((size_t) n) * ((size_t)  n_block), double);        out->buffer=MEMALLOC( ((size_t) n) * ((size_t)  n_block), double);
87        out->Jacobi=jacobi;        out->Jacobi=jacobi;
88                
89        if ( ! ( Paso_checkPtr(out->diag) || Paso_checkPtr(out->pivot) ) ) {        if ( ! ( Esys_checkPtr(out->diag) || Esys_checkPtr(out->pivot) ) ) {
90       Paso_SparseMatrix_invMain(A_p, out->diag, out->pivot );       Paso_SparseMatrix_invMain(A_p, out->diag, out->pivot );
91        }        }
92                
93     }     }
94     time0=Paso_timer()-time0;     time0=Esys_timer()-time0;
95        
96     if (Paso_noError()) {     if (Esys_noError()) {
97        if (verbose) {        if (verbose) {
98       if (jacobi) {       if (jacobi) {
99         printf("timing: Jacobi preparation: elemination : %e\n",time0);         printf("timing: Jacobi preparation: elemination : %e\n",time0);
# Line 424  void Paso_Preconditioner_LocalSmoother_S Line 424  void Paso_Preconditioner_LocalSmoother_S
424        }        }
425     }     }
426     return;     return;
427  }  }

Legend:
Removed from v.3250  
changed lines
  Added in v.3259

  ViewVC Help
Powered by ViewVC 1.1.26