~fluidity-core/fluidity/sediment

« back to all changes in this revision

Viewing changes to bathymetry/SampleNetCDF2.h

  • Committer: rbn00
  • Date: 2010-04-29 12:34:09 UTC
  • Revision ID: svn-v4:5bf5533e-7014-46e3-b1bb-cce4b9d03719:trunk:1098
Added the following functionalities:
1) Added a -s option to fldecomp which allows you to decomp meshes with a topological dimension of 2 lying in 3d space (i.e. a mesh on the surface of a sphere).
2) Radial extrusions now work in parallel.
3) When extruding radially, added an option to extrude along a bathymetry map (see bathymetry/NetCDF_reader.cpp for supported formats). To enable this option, under extrude/bottom_depth select from_map and then enter the location of your bathymetry map. This option currently only functions with radial extrusions, I will add an options check to reflect this very soon. This extrusion is also currently very slow, but this should be optimized soon. Additionally, under the extrude/sizing_function a 'list' option has been added. This is not currently working (but will be soon) which allows the user to specify a series of real numbers giving the separation between layers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *      Copyright (c) 2004-2006 by Gerard Gorman
 
3
 *      Copyright (c) 2006- Imperial College London
 
4
 *      See COPYING file for copying and redistribution conditions.
 
5
 *
 
6
 *      This program is free software; you can redistribute it and/or modify
 
7
 *      it under the terms of the GNU General Public License as published by
 
8
 *      the Free Software Foundation; version 2 of the License.
 
9
 *
 
10
 *      This program is distributed in the hope that it will be useful,
 
11
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *      GNU General Public License for more details.
 
14
 *
 
15
 *      Contact info: gerard.j.gorman@gmail.com/g.gorman@imperial.ac.uk
 
16
 */
 
17
#ifndef SAMPLENETCDF2_H
 
18
#define SAMPLENETCDF2_H
 
19
#include <cmath>
 
20
#include <string>
 
21
#include <vector>
 
22
 
 
23
#include <string.h>
 
24
extern "C" {
 
25
#include <netcdf.h>
 
26
}
 
27
// #include "tools.h" // Experimenting to see whether this is needed
 
28
#include "NetCDF_reader.h"
 
29
 
 
30
class SampleNetCDF2{
 
31
 public:
 
32
  SampleNetCDF2();
 
33
  SampleNetCDF2(std::string);
 
34
  ~SampleNetCDF2();
 
35
  
 
36
  double GetValue(double, double) const;
 
37
 
 
38
  bool HasPoint(double, double) const;
 
39
 
 
40
  void SetFile(std::string);
 
41
  
 
42
  void VerboseOff();
 
43
  void VerboseOn();
 
44
 
 
45
 private:
 
46
  void Debug(char *) const;
 
47
  double GetValue(int, int) const;
 
48
 
 
49
  bool is_constant;
 
50
  
 
51
  double x_range[2];          // Longitude
 
52
  double y_range[2];          // Latitude
 
53
  
 
54
  double spacing[2];          // Grid spacing
 
55
  int dimension[2];           // Grid dimensions
 
56
  
 
57
  std::vector<double> data;
 
58
  bool verbose;
 
59
};
 
60
#endif