38 #ifndef GRID_LEVEL_LEVEL_H
39 #define GRID_LEVEL_LEVEL_H
47 #include "utils/logger.h"
99 unsigned long m_size[MAX_DIMENSIONS];
175 double min(
unsigned int n)
const
187 double max(
unsigned int n)
const
211 const char* filename,
213 grid::ValuePosition valuePos)
228 for (
unsigned int i = 0; i <
m_dims; i++) {
239 for (
unsigned int i = 0; i <
m_dims; i++) {
244 m_min[i] = -std::numeric_limits<double>::infinity();
245 m_max[i] = std::numeric_limits<double>::infinity();
251 if (valuePos == grid::CELL_CENTERED) {
257 m_min[i] = std::min(min, max);
258 m_max[i] = std::max(min, max);
344 unsigned long size(
unsigned int n)
const
358 for (
int i =
m_dims-1; i >= 0; i--) {
361 if (x < 0 || x >=
m_size[i]) {
362 logWarning() <<
"ASAGI: Coordinate in dimension" << (
m_dims-i-1) <<
" is out of range. Fixing.";
400 if ((scaling == 0) || std::isinf(scaling))
411 return std::floor(value + 0.5);
419 #endif // GRID_LEVEL_LEVEL_H
double max(unsigned int n) const
unsigned long size(unsigned int n) const
double m_min[MAX_DIMENSIONS]
double m_scaling[MAX_DIMENSIONS]
double m_offset[MAX_DIMENSIONS]
double m_scalingInv[MAX_DIMENSIONS]
void incCounter(perf::Counter::CounterType type)
numa::NumaComm * m_numaComm
void inc(CounterType type)
unsigned long m_size[MAX_DIMENSIONS]
unsigned int dimensions() const
Base class for a grid level.
unsigned int typeSize() const
unsigned int numaDomainId() const
static double round(double value)
static constexpr double NUMERIC_PRECISION
static double getInvScaling(double scaling)
unsigned long getCounter(perf::Counter::CounterType type) const
double delta(unsigned int n) const
unsigned int dimensions() const
unsigned int m_numaDomainId
Include file for C and C++ API.
io::NetCdfReader * m_inputFile
unsigned int domainId() const
const mpi::MPIComm & comm() const
double m_max[MAX_DIMENSIONS]
void pos2index(const double *pos, size_t *index)
unsigned long getSize(int i) const
double getScaling(int i) const
const Type & type() const
Level(const Level &other)
asagi::Grid::Error open(const char *filename, const char *varname, grid::ValuePosition valuePos)
const numa::NumaComm & numa() const
double getOffset(int i) const
Level(mpi::MPIComm &comm, const numa::Numa &numa, Type &type)
asagi::Grid::Error open(const char *varname="z")
io::NetCdfReader & inputFile() const
unsigned long get(CounterType type) const
double min(unsigned int n) const