escript  Revision_
ReactiveSolver.h
Go to the documentation of this file.
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 
00018 #ifndef __PASO_REACTIVESOLVER_H__
00019 #define __PASO_REACTIVESOLVER_H__
00020 
00021 #include "performance.h"
00022 #include "Transport.h"
00023 
00024 // exp(h)-1 ~ h + h**2/2 for abs(h) <  PASO_RT_EXP_LIM_MIN
00025 #define PASO_RT_EXP_LIM_MIN sqrt(EPSILON)
00026 
00027 // it is assumed that exp(h) with  h>PASO_RT_EXP_LIM_MAX is not reliable
00028 #define PASO_RT_EXP_LIM_MAX log(1./sqrt(EPSILON))
00029 
00030 namespace paso {
00031 
00032 PASO_DLL_API
00033 struct ReactiveSolver
00034 {
00035     ReactiveSolver(const_TransportProblem_ptr _tp) : tp(_tp) {}
00036     ~ReactiveSolver() {}
00037 
00038     inline void initialize(double _dt, Options*)
00039     {
00040         dt = _dt;
00041     }
00042 
00043     err_t solve(double* u, double* u_old, const double* source,
00044                 Options* options, Performance* pp);
00045 
00046     static double getSafeTimeStepSize(const_TransportProblem_ptr tp);
00047 
00048     const_TransportProblem_ptr tp;
00049     double dt;
00050 };
00051 
00052 
00053 } // namespace paso
00054 
00055 #endif // __PASO_REACTIVESOLVER_H__
00056