summaryrefslogtreecommitdiff
path: root/mesh.hpp
blob: 18e166e42b6455bcf55fe0c380620b02fe1f1930 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// -*- mode: c++ -*-

#ifndef MESH_HPP
#define MESH_HPP

#include "header.hpp"
#include "cell.hpp"

class Mesh
{

public:

  Mesh();

  void build_surface_mesh(H5::H5File fp, H5::H5File ep, std::string datasetname);
  void build_subsurface_mesh(H5::H5File fp);

  void build_environment(H5::H5File ep, std::string datasetname, int flag);
  void build_subsurface_environment(H5::H5File ep);

  Cell* get_cell(int index, int flag);

  void set_high_coordinate(int index, double value);
  double get_high_coordinate(int index);
  void set_low_coordinate(int index, double value);
  double get_low_coordinate(int index);
  void set_fuzz(double value);

  int get_n_cells(int flag);

private:

  int n_cells_subsurface;
  int n_cells_surface;

  double fuzz;
  
  std::vector<Cell> subsurface_cells;
  std::vector<Cell> surface_cells;

  std::vector<double> high_coordinates;
  std::vector<double> low_coordinates;

  std::vector<std::vector<double>> nodes;
  std::vector<std::vector<int>> element_node_indices;
  
  void handle_subsurface_node_data(H5::H5File fp);
  void build_subsurface_cells();

  void handle_surface_node_data(H5::H5File fp);
  void build_surface_cells(H5::H5File fp, std::string datasetname);

  void get_mesh_metadata(H5::H5File fp, int ncol);
  void read_velocity(H5::H5File fp, std::string groupname, std::string datasetname, int flag, int index);
  void read_water_depth(H5::H5File fp, std::string datasetname);
  void read_elevation(H5::H5File fp, std::string datasetname);
    
};

#endif