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
 
 NDArray (const NDArray &array)
 copy constructor
 
NDArrayoperator= (const NDArray &array)
 copy assignment
 
 ~NDArray ()
 destructor
 
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::atomic< size_t > ref_counted
 
bool owned
 
DTypedata
 

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/3]

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.

Here is the call graph for this function:

◆ NDArray() [2/3]

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

default constructor

Definition at line 46 of file REMORA_NCFile.H.

◆ NDArray() [3/3]

template<typename DataType >
NDArray< DataType >::NDArray ( const NDArray< DataType > &  array)
inline

copy constructor

Definition at line 49 of file REMORA_NCFile.H.

◆ ~NDArray()

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

destructor

Definition at line 68 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 74 of file REMORA_NCFile.H.

◆ get_vname()

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

get the variable name

Definition at line 80 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 85 of file REMORA_NCFile.H.

◆ ndim()

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

return the total number of data

Definition at line 90 of file REMORA_NCFile.H.

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

Here is the caller graph for this function:

◆ operator=()

template<typename DataType >
NDArray & NDArray< DataType >::operator= ( const NDArray< DataType > &  array)
inline

copy assignment

Definition at line 58 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 98 of file REMORA_NCFile.H.

Member Data Documentation

◆ data

◆ name

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

◆ owned

template<typename DataType >
bool NDArray< DataType >::owned
private

◆ ref_counted

template<typename DataType >
std::atomic<size_t> NDArray< DataType >::ref_counted
mutableprivate

◆ shape

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

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