PISM, A Parallel Ice Sheet Model 2.2.1-cd005eec8 committed by Constantine Khrulev on 2025-03-07
Loading...
Searching...
No Matches
exactTestP.hh
Go to the documentation of this file.
1/*
2 Copyright (C) 2012-2013, 2016 Ed Bueler
3
4 This file is part of PISM.
5
6 PISM is free software; you can redistribute it and/or modify it under the
7 terms of the GNU General Public License as published by the Free Software
8 Foundation; either version 3 of the License, or (at your option) any later
9 version.
10
11 PISM is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14 details.
15
16 You should have received a copy of the GNU General Public License
17 along with PISM; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19*/
20
21#ifndef __exactTestP_h
22#define __exactTestP_h 1
23
24#include <vector>
25#include <string>
26
27namespace pism {
28
29/*
30!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
31! exactTestP is a C++ implementation of a nearly-exact solution to the 'distributed'
32! subglacial hydrology model described in the draft manuscript
33!
34! Ed Bueler & Ward van Pelt (2013) "A distributed model of subglacial
35! and englacial hydrology in tidewater glaciers and ice sheets"
36!
37! This nearly-exact solution requires solving an ODE numerically.
38! Only the steady water thickness solution W(r) is computed here. The
39! pressure P can be computed by the formula P(W) which applies in steady state.
40!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
41*/
42
43/* determines range on which W(r) is valid in Test P */
44#define TESTP_R0 25000.0 /* m */
45#define TESTP_L 0.9 * TESTP_R0 /* m */
46
47/* exit status of exactP() could be one of these; return of zero indicates success */
48#define TESTP_R_NEGATIVE 78463
49#define TESTP_W_EXCEEDS_WR 78464
50#define TESTP_W_BELOW_WCRIT 78465
51#define TESTP_INVALID_METHOD 78466
52#define TESTP_NOT_DONE 78467
53#define TESTP_NO_LIST 78482
54#define TESTP_LIST_NOT_DECREASING 78483
55#define TESTP_OLD_GSL 78484
56
59 : r(N), h(N), magvb(N), Wcrit(N), W(N), P(N) {
60 error_code = 0;
61 }
62
64 std::string error_message;
65 std::vector<double> r, h, magvb, Wcrit, W, P;
66};
67
68
69TestPParameters exactP(const std::vector<double> &r,
70 double EPS_ABS, double EPS_REL, int ode_method);
71/* Input r in meters, assumes that values in are decreasing (r[0] > r[1] > ... > r[N-1] >= 0).
72 ode_method = 1 : rk8pd is Runge-Kutta Prince-Dormand (8,9) [default]
73 2 : rk2 is Runge-Kutta (2,3)
74 3 : rkf45 is Runge-Kutta-Felberg (4,5)
75 4 : rkck is Runge-Kutta Cash-Karp (4,5)
76 None of these are implicit. The Jacobian has not been implemented.
77 Returns h (m), magvb (m s-1), W_c (m), W (m), P (Pa). */
78
79} // end of namespace pism
80
81#endif /* __exactTestP_h */
TestPParameters exactP(const std::vector< double > &r, double EPS_ABS, double EPS_REL, int ode_method)
std::vector< double > h
Definition exactTestP.hh:65
std::vector< double > Wcrit
Definition exactTestP.hh:65
std::vector< double > magvb
Definition exactTestP.hh:65
std::vector< double > P
Definition exactTestP.hh:65
std::string error_message
Definition exactTestP.hh:64
std::vector< double > W
Definition exactTestP.hh:65
std::vector< double > r
Definition exactTestP.hh:65