escript
Revision_
|
00001 00002 /***************************************************************************** 00003 * 00004 * Copyright (c) 2003-2014 by University of Queensland 00005 * http://www.uq.edu.au 00006 * 00007 * Primary Business: Queensland, Australia 00008 * Licensed under the Open Software License version 3.0 00009 * http://www.opensource.org/licenses/osl-3.0.php 00010 * 00011 * Development until 2012 by Earth Systems Science Computational Center (ESSCC) 00012 * Development 2012-2013 by School of Earth Sciences 00013 * Development from 2014 by Centre for Geoscience Computing (GeoComp) 00014 * 00015 *****************************************************************************/ 00016 00017 #ifndef __PASO_FCTSOLVER_H__ 00018 #define __PASO_FCTSOLVER_H__ 00019 00020 #include "Transport.h" 00021 #include "FluxLimiter.h" 00022 #include "Solver.h" 00023 00024 namespace paso { 00025 00026 PASO_DLL_API 00027 struct FCT_Solver 00028 { 00029 FCT_Solver(const_TransportProblem_ptr tp, Options* options); 00030 00031 ~FCT_Solver(); 00032 00033 err_t update(double* u, double* u_old, Options* options, Performance* pp); 00034 00035 err_t updateNL(double* u, double* u_old, Options* options, Performance* pp); 00036 00037 err_t updateLCN(double* u, double* u_old, Options* options, Performance* pp); 00038 00039 void initialize(double dt, Options* options, Performance* pp); 00040 00041 static double getSafeTimeStepSize(TransportProblem_ptr tp); 00042 00043 static void setLowOrderOperator(TransportProblem_ptr tp); 00044 00045 void setAntiDiffusionFlux_linearCN(SystemMatrix_ptr flux_matrix); 00046 00047 void setAntiDiffusionFlux_BE(SystemMatrix_ptr flux_matrix); 00048 00049 void setAntiDiffusionFlux_CN(SystemMatrix_ptr flux_matrix); 00050 00051 void setMuPaLu(double* out, const_Coupler_ptr coupler, double a); 00052 00053 inline double getTheta() 00054 { 00055 return method == PASO_BACKWARD_EULER ? 1. : 0.5; 00056 } 00057 00058 const_TransportProblem_ptr transportproblem; 00059 Esys_MPIInfo* mpi_info; 00060 FCT_FluxLimiter* flux_limiter; 00061 index_t method; 00062 double omega; 00063 double dt; 00064 double* b; 00065 double* z; 00066 double* du; 00067 Coupler_ptr u_coupler; 00068 Coupler_ptr u_old_coupler; /* last time step */ 00069 }; 00070 00071 00072 } // namespace paso 00073 00074 #endif // __PASO_FCTSOLVER_H__ 00075