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

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

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

revision 1400 by trankine, Fri Jan 11 07:45:58 2008 UTC revision 1401 by gross, Fri Jan 25 04:31:18 2008 UTC
# Line 43  void Paso_FCTransportProblem_free(Paso_F Line 43  void Paso_FCTransportProblem_free(Paso_F
43             MEMFREE(in->lumped_mass_matrix);             MEMFREE(in->lumped_mass_matrix);
44             MEMFREE(in->row_sum_flux_matrix);             MEMFREE(in->row_sum_flux_matrix);
45             MEMFREE(in->transport_matrix_diagonal);             MEMFREE(in->transport_matrix_diagonal);
46             MEMFREE(in->colorOf);             MEMFREE(in->r_p);
47               MEMFREE(in->r_n);
48             MEMFREE(in->main_iptr);             MEMFREE(in->main_iptr);
49             MEMFREE(in);             MEMFREE(in);
50          }          }
# Line 98  Paso_FCTransportProblem* Paso_FCTranspor Line 99  Paso_FCTransportProblem* Paso_FCTranspor
99       out->flux_matrix=Paso_SystemMatrix_alloc(matrix_type,pattern,block_size,block_size);       out->flux_matrix=Paso_SystemMatrix_alloc(matrix_type,pattern,block_size,block_size);
100       out->mpi_info=Paso_MPIInfo_getReference(pattern->mpi_info);       out->mpi_info=Paso_MPIInfo_getReference(pattern->mpi_info);
101    
      out->colorOf=NULL;  
102       out->main_iptr=NULL;       out->main_iptr=NULL;
103       out->lumped_mass_matrix=NULL;       out->lumped_mass_matrix=NULL;
104       out->row_sum_flux_matrix=NULL;       out->row_sum_flux_matrix=NULL;
105       out->transport_matrix_diagonal=NULL;       out->transport_matrix_diagonal=NULL;
106         out->r_p=NULL;
107         out->r_n=NULL;
108    
109       if (Paso_noError()) {       if (Paso_noError()) {
110           n=Paso_SystemMatrix_getTotalNumRows(out->transport_matrix);           n=Paso_SystemMatrix_getTotalNumRows(out->transport_matrix);
111    
112           out->colorOf=MEMALLOC(n,index_t);           out->r_p=MEMALLOC(n,double);
113             out->r_n=MEMALLOC(n,double);
114           out->main_iptr=MEMALLOC(n,index_t);           out->main_iptr=MEMALLOC(n,index_t);
115           out->lumped_mass_matrix=MEMALLOC(n,double);           out->lumped_mass_matrix=MEMALLOC(n,double);
116           out->row_sum_flux_matrix=MEMALLOC(n,double);           out->row_sum_flux_matrix=MEMALLOC(n,double);
117           out->transport_matrix_diagonal=MEMALLOC(n,double);           out->transport_matrix_diagonal=MEMALLOC(n,double);
118           out->u=MEMALLOC(n,double);           out->u=MEMALLOC(n,double);
119    
120           if ( ! (Paso_checkPtr(out->colorOf) || Paso_checkPtr(out->main_iptr) ||           if ( ! (Paso_checkPtr(out->r_p) || Paso_checkPtr(out->r_n) || Paso_checkPtr(out->main_iptr) ||
121                   Paso_checkPtr(out->lumped_mass_matrix) || Paso_checkPtr(out->transport_matrix_diagonal) || Paso_checkPtr(out->row_sum_flux_matrix) || Paso_checkPtr(out->u)) ) {                   Paso_checkPtr(out->lumped_mass_matrix) || Paso_checkPtr(out->transport_matrix_diagonal) || Paso_checkPtr(out->row_sum_flux_matrix) || Paso_checkPtr(out->u)) ) {
122                            
              printf("Paso_SolverFCT_getFCTransportProblem: Revise coloring!!\n");  
              Paso_Pattern_color(pattern->mainPattern,&(out->num_colors),out->colorOf);  
   
               
123               #pragma omp parallel for schedule(static) private(i)               #pragma omp parallel for schedule(static) private(i)
124               for (i = 0; i < n; ++i) {               for (i = 0; i < n; ++i) {
125                  out->lumped_mass_matrix[i]=0.;                  out->lumped_mass_matrix[i]=0.;
126                  out->row_sum_flux_matrix[i]=0.;                  out->row_sum_flux_matrix[i]=0.;
127                  out->u[i]=0.;                  out->u[i]=0.;
128                    out->r_p[i]=0.;
129                    out->r_n[i]=0.;
130               }               }
131               /* identify the main diagonals */               /* identify the main diagonals */
132               #pragma omp parallel for schedule(static) private(i,iptr,iptr_main,k)               #pragma omp parallel for schedule(static) private(i,iptr,iptr_main,k)

Legend:
Removed from v.1400  
changed lines
  Added in v.1401

  ViewVC Help
Powered by ViewVC 1.1.26