REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
NDArray< DataType > Struct Template Reference

NDArray is the datatype designed to hold any data, including scalars, multidimensional arrays, that read from the NetCDF file. More...

#include <REMORA_NCFile.H>

Collaboration diagram for NDArray< DataType >:

Public Types

using DType = typename std::remove_const< DataType >::type
 

Public Member Functions

 NDArray (const std::string vname, const std::vector< MPI_Offset > &vshape)
 constructor
 
 NDArray ()
 default constructor
 
decltype(auto) get_data ()
 get the data pointer
 
std::string get_vname ()
 get the variable name
 
std::vector< MPI_Offset > get_vshape ()
 get the variable data shape
 
size_t ndim ()
 return the total number of data
 
void set_vshape (std::vector< MPI_Offset > vshape)
 set the data shape information
 

Private Attributes

std::string name
 
std::vector< MPI_Offset > shape
 
std::shared_ptr< DType[]> data
 

Detailed Description

template<typename DataType>
struct NDArray< DataType >

NDArray is the datatype designed to hold any data, including scalars, multidimensional arrays, that read from the NetCDF file.

The data read from NetCDF file are stored in a continuous memory, and the data layout is described by using a vector (shape). AMRex Box can be constructed using the data shape information, and MultiFab data array can be setup using the data that stored in the NDArray.

Definition at line 35 of file REMORA_NCFile.H.

Member Typedef Documentation

◆ DType

template<typename DataType >
using NDArray< DataType >::DType = typename std::remove_const<DataType>::type

Definition at line 37 of file REMORA_NCFile.H.

Constructor & Destructor Documentation

◆ NDArray() [1/2]

template<typename DataType >
NDArray< DataType >::NDArray ( const std::string  vname,
const std::vector< MPI_Offset > &  vshape 
)
inlineexplicit

constructor

Definition at line 40 of file REMORA_NCFile.H.

◆ NDArray() [2/2]

template<typename DataType >
NDArray< DataType >::NDArray ( )
inline

default constructor

Definition at line 46 of file REMORA_NCFile.H.

Member Function Documentation

◆ get_data()

template<typename DataType >
decltype(auto) NDArray< DataType >::get_data ( )
inline

get the data pointer

Definition at line 49 of file REMORA_NCFile.H.

◆ get_vname()

template<typename DataType >
std::string NDArray< DataType >::get_vname ( )
inline

get the variable name

Definition at line 54 of file REMORA_NCFile.H.

◆ get_vshape()

template<typename DataType >
std::vector< MPI_Offset > NDArray< DataType >::get_vshape ( )
inline

get the variable data shape

Definition at line 59 of file REMORA_NCFile.H.

◆ ndim()

template<typename DataType >
size_t NDArray< DataType >::ndim ( )
inline

return the total number of data

Definition at line 64 of file REMORA_NCFile.H.

◆ set_vshape()

template<typename DataType >
void NDArray< DataType >::set_vshape ( std::vector< MPI_Offset >  vshape)
inline

set the data shape information

Definition at line 72 of file REMORA_NCFile.H.

Member Data Documentation

◆ data

template<typename DataType >
std::shared_ptr<DType[]> NDArray< DataType >::data
private

Definition at line 79 of file REMORA_NCFile.H.

Referenced by NDArray< DataType >::get_data().

◆ name

template<typename DataType >
std::string NDArray< DataType >::name
private

Definition at line 77 of file REMORA_NCFile.H.

Referenced by NDArray< DataType >::get_vname().

◆ shape

template<typename DataType >
std::vector<MPI_Offset> NDArray< DataType >::shape
private

The documentation for this struct was generated from the following file: