Loading [MathJax]/extensions/tex2jax.js
PISM, A Parallel Ice Sheet Model 2.2.1-cd005eec8 committed by Constantine Khrulev on 2025-03-07
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PicoGeometry.hh
Go to the documentation of this file.
1/* Copyright (C) 2018, 2020, 2021, 2022, 2023 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 PISM_PICOGEOMETRY_H
21#define PISM_PICOGEOMETRY_H
22
23#include <set>
24
25#include "pism/util/Component.hh"
26#include "pism/util/array/Scalar.hh"
27
28namespace pism {
29namespace ocean {
30
31void eikonal_equation(array::Scalar1 &mask);
32
33/*!
34 * This class isolates geometric computations performed by the PICO ocean model.
35 */
36class PicoGeometry : public Component {
37public:
38 PicoGeometry(std::shared_ptr<const Grid> grid);
39 virtual ~PicoGeometry() = default;
40
41 void init();
42 void update(const array::Scalar &bed_elevation,
43 const array::CellType1 &cell_type);
44
46 const array::Scalar &box_mask() const;
47 const array::Scalar &ice_shelf_mask() const;
48 const array::Scalar &ice_rise_mask() const;
49 const array::Scalar &basin_mask() const;
50
51 enum IceRiseMask { OCEAN = 0, RISE = 1, CONTINENTAL = 2, FLOATING = 3 };
52
53private:
54 void compute_ice_rises(const array::CellType &cell_type,
55 bool exclude_ice_rises, array::Scalar &result);
56 void compute_lakes(const array::CellType &cell_type, array::Scalar &result);
57 void compute_ocean_mask(const array::CellType &cell_type, array::Scalar &result);
58 void compute_continental_shelf_mask(const array::Scalar &bed_elevation,
60 double bed_elevation_threshold,
61 array::Scalar &result);
63 const array::Scalar &lake_mask,
64 array::Scalar &result);
65
66 std::vector<std::set<int> > basin_neighbors(const array::CellType1 &cell_type,
68
71 const array::Scalar &shelf_mask,
72 int n_shelves,
73 std::vector<int> &most_shelf_cells_in_basin,
74 std::vector<int> &cfs_in_basins_per_shelf);
75
76 void split_ice_shelves(const array::CellType &cell_type,
78 const std::vector<std::set<int> > &basin_neighbors,
79 const std::vector<int> &most_shelf_cells_in_basin,
80 const std::vector<int> &cfs_in_basins_per_shelf,
81 int n_shelves,
82 array::Scalar &shelf_mask);
83
84 void compute_distances_cf(const array::Scalar1 &ocean_mask,
85 const array::Scalar &ice_rises,
86 bool exclude_ice_rises,
87 array::Scalar1 &result);
88
89 void compute_distances_gl(const array::Scalar &ocean_mask,
90 const array::Scalar1 &ice_rises,
91 bool exclude_ice_rises,
92 array::Scalar1 &result);
93
94 void compute_box_mask(const array::Scalar &D_gl,
95 const array::Scalar &D_cf,
96 const array::Scalar &shelf_mask,
97 int max_number_of_boxes,
98 array::Scalar &result);
99
101
102 // storage for outputs
107
108 // storage for intermediate fields
114
115 // temporary storage (ghosted to use with the connected component labeling code)
117
119 std::vector<std::set<int> > m_basin_neighbors;
120};
121
122} // end of namespace ocean
123} // end of namespace pism
124
125#endif /* PISM_PICOGEOMETRY_H */
std::shared_ptr< const Grid > grid() const
Definition Component.cc:105
A class defining a common interface for most PISM sub-models.
Definition Component.hh:118
"Cell type" mask. Adds convenience methods to array::Scalar.
Definition CellType.hh:30
const array::Scalar & continental_shelf_mask() const
void split_ice_shelves(const array::CellType &cell_type, const array::Scalar &basin_mask, const std::vector< std::set< int > > &basin_neighbors, const std::vector< int > &most_shelf_cells_in_basin, const std::vector< int > &cfs_in_basins_per_shelf, int n_shelves, array::Scalar &shelf_mask)
array::Scalar m_continental_shelf
void compute_box_mask(const array::Scalar &D_gl, const array::Scalar &D_cf, const array::Scalar &shelf_mask, int max_number_of_boxes, array::Scalar &result)
void compute_ocean_mask(const array::CellType &cell_type, array::Scalar &result)
const array::Scalar & ice_shelf_mask() const
void compute_distances_gl(const array::Scalar &ocean_mask, const array::Scalar1 &ice_rises, bool exclude_ice_rises, array::Scalar1 &result)
void compute_distances_cf(const array::Scalar1 &ocean_mask, const array::Scalar &ice_rises, bool exclude_ice_rises, array::Scalar1 &result)
std::vector< std::set< int > > basin_neighbors(const array::CellType1 &cell_type, const array::Scalar1 &basin_mask)
const array::Scalar & ice_rise_mask() const
void compute_ice_shelf_mask(const array::Scalar &ice_rise_mask, const array::Scalar &lake_mask, array::Scalar &result)
void compute_ice_rises(const array::CellType &cell_type, bool exclude_ice_rises, array::Scalar &result)
std::vector< std::set< int > > m_basin_neighbors
void compute_lakes(const array::CellType &cell_type, array::Scalar &result)
void relabel_by_size(array::Scalar &mask)
void update(const array::Scalar &bed_elevation, const array::CellType1 &cell_type)
void compute_continental_shelf_mask(const array::Scalar &bed_elevation, const array::Scalar &ice_rise_mask, double bed_elevation_threshold, array::Scalar &result)
const array::Scalar & basin_mask() const
const array::Scalar & box_mask() const
void identify_calving_front_connection(const array::CellType1 &cell_type, const array::Scalar &basin_mask, const array::Scalar &shelf_mask, int n_shelves, std::vector< int > &most_shelf_cells_in_basin, std::vector< int > &cfs_in_basins_per_shelf)
virtual ~PicoGeometry()=default
bool ocean(int M)
An ocean cell (floating ice or ice-free).
Definition Mask.hh:40
void eikonal_equation(array::Scalar1 &mask)