Peano
Loading...
Searching...
No Matches
NetCDFFileReader.h
Go to the documentation of this file.
1// This file is part of the Peano project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5#include "config.h"
6
7#ifdef UseNetCDF
8
9#include <string>
10
11namespace tarch::reader {
12 class NetCDFFileReader;
13} // namespace tarch::reader
14
15class tarch::reader::NetCDFFileReader {
16public:
23 int open(const std::string& filename);
24
31 int close(int ncid);
32
42 std::size_t getDimension(int ncid, const char* key);
43
53 int* getGlobalAttInt(int ncid, const char* name);
54
64 float* getGlobalAttFloat(int ncid, const char* name);
65
75 double* getGlobalAttDouble(int ncid, const char* name);
76
86 char* getGlobalAttText(int ncid, const char* name);
87
96 int readVariable1D(int ncid, const char* key, double* variable);
97
109 int readVariable2D(int ncid, const char* key, double** variable, std::size_t rows, std::size_t cols);
110
120 int readVariable2D(int ncid, const char* key, double* variable);
121
134 int readVariable2DHyperslab(
135 int ncid,
136 const char* key,
137 double** variable,
138 std::size_t rows,
139 std::size_t cols,
140 std::size_t start
141 );
142
156 int readVariable3DHyperslab(
157 int ncid,
158 const char* key,
159 double* variable,
160 std::size_t rows,
161 std::size_t cols,
162 std::size_t start,
163 std::size_t end
164 );
165};
166
167#endif