PISM, A Parallel Ice Sheet Model
stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
src
verification
tests
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
27
namespace
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
57
struct
TestPParameters
{
58
TestPParameters
(
int
N)
59
:
r
(N),
h
(N),
magvb
(N),
Wcrit
(N),
W
(N),
P
(N) {
60
error_code
= 0;
61
}
62
63
int
error_code
;
64
std::string
error_message
;
65
std::vector<double>
r
,
h
,
magvb
,
Wcrit
,
W
,
P
;
66
};
67
68
69
TestPParameters
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 */
pism::exactP
TestPParameters exactP(const std::vector< double > &r, double EPS_ABS, double EPS_REL, int ode_method)
Definition:
exactTestP.cc:260
pism
Definition:
AgeColumnSystem.cc:23
pism::TestPParameters::h
std::vector< double > h
Definition:
exactTestP.hh:65
pism::TestPParameters::TestPParameters
TestPParameters(int N)
Definition:
exactTestP.hh:58
pism::TestPParameters::Wcrit
std::vector< double > Wcrit
Definition:
exactTestP.hh:65
pism::TestPParameters::magvb
std::vector< double > magvb
Definition:
exactTestP.hh:65
pism::TestPParameters::P
std::vector< double > P
Definition:
exactTestP.hh:65
pism::TestPParameters::error_message
std::string error_message
Definition:
exactTestP.hh:64
pism::TestPParameters::W
std::vector< double > W
Definition:
exactTestP.hh:65
pism::TestPParameters::r
std::vector< double > r
Definition:
exactTestP.hh:65
pism::TestPParameters::error_code
int error_code
Definition:
exactTestP.hh:63
pism::TestPParameters
Definition:
exactTestP.hh:57
Generated by
1.9.1