PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
LingleClarkSerial.hh
Go to the documentation of this file.
1 // Copyright (C) 2007--2009, 2011, 2012, 2013, 2014, 2015, 2017, 2018, 2019, 2020, 2021 Ed Bueler and Constantine Khroulev
2 //
3 // This file is part of PISM.
4 //
5 // PISM is free software; you can redistribute it and/or modify it under the
6 // terms of the GNU General Public License as published by the Free Software
7 // Foundation; either version 3 of the License, or (at your option) any later
8 // version.
9 //
10 // PISM is distributed in the hope that it will be useful, but WITHOUT ANY
11 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with PISM; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 #ifndef LINGLECLARKSERIAL_H
20 #define LINGLECLARKSERIAL_H
21 
22 #include <vector>
23 #include <fftw3.h>
24 
25 #include "pism/util/petscwrappers/Vec.hh"
26 #include "pism/util/Logger.hh"
27 
28 namespace pism {
29 
30 class Config;
31 
32 namespace bed {
33 
34 //! Class implementing the bed deformation model described in [@ref BLKfastearth].
35 /*!
36  This class implements the [@ref LingleClark] bed deformation model by a Fourier
37  spectral collocation method, as described in [@ref BLKfastearth]. (The former
38  reference is where the continuum model arose, and a flow-line application is given.
39  The latter reference describes a new, fast method and gives verification results.
40  See also [@ref BLK2006earth] if more technical detail and/or Matlab programs are desired.)
41 
42  Both a viscous half-space model (with elastic
43  lithosphere) and a spherical elastic model are computed. They are superposed
44  because the underlying earth model is linear.
45 
46  The class assumes that the supplied Petsc Vecs are *sequential*. It is expected to be
47  run only on processor zero (or possibly by each processor once each processor
48  owns the entire 2D gridded load thicknesses and bed elevations.)
49 
50  This model always assumes that we start with no load. Note that this does not mean that we
51  starting state is the equilibrium: the viscous plate may be "pre-bent" by using a provided
52  displacement field or by computing its displacement using an uplift field.
53 */
55 public:
57  const Config &config,
58  bool include_elastic,
59  int Mx, int My,
60  double dx, double dy,
61  int Nx, int Ny);
63 
66 
67  void bootstrap(petsc::Vec &thickness, petsc::Vec &uplift);
68 
69  void step(double dt_seconds, petsc::Vec &H);
70 
71  const petsc::Vec &total_displacement() const;
72 
73  const petsc::Vec &viscous_displacement() const;
74 
75  const petsc::Vec &elastic_displacement() const;
76 
77  void compute_load_response_matrix(fftw_complex *output);
78 private:
80 
81  void uplift_problem(petsc::Vec &load_thickness, petsc::Vec &bed_uplift, petsc::Vec &output);
82 
84 
86 
88  // grid size
89  int m_Mx;
90  int m_My;
91  // grid spacing
92  double m_dx;
93  double m_dy;
94  //! load density (for computing load from its thickness)
96  //! mantle density
98  //! mantle viscosity
99  double m_eta;
100  //! lithosphere flexural rigidity
101  double m_D;
102 
103  // acceleration due to gravity
105 
106  // size of the extended grid
107  int m_Nx;
108  int m_Ny;
109 
110  // indices into extended grid for the corner of the physical grid
113 
114  // half-lengths of the extended (FFT, spectral) computational domain
115  double m_Lx;
116  double m_Ly;
117 
118  // Coefficients of derivatives in Fourier space
119  std::vector<double> m_cx, m_cy;
120 
121  // viscous displacement on the extended grid
123 
124  // elastic plate displacement
126 
127  // total (viscous and elastic) plate displacement
129 
130  fftw_complex *m_fftw_input;
131  fftw_complex *m_fftw_output;
132  fftw_complex *m_loadhat;
133  fftw_complex *m_lrm_hat;
134 
135  fftw_plan m_dft_forward;
136  fftw_plan m_dft_inverse;
137 
138  void tweak(petsc::Vec &load_thickness, petsc::Vec &U, int Nx, int Ny, double time);
139 
141 };
142 
143 } // end of namespace bed
144 } // end of namespace pism
145 
146 #endif /* LINGLECLARKSERIAL_H */
A class for storing and accessing PISM configuration flags and parameters.
std::shared_ptr< const Logger > ConstPtr
Definition: Logger.hh:46
void uplift_problem(petsc::Vec &load_thickness, petsc::Vec &bed_uplift, petsc::Vec &output)
void update_displacement(petsc::Vec &V, petsc::Vec &dE, petsc::Vec &dU)
LingleClarkSerial(Logger::ConstPtr log, const Config &config, bool include_elastic, int Mx, int My, double dx, double dy, int Nx, int Ny)
void step(double dt_seconds, petsc::Vec &H)
const petsc::Vec & viscous_displacement() const
void tweak(petsc::Vec &load_thickness, petsc::Vec &U, int Nx, int Ny, double time)
double m_D
lithosphere flexural rigidity
void bootstrap(petsc::Vec &thickness, petsc::Vec &uplift)
void compute_elastic_response(petsc::Vec &H, petsc::Vec &dE)
double m_mantle_density
mantle density
void compute_load_response_matrix(fftw_complex *output)
void init(petsc::Vec &viscous_displacement, petsc::Vec &elastic_displacement)
const petsc::Vec & elastic_displacement() const
const petsc::Vec & total_displacement() const
double m_eta
mantle viscosity
double m_load_density
load density (for computing load from its thickness)
Class implementing the bed deformation model described in [BLKfastearth].