95 |
void Paso_SolverFCT_solve(Paso_FCTransportProblem* fctp, double* u, double dt, double* source, Paso_Options* options) { |
void Paso_SolverFCT_solve(Paso_FCTransportProblem* fctp, double* u, double dt, double* source, Paso_Options* options) { |
96 |
|
|
97 |
index_t i; |
index_t i; |
98 |
int n_substeps,n, m; |
long n_substeps,n, m; |
99 |
double dt_max, omega, dt2,t; |
double dt_max, omega, dt2,t; |
100 |
double local_norm[2],norm[2],local_norm_u,local_norm_du,norm_u,norm_du, tolerance; |
double local_norm_u,local_norm_du,norm_u,norm_du, tolerance; |
101 |
register double rtmp1,rtmp2,rtmp3,rtmp4, rtmp; |
register double rtmp1,rtmp2,rtmp3,rtmp4, rtmp; |
102 |
double *b_n=NULL, *sourceP=NULL, *sourceN=NULL, *uTilde_n=NULL, *QN_n=NULL, *QP_n=NULL, *RN_m=NULL, *RP_m=NULL, *z_m=NULL, *du_m=NULL; |
double *b_n=NULL, *sourceP=NULL, *sourceN=NULL, *uTilde_n=NULL, *QN_n=NULL, *QP_n=NULL, *RN_m=NULL, *RP_m=NULL, *z_m=NULL, *du_m=NULL; |
103 |
Paso_SystemMatrix *flux_matrix=NULL; |
Paso_SystemMatrix *flux_matrix=NULL; |
104 |
dim_t n_rows=Paso_SystemMatrix_getTotalNumRows(fctp->transport_matrix); |
dim_t n_rows=Paso_SystemMatrix_getTotalNumRows(fctp->transport_matrix); |
105 |
bool_t converged; |
bool_t converged; |
106 |
|
#ifdef PASO_MPI |
107 |
|
double local_norm[2],norm[2]; |
108 |
|
#endif |
109 |
|
|
110 |
if (dt<=0.) { |
if (dt<=0.) { |
111 |
Paso_setError(TYPE_ERROR,"Paso_SolverFCT_solve: dt must be positive."); |
Paso_setError(TYPE_ERROR,"Paso_SolverFCT_solve: dt must be positive."); |
112 |
} |
} |
150 |
|
|
151 |
/* decide on substepping */ |
/* decide on substepping */ |
152 |
if (fctp->dt_max < LARGE_POSITIVE_FLOAT) { |
if (fctp->dt_max < LARGE_POSITIVE_FLOAT) { |
153 |
n_substeps=ceil(dt/dt_max); |
n_substeps=(long)ceil(dt/dt_max); |
154 |
} else { |
} else { |
155 |
n_substeps=1; |
n_substeps=1; |
156 |
} |
} |