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

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

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

revision 3026 by gross, Mon May 10 06:23:49 2010 UTC revision 3033 by gross, Wed Jun 2 10:17:00 2010 UTC
# Line 112  double Paso_FCTSolver_getSafeTimeStepSiz Line 112  double Paso_FCTSolver_getSafeTimeStepSiz
112  {  {
113     dim_t i, n;     dim_t i, n;
114     double dt_max=LARGE_POSITIVE_FLOAT, dt_max_loc;     double dt_max=LARGE_POSITIVE_FLOAT, dt_max_loc;
115     register double l_ii,m_i;     register double l_ii,m_i,al_ii;
116     index_t fail=0, fail_loc;     index_t fail=0, fail_loc;
117     n=Paso_SystemMatrix_getTotalNumRows(fctp->transport_matrix);     n=Paso_SystemMatrix_getTotalNumRows(fctp->transport_matrix);
118     /* set low order transport operator */     /* set low order transport operator */
# Line 128  double Paso_FCTSolver_getSafeTimeStepSiz Line 128  double Paso_FCTSolver_getSafeTimeStepSiz
128          {          {
129                 dt_max_loc=LARGE_POSITIVE_FLOAT;                 dt_max_loc=LARGE_POSITIVE_FLOAT;
130             fail_loc=0;             fail_loc=0;
131                 #pragma omp for schedule(static) private(i,l_ii,m_i)                 #pragma omp for schedule(static) private(i,l_ii,m_i, al_ii)
132                 for (i=0;i<n;++i) {                 for (i=0;i<n;++i) {
133                    l_ii=fctp->main_diagonal_low_order_transport_matrix[i];                    l_ii=fctp->main_diagonal_low_order_transport_matrix[i];
134                    m_i=fctp->lumped_mass_matrix[i];                    m_i=fctp->lumped_mass_matrix[i];
135            if ( (m_i > 0) && (l_ii < 0 ) ) {                    al_ii=ABS(l_ii); /* al_ii should be negative, abs is taken to avoid problems with almost zero but positive values for l_ii */
136                dt_max_loc=MIN(dt_max_loc,-m_i/l_ii);            if ( (m_i > 0) ) {
137                  if (al_ii>0) dt_max_loc=MIN(dt_max_loc,m_i/al_ii);
138            } else {            } else {
139                fail_loc=-1;                fail_loc=-1;
140            }            }
# Line 155  double Paso_FCTSolver_getSafeTimeStepSiz Line 156  double Paso_FCTSolver_getSafeTimeStepSiz
156      }      }
157          #endif          #endif
158          if (fail < 0 ) {          if (fail < 0 ) {
159         Paso_setError(VALUE_ERROR, "Paso_FCTSolver_getSafeTimeStepSize: negative mass or positive diffusion term detected.");         Paso_setError(VALUE_ERROR, "Paso_FCTSolver_getSafeTimeStepSize: negative mass matrix entries detected.");
160         return -1;         return -1;
161      } else {      } else {
162          if (dt_max<LARGE_POSITIVE_FLOAT) dt_max*=fctp->dt_factor;          if (dt_max<LARGE_POSITIVE_FLOAT) dt_max*=fctp->dt_factor;

Legend:
Removed from v.3026  
changed lines
  Added in v.3033

  ViewVC Help
Powered by ViewVC 1.1.26