tPicoGeometry.hh - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
HTML git clone git://src.adamsgaard.dk/pism
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
tPicoGeometry.hh (3345B)
---
1 /* Copyright (C) 2018 PISM Authors
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
20 #ifndef PICOGEOMETRY_H
21 #define PICOGEOMETRY_H
22
23 #include "pism/util/Component.hh"
24 #include "pism/util/iceModelVec.hh"
25
26 namespace pism {
27
28 class IceModelVec2S;
29 class IceModelVec2CellType;
30
31 namespace ocean {
32
33 void eikonal_equation(IceModelVec2Int &mask);
34
35 /*!
36 * This class isolates geometric computations performed by the PICO ocean model.
37 */
38 class PicoGeometry : public Component {
39 public:
40 PicoGeometry(IceGrid::ConstPtr grid);
41 virtual ~PicoGeometry();
42
43 void update(const IceModelVec2S &bed_elevation, const IceModelVec2CellType &cell_type);
44
45 const IceModelVec2Int &continental_shelf_mask() const;
46 const IceModelVec2Int &box_mask() const;
47 const IceModelVec2Int &ice_shelf_mask() const;
48 const IceModelVec2Int &ice_rise_mask() const;
49
50 enum IceRiseMask { OCEAN = 0, RISE = 1, CONTINENTAL = 2, FLOATING = 3 };
51
52 private:
53 void compute_ice_rises(const IceModelVec2CellType &cell_type, bool exclude_ice_rises, IceModelVec2Int &result);
54 void compute_lakes(const IceModelVec2CellType &cell_type, IceModelVec2Int &result);
55 void compute_ocean_mask(const IceModelVec2CellType &cell_type, IceModelVec2Int &result);
56 void compute_continental_shelf_mask(const IceModelVec2S &bed_elevation, const IceModelVec2Int &ice_rises_mask,
57 double bed_elevation_threshold, IceModelVec2Int &result);
58 void compute_ice_shelf_mask(const IceModelVec2Int &ice_rises_mask, const IceModelVec2Int &lake_mask,
59 IceModelVec2Int &result);
60 void compute_distances_cf(const IceModelVec2Int &ocean_mask, const IceModelVec2Int &ice_rises, bool exclude_ice_rises,
61 IceModelVec2Int &dist_cf);
62 void compute_distances_gl(const IceModelVec2Int &ocean_mask, const IceModelVec2Int &ice_rises, bool exclude_ice_rises,
63 IceModelVec2Int &dist_gl);
64
65 void compute_box_mask(const IceModelVec2Int &D_gl, const IceModelVec2Int &D_cf, const IceModelVec2Int &shelf_mask,
66 int n_boxes, IceModelVec2Int &result);
67
68 void label_tmp();
69 void relabel_by_size(IceModelVec2Int &mask);
70
71 // storage for outputs
72 IceModelVec2Int m_continental_shelf;
73 IceModelVec2Int m_boxes;
74 IceModelVec2Int m_ice_shelves;
75
76 // storage for intermediate fields
77 IceModelVec2Int m_distance_gl;
78 IceModelVec2Int m_distance_cf;
79 IceModelVec2Int m_ocean_mask;
80 IceModelVec2Int m_lake_mask;
81 IceModelVec2Int m_ice_rises;
82
83 // temporary storage
84 IceModelVec2Int m_tmp;
85 petsc::Vec::Ptr m_tmp_p0;
86 };
87
88 } // end of namespace ocean
89 } // end of namespace pism
90
91 #endif /* PICOGEOMETRY_H */