Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
moab::UcdNCWriteHelper Class Reference

Child helper class for ucd mesh, e.g. CAM_SE (HOMME) or MPAS. More...

#include <NCWriteHelper.hpp>

+ Inheritance diagram for moab::UcdNCWriteHelper:
+ Collaboration diagram for moab::UcdNCWriteHelper:

Public Member Functions

 UcdNCWriteHelper (WriteNC *writeNC, int fileId, const FileOptions &opts, EntityHandle fileSet)
virtual ~UcdNCWriteHelper ()

Protected Member Functions

template<typename T >
void jik_to_kji_stride (size_t, size_t nj, size_t nk, T *dest, T *source, Range &localGid)
 This version takes as input the moab range, from which we actually need just the size of each sequence, for a proper transpose of the data.

Protected Attributes

int cDim
 Dimension numbers for nCells, nEdges and nVertices.
int eDim
int vDim
Range localGidCellsOwned
 Local global ID for owned cells, edges and vertices.
Range localGidEdgesOwned
Range localGidVertsOwned

Detailed Description

Child helper class for ucd mesh, e.g. CAM_SE (HOMME) or MPAS.

Definition at line 124 of file NCWriteHelper.hpp.


Constructor & Destructor Documentation

moab::UcdNCWriteHelper::UcdNCWriteHelper ( WriteNC writeNC,
int  fileId,
const FileOptions opts,
EntityHandle  fileSet 
) [inline]

Definition at line 127 of file NCWriteHelper.hpp.

        : NCWriteHelper( writeNC, fileId, opts, fileSet ), cDim( -1 ), eDim( -1 ), vDim( -1 )
    {
    }
virtual moab::UcdNCWriteHelper::~UcdNCWriteHelper ( ) [inline, virtual]

Definition at line 131 of file NCWriteHelper.hpp.

{}

Member Function Documentation

template<typename T >
void moab::UcdNCWriteHelper::jik_to_kji_stride ( size_t  ,
size_t  nj,
size_t  nk,
T dest,
T source,
Range localGid 
) [inline, protected]

This version takes as input the moab range, from which we actually need just the size of each sequence, for a proper transpose of the data.

Definition at line 137 of file NCWriteHelper.hpp.

References moab::Range::pair_begin(), and moab::Range::pair_end().

Referenced by moab::NCWriteHOMME::write_nonset_variables().

    {
        std::size_t idxInSource = 0;  // Position of the start of the stride
        // For each subrange, we will transpose a matrix of size
        // subrange*nj*nk (subrange takes the role of ni)
        for( Range::pair_iterator pair_iter = localGid.pair_begin(); pair_iter != localGid.pair_end(); ++pair_iter )
        {
            std::size_t size_range = pair_iter->second - pair_iter->first + 1;
            std::size_t nik = size_range * nk, nij = size_range * nj;
            for( std::size_t k = 0; k != nk; k++ )
                for( std::size_t j = 0; j != nj; j++ )
                    for( std::size_t i = 0; i != size_range; i++ )
                        dest[idxInSource + k * nij + j * size_range + i] = source[idxInSource + j * nik + i * nk + k];
            idxInSource += ( size_range * nj * nk );
        }
    }

Member Data Documentation

Dimension numbers for nCells, nEdges and nVertices.

Definition at line 155 of file NCWriteHelper.hpp.

Definition at line 155 of file NCWriteHelper.hpp.

Definition at line 155 of file NCWriteHelper.hpp.

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines