Child helper class for ucd mesh, e.g. CAM_SE (HOMME) or MPAS. More...
#include <NCWriteHelper.hpp>
Public Member Functions | |
UcdNCWriteHelper (WriteNC *writeNC, int fileId, const FileOptions &opts, EntityHandle fileSet) | |
virtual | ~UcdNCWriteHelper () |
![]() | |
NCWriteHelper (WriteNC *writeNC, int fileId, const FileOptions &opts, EntityHandle fileSet) | |
virtual | ~NCWriteHelper () |
virtual ErrorCode | collect_mesh_info ()=0 |
Collect necessary info about local mesh (implemented in child classes) More... | |
virtual ErrorCode | collect_variable_data (std::vector< std::string > &var_names, std::vector< int > &tstep_nums) |
Collect data for specified variables (partially implemented in child classes) More... | |
ErrorCode | init_file (std::vector< std::string > &var_names, std::vector< std::string > &desired_names, bool _append) |
Initialize file: this is where all defines are done The VarData dimension ids are filled up after define. More... | |
ErrorCode | write_values (std::vector< std::string > &var_names, std::vector< int > &tstep_nums) |
Take the info from VarData and write first non-set variables, then set variables. More... | |
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. More... | |
![]() | |
virtual ErrorCode | write_nonset_variables (std::vector< WriteNC::VarData > &vdatas, std::vector< int > &tstep_nums)=0 |
Protected Attributes | |
int | cDim |
Dimension numbers for nCells, nEdges and nVertices. More... | |
int | eDim |
int | vDim |
Range | localGidCellsOwned |
Local global ID for owned cells, edges and vertices. More... | |
Range | localGidEdgesOwned |
Range | localGidVertsOwned |
![]() | |
WriteNC * | _writeNC |
Allow NCWriteHelper to directly access members of WriteNC. More... | |
int | _fileId |
Cache some information from WriteNC. More... | |
const FileOptions & | _opts |
EntityHandle | _fileSet |
int | nTimeSteps |
Dimensions of time and level. More... | |
int | nLevels |
int | tDim |
Dimension numbers for time and level. More... | |
int | levDim |
Range | localCellsOwned |
Local owned cells, edges and vertices. More... | |
Range | localEdgesOwned |
Range | localVertsOwned |
std::vector< double > | timeStepVals |
Time values of output timesteps. More... | |
Additional Inherited Members | |
![]() | |
static NCWriteHelper * | get_nc_helper (WriteNC *writeNC, int fileId, const FileOptions &opts, EntityHandle fileSet) |
Get appropriate helper instance for WriteNC class based on some info in the file set. More... | |
Child helper class for ucd mesh, e.g. CAM_SE (HOMME) or MPAS.
Definition at line 124 of file NCWriteHelper.hpp.
|
inline |
Definition at line 127 of file NCWriteHelper.hpp.
128 : NCWriteHelper( writeNC, fileId, opts, fileSet ), cDim( -1 ), eDim( -1 ), vDim( -1 ) 129 { 130 }
|
inlinevirtual |
Definition at line 131 of file NCWriteHelper.hpp.
131 {}
|
inlineprotected |
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.
138 {
139 std::size_t idxInSource = 0; // Position of the start of the stride
140 // For each subrange, we will transpose a matrix of size
141 // subrange*nj*nk (subrange takes the role of ni)
142 for( Range::pair_iterator pair_iter = localGid.pair_begin(); pair_iter != localGid.pair_end(); ++pair_iter )
143 {
144 std::size_t size_range = pair_iter->second - pair_iter->first + 1;
145 std::size_t nik = size_range * nk, nij = size_range * nj;
146 for( std::size_t k = 0; k != nk; k++ )
147 for( std::size_t j = 0; j != nj; j++ )
148 for( std::size_t i = 0; i != size_range; i++ )
149 dest[idxInSource + k * nij + j * size_range + i] = source[idxInSource + j * nik + i * nk + k];
150 idxInSource += ( size_range * nj * nk );
151 }
152 }
References moab::Range::pair_begin(), and moab::Range::pair_end().
Referenced by moab::NCWriteHOMME::write_nonset_variables().
|
protected |
Dimension numbers for nCells, nEdges and nVertices.
Definition at line 155 of file NCWriteHelper.hpp.
|
protected |
Definition at line 155 of file NCWriteHelper.hpp.
|
protected |
Local global ID for owned cells, edges and vertices.
Definition at line 158 of file NCWriteHelper.hpp.
Referenced by moab::NCWriteGCRM::collect_mesh_info(), moab::NCWriteMPAS::collect_mesh_info(), moab::NCWriteGCRM::collect_variable_data(), moab::NCWriteMPAS::collect_variable_data(), moab::NCWriteGCRM::write_nonset_variables(), and moab::NCWriteMPAS::write_nonset_variables().
|
protected |
Definition at line 158 of file NCWriteHelper.hpp.
Referenced by moab::NCWriteGCRM::collect_mesh_info(), moab::NCWriteMPAS::collect_mesh_info(), moab::NCWriteGCRM::collect_variable_data(), moab::NCWriteMPAS::collect_variable_data(), moab::NCWriteGCRM::write_nonset_variables(), and moab::NCWriteMPAS::write_nonset_variables().
|
protected |
Definition at line 158 of file NCWriteHelper.hpp.
Referenced by moab::NCWriteGCRM::collect_mesh_info(), moab::NCWriteHOMME::collect_mesh_info(), moab::NCWriteMPAS::collect_mesh_info(), moab::NCWriteGCRM::collect_variable_data(), moab::NCWriteHOMME::collect_variable_data(), moab::NCWriteMPAS::collect_variable_data(), moab::NCWriteGCRM::write_nonset_variables(), moab::NCWriteHOMME::write_nonset_variables(), and moab::NCWriteMPAS::write_nonset_variables().
|
protected |
Definition at line 155 of file NCWriteHelper.hpp.