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

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

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

revision 3641 by jfenwick, Mon Oct 11 01:48:14 2010 UTC revision 3642 by caltinay, Thu Oct 27 03:41:51 2011 UTC
# Line 43  Line 43 
43  void Paso_TransportProblem_solve(Paso_TransportProblem* fctp, double* u, double dt, double* u0, double* q, Paso_Options* options) {  void Paso_TransportProblem_solve(Paso_TransportProblem* fctp, double* u, double dt, double* u0, double* q, Paso_Options* options) {
44     const double reduction_after_divergence_factor = 0.5;     const double reduction_after_divergence_factor = 0.5;
45     const dim_t num_failures_max=50;     const dim_t num_failures_max=50;
46     /* const double increase_after_convergence_factor = 1.1;  has not much of an impact if substepping is beeing used */     /* const double increase_after_convergence_factor = 1.1;  has not much of an impact if substepping is being used */
47        
48     Paso_Performance pp;       Paso_Performance pp;  
49     Paso_Function *fctfunction=NULL;     Paso_Function *fctfunction=NULL;
# Line 63  void Paso_TransportProblem_solve(Paso_Tr Line 63  void Paso_TransportProblem_solve(Paso_Tr
63         Esys_setError(VALUE_ERROR,"Paso_TransportProblem_solve: dt must be positive.");         Esys_setError(VALUE_ERROR,"Paso_TransportProblem_solve: dt must be positive.");
64     }     }
65     if (blockSize>1) {     if (blockSize>1) {
66         Esys_setError(VALUE_ERROR,"Paso_TransportProblem_solve: block size >0 is not supported.");         Esys_setError(VALUE_ERROR,"Paso_TransportProblem_solve: block size >1 is not supported.");
67      }      }
68     if (options->verbose) {     if (options->verbose) {
69        if (fctp->useBackwardEuler) {        if (fctp->useBackwardEuler) {
# Line 112  void Paso_TransportProblem_solve(Paso_Tr Line 112  void Paso_TransportProblem_solve(Paso_Tr
112              Paso_ReactiveSolver_initialize(dt3, fctp, options);              Paso_ReactiveSolver_initialize(dt3, fctp, options);
113          /* start iteration */          /* start iteration */
114          for (i_substeps =0; (i_substeps<n_substeps) && (errorCode==SOLVER_NO_ERROR) && Esys_noError(); i_substeps++) {          for (i_substeps =0; (i_substeps<n_substeps) && (errorCode==SOLVER_NO_ERROR) && Esys_noError(); i_substeps++) {
115              if (options->verbose) printf("Paso_TransportProblem_solve: substep step %d of %d at t = %e (dt = %e)\n",i_substeps,n_substeps,t+dt3,dt3);              if (options->verbose) printf("Paso_TransportProblem_solve: substep %d of %d at t = %e (dt = %e)\n",i_substeps,n_substeps,t+dt3,dt3);
116              /* updates u */              /* updates u */
117              errorCode=Paso_ReactiveSolver_solve(rsolver,fctp,u,dt3/2,q, options, &pp); /* Mu_t=Du+q u(0)=u */              errorCode=Paso_ReactiveSolver_solve(rsolver,fctp,u,dt3/2,q, options, &pp); /* Mu_t=Du+q u(0)=u */
118              if (errorCode == SOLVER_NO_ERROR) {              if (errorCode == SOLVER_NO_ERROR) {
# Line 127  void Paso_TransportProblem_solve(Paso_Tr Line 127  void Paso_TransportProblem_solve(Paso_Tr
127          }          }
128              }              }
129              /*              /*
130           * error handeling:           * error handling:
131           */           */
132               if (errorCode == SOLVER_NO_ERROR) {               if (errorCode == SOLVER_NO_ERROR) {
133                      num_failures=0;                      num_failures=0;
# Line 156  void Paso_TransportProblem_solve(Paso_Tr Line 156  void Paso_TransportProblem_solve(Paso_Tr
156              } else if (errorCode == SOLVER_INPUT_ERROR) {              } else if (errorCode == SOLVER_INPUT_ERROR) {
157              Esys_setError(VALUE_ERROR,"Paso_TransportProblem_solve: input error for solver.");              Esys_setError(VALUE_ERROR,"Paso_TransportProblem_solve: input error for solver.");
158          } else if (errorCode == SOLVER_MEMORY_ERROR) {          } else if (errorCode == SOLVER_MEMORY_ERROR) {
159              Esys_setError(MEMORY_ERROR,"Paso_TransportProblem_solve: memory allication failed.");              Esys_setError(MEMORY_ERROR,"Paso_TransportProblem_solve: memory allocation failed.");
160          } else if (errorCode == SOLVER_BREAKDOWN) {          } else if (errorCode == SOLVER_BREAKDOWN) {
161              Esys_setError(VALUE_ERROR,"Paso_TransportProblem_solve: solver break down.");              Esys_setError(VALUE_ERROR,"Paso_TransportProblem_solve: solver break down.");
162          } else if (errorCode == SOLVER_NEGATIVE_NORM_ERROR) {          } else if (errorCode == SOLVER_NEGATIVE_NORM_ERROR) {

Legend:
Removed from v.3641  
changed lines
  Added in v.3642

  ViewVC Help
Powered by ViewVC 1.1.26