/[escript]/trunk/paso/src/FCT_Solver.cpp
ViewVC logotype

Diff of /trunk/paso/src/FCT_Solver.cpp

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

revision 4261 by jfenwick, Wed Feb 27 06:09:33 2013 UTC revision 4325 by jfenwick, Wed Mar 20 02:28:59 2013 UTC
# Line 40  Paso_FCT_Solver* Paso_FCT_Solver_alloc(P Line 40  Paso_FCT_Solver* Paso_FCT_Solver_alloc(P
40      const dim_t blockSize=Paso_TransportProblem_getBlockSize(fctp);      const dim_t blockSize=Paso_TransportProblem_getBlockSize(fctp);
41      const dim_t n =  Paso_TransportProblem_getTotalNumRows(fctp);      const dim_t n =  Paso_TransportProblem_getTotalNumRows(fctp);
42        
43      out=MEMALLOC(1,Paso_FCT_Solver);      out=new Paso_FCT_Solver;
44      if (! Esys_checkPtr(out)) {      if (! Esys_checkPtr(out)) {
45          out->transportproblem  = Paso_TransportProblem_getReference(fctp);          out->transportproblem  = Paso_TransportProblem_getReference(fctp);
46          out->mpi_info          = Esys_MPIInfo_getReference(fctp->mpi_info);          out->mpi_info          = Esys_MPIInfo_getReference(fctp->mpi_info);
47      out->flux_limiter      = Paso_FCT_FluxLimiter_alloc(fctp);      out->flux_limiter      = Paso_FCT_FluxLimiter_alloc(fctp);
48      out->b                 = MEMALLOC(n, double);      out->b                 = new double[n];
49      if ( (options->ode_solver == PASO_CRANK_NICOLSON) || (options->ode_solver == PASO_BACKWARD_EULER) ) {      if ( (options->ode_solver == PASO_CRANK_NICOLSON) || (options->ode_solver == PASO_BACKWARD_EULER) ) {
50          out->du = MEMALLOC(n, double);          out->du = new double[n];
51          out->z = MEMALLOC(n, double);          out->z = new double[n];
52          } else {          } else {
53           out->du = NULL;           out->du = NULL;
54           out->z=NULL;           out->z=NULL;
# Line 88  void Paso_FCT_Solver_free(Paso_FCT_Solve Line 88  void Paso_FCT_Solver_free(Paso_FCT_Solve
88        Paso_Coupler_free(in->u_old_coupler);        Paso_Coupler_free(in->u_old_coupler);
89        Paso_Coupler_free(in->u_coupler);        Paso_Coupler_free(in->u_coupler);
90    
91        MEMFREE(in->b);        delete[] in->b;
92        MEMFREE(in->z);        delete[] in->z;
93        MEMFREE(in->du);        delete[] in->du;
94            MEMFREE(in);            delete in;
95                
96      }      }
97  }  }

Legend:
Removed from v.4261  
changed lines
  Added in v.4325

  ViewVC Help
Powered by ViewVC 1.1.26