ESYS13  Revision_
FCT_Solver.h
Go to the documentation of this file.
00001 
00002 /*******************************************************
00003 *
00004 * Copyright (c) 2003-2012 by University of Queensland
00005 * Earth Systems Science Computational Center (ESSCC)
00006 * http://www.uq.edu.au/esscc
00007 *
00008 * Primary Business: Queensland, Australia
00009 * Licensed under the Open Software License version 3.0
00010 * http://www.opensource.org/licenses/osl-3.0.php
00011 *
00012 *******************************************************/
00013 
00014 
00015 #ifndef INC_PASOFCT_SOLVER
00016 #define INC_PASOFCT_SOLVER
00017 
00018 #include "Transport.h"
00019 #include "FluxLimiter.h"
00020 #include "Solver.h"
00021 
00022 
00023 
00024 
00025 
00026 typedef struct Paso_FCT_Solver {
00027       Paso_TransportProblem* transportproblem;
00028       Esys_MPIInfo *mpi_info;
00029       Paso_FCT_FluxLimiter* flux_limiter;
00030       index_t method;
00031       double omega;
00032       double dt;
00033       double *b;
00034       double *z;
00035       double *du;
00036       Paso_Coupler *u_coupler;
00037       Paso_Coupler *u_old_coupler; /* last time step */
00038       
00039 } Paso_FCT_Solver;
00040 
00041 PASO_DLL_API
00042 Paso_FCT_Solver* Paso_FCT_Solver_alloc(Paso_TransportProblem *fctp, Paso_Options* options);
00043 
00044 PASO_DLL_API
00045 void Paso_FCT_Solver_free(Paso_FCT_Solver *in);
00046 
00047 PASO_DLL_API
00048 err_t Paso_FCT_Solver_update(Paso_FCT_Solver *fct_solver, double *u, double *u_old, Paso_Options* options, Paso_Performance *pp) ;
00049 
00050 
00051 PASO_DLL_API
00052 void Paso_FCT_setLowOrderOperator(Paso_TransportProblem * fc);
00053 
00054 PASO_DLL_API
00055 err_t Paso_FCT_Solver_updateNL(Paso_FCT_Solver *fct_solver, double* u, double *u_old, Paso_Options* options, Paso_Performance *pp) ;
00056 
00057 PASO_DLL_API
00058 err_t Paso_FCT_Solver_update_LCN(Paso_FCT_Solver *fct_solver, double * u, double *u_old, Paso_Options* options, Paso_Performance *pp) ;
00059 
00060 void Paso_FCT_setAntiDiffusionFlux_linearCN(Paso_SystemMatrix *flux_matrix, const Paso_TransportProblem* fct, 
00061                             const double dt, const Paso_Coupler* u_tilde_coupler,  
00062                             const Paso_Coupler* u_old_coupler);
00063 
00064 void Paso_FCT_setAntiDiffusionFlux_BE(Paso_SystemMatrix *flux_matrix,
00065                                       const Paso_TransportProblem* fct, 
00066                       const double dt,
00067                           const Paso_Coupler* u_coupler,  
00068                       const Paso_Coupler* u_old_coupler);
00069 
00070 void Paso_FCT_setAntiDiffusionFlux_CN(Paso_SystemMatrix *flux_matrix,
00071                                       const Paso_TransportProblem* fct, 
00072                       const double dt,
00073                           const Paso_Coupler* u_coupler,  
00074                       const Paso_Coupler* u_old_coupler);
00075 
00076 void Paso_FCT_Solver_initialize(const double dt, Paso_FCT_Solver *fct_solver, Paso_Options* options, Paso_Performance* pp) ;
00077 double Paso_FCT_Solver_getSafeTimeStepSize(Paso_TransportProblem* fctp);
00078 void Paso_FCT_Solver_setMuPaLu(double* out, const double* M, const Paso_Coupler* u_coupler, const double a, const Paso_SystemMatrix *L);
00079 
00080 #define Paso_FCT_Solver_getTheta(_fct_) ( ( (_fct_)->method == PASO_BACKWARD_EULER ) ? 1. : 0.5 )
00081 
00082 #endif /* #ifndef INC_PASOFCT_SOLVER */
00083