/[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 1362 by gross, Mon Dec 17 02:28:16 2007 UTC revision 1364 by gross, Mon Dec 17 07:22:45 2007 UTC
# Line 39  void Paso_FCTransportProblem_free(Paso_F Line 39  void Paso_FCTransportProblem_free(Paso_F
39             Paso_SystemMatrix_free(in->flux_matrix);             Paso_SystemMatrix_free(in->flux_matrix);
40             Paso_MPIInfo_free(in->mpi_info);             Paso_MPIInfo_free(in->mpi_info);
41    
42               MEMFREE(in->u);
43             MEMFREE(in->lumped_mass_matrix);             MEMFREE(in->lumped_mass_matrix);
44               MEMFREE(in->row_sum_flux_matrix);
45             MEMFREE(in->colorOf);             MEMFREE(in->colorOf);
46             MEMFREE(in->main_iptr);             MEMFREE(in->main_iptr);
47             MEMFREE(in);             MEMFREE(in);
# Line 87  Paso_FCTransportProblem* Paso_FCTranspor Line 89  Paso_FCTransportProblem* Paso_FCTranspor
89       if (Paso_checkPtr(out)) return NULL;       if (Paso_checkPtr(out)) return NULL;
90    
91       out->theta=theta;       out->theta=theta;
92         out->valid_matrices=FALSE;
93       out->transport_matrix=Paso_SystemMatrix_alloc(matrix_type,pattern,block_size,block_size);       out->transport_matrix=Paso_SystemMatrix_alloc(matrix_type,pattern,block_size,block_size);
94       Paso_SystemMatrix_allocBuffer(out->transport_matrix);       Paso_SystemMatrix_allocBuffer(out->transport_matrix);
95       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);
# Line 95  Paso_FCTransportProblem* Paso_FCTranspor Line 98  Paso_FCTransportProblem* Paso_FCTranspor
98       out->colorOf=NULL;       out->colorOf=NULL;
99       out->main_iptr=NULL;       out->main_iptr=NULL;
100       out->lumped_mass_matrix=NULL;       out->lumped_mass_matrix=NULL;
101         out->row_sum_flux_matrix=NULL;
102    
103       if (Paso_noError()) {       if (Paso_noError()) {
104           n=Paso_SystemMatrix_getTotalNumRows(out->transport_matrix);           n=Paso_SystemMatrix_getTotalNumRows(out->transport_matrix);
# Line 102  Paso_FCTransportProblem* Paso_FCTranspor Line 106  Paso_FCTransportProblem* Paso_FCTranspor
106           out->colorOf=MEMALLOC(n,index_t);           out->colorOf=MEMALLOC(n,index_t);
107           out->main_iptr=MEMALLOC(n,index_t);           out->main_iptr=MEMALLOC(n,index_t);
108           out->lumped_mass_matrix=MEMALLOC(n,double);           out->lumped_mass_matrix=MEMALLOC(n,double);
109             out->row_sum_flux_matrix=MEMALLOC(n,double);
110             out->u=MEMALLOC(n,double);
111    
112           if ( ! (Paso_checkPtr(out->colorOf) || Paso_checkPtr(out->main_iptr) || Paso_checkPtr(out->lumped_mass_matrix)) ) {           if ( ! (Paso_checkPtr(out->colorOf) || Paso_checkPtr(out->main_iptr) ||
113                     Paso_checkPtr(out->lumped_mass_matrix) || Paso_checkPtr(out->row_sum_flux_matrix) || Paso_checkPtr(out->u)) ) {
114                            
115               printf("Paso_SolverFCT_getFCTransportProblem: Revise coloring!!\n");               printf("Paso_SolverFCT_getFCTransportProblem: Revise coloring!!\n");
116               Paso_Pattern_color(pattern->mainPattern,&(out->num_colors),out->colorOf);               Paso_Pattern_color(pattern->mainPattern,&(out->num_colors),out->colorOf);
# Line 136  Paso_FCTransportProblem* Paso_FCTranspor Line 143  Paso_FCTransportProblem* Paso_FCTranspor
143       return NULL;       return NULL;
144    }    }
145  }  }
146    
147    void Paso_FCTransportProblem_checkinSolution(Paso_FCTransportProblem* in, double* u) {
148        dim_t i, n;
149      
150        n=Paso_FCTransportProblem_getTotalNumRows(in);
151        #pragma omp parallel for schedule(static) private(i)
152        for (i = 0; i < n; ++i) {
153             in->u[i]=u[i];
154        }
155    }

Legend:
Removed from v.1362  
changed lines
  Added in v.1364

  ViewVC Help
Powered by ViewVC 1.1.26