#include <NCWriteHelper.hpp>
Public Member Functions | |
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... | |
Static Public Member Functions | |
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... | |
Protected Member Functions | |
virtual ErrorCode | write_nonset_variables (std::vector< WriteNC::VarData > &vdatas, std::vector< int > &tstep_nums)=0 |
Protected Attributes | |
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... | |
Private Member Functions | |
ErrorCode | write_set_variables (std::vector< WriteNC::VarData > &vsetdatas, std::vector< int > &tstep_nums) |
Definition at line 22 of file NCWriteHelper.hpp.
|
inline |
Definition at line 25 of file NCWriteHelper.hpp.
|
inlinevirtual |
Definition at line 30 of file NCWriteHelper.hpp.
|
pure virtual |
Collect necessary info about local mesh (implemented in child classes)
Implemented in moab::NCWriteMPAS, moab::NCWriteHOMME, moab::ScdNCWriteHelper, and moab::NCWriteGCRM.
Referenced by moab::WriteNC::write_file().
|
virtual |
Collect data for specified variables (partially implemented in child classes)
Reimplemented in moab::NCWriteMPAS, moab::NCWriteHOMME, moab::ScdNCWriteHelper, and moab::NCWriteGCRM.
Definition at line 51 of file NCWriteHelper.cpp.
References _fileSet, _writeNC, moab::WriteNC::dbgOut, moab::WriteNC::dimLens, moab::WriteNC::dimNames, moab::WriteNC::dummyVarNames, moab::WriteNC::VarData::entLoc, moab::WriteNC::ENTLOCSET, ErrorCode, moab::WriteNC::VarData::has_tsteps, levDim, MB_CHK_SET_ERR, MB_NOT_IMPLEMENTED, MB_SET_ERR, MB_SUCCESS, MB_TYPE_INTEGER, moab::WriteNC::mbImpl, moab::WriteNC::VarData::memoryHogs, nLevels, nTimeSteps, moab::WriteNC::VarData::numLev, size, moab::WriteNC::VarData::sz, moab::Interface::tag_get_by_ptr(), moab::Interface::tag_get_data_type(), moab::Interface::tag_get_handle(), tDim, timeStepVals, moab::DebugOutput::tprintf(), moab::WriteNC::usedCoordinates, moab::WriteNC::VarData::varDataType, moab::WriteNC::VarData::varDims, moab::WriteNC::varInfo, moab::WriteNC::VarData::varTags, moab::WriteNC::VarData::writeCounts, and moab::WriteNC::VarData::writeStarts.
Referenced by moab::NCWriteGCRM::collect_variable_data(), moab::ScdNCWriteHelper::collect_variable_data(), moab::NCWriteHOMME::collect_variable_data(), moab::NCWriteMPAS::collect_variable_data(), and moab::WriteNC::write_file().
|
static |
Get appropriate helper instance for WriteNC class based on some info in the file set.
Get appropriate helper instance for WriteNC class; based on some info in the file set.
Definition at line 30 of file NCWriteHelper.cpp.
References moab::WriteNC::grid_type.
Referenced by moab::WriteNC::write_file().
ErrorCode moab::NCWriteHelper::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.
Definition at line 274 of file NCWriteHelper.cpp.
References _fileId, _writeNC, moab::WriteNC::AttData::attDataType, moab::WriteNC::AttData::attLen, moab::WriteNC::AttData::attValue, moab::WriteNC::dbgOut, moab::WriteNC::dimNames, moab::WriteNC::dummyVarNames, moab::WriteNC::globalAtts, levDim, MB_SET_ERR, MB_SUCCESS, NCDF_SIZE, NCFUNC, moab::WriteNC::VarData::sz, tDim, moab::DebugOutput::tprintf(), moab::WriteNC::usedCoordinates, moab::WriteNC::VarData::varDataType, moab::WriteNC::VarData::varDims, moab::WriteNC::VarData::varId, and moab::WriteNC::varInfo.
Referenced by moab::WriteNC::write_file().
|
protectedpure virtual |
Implemented in moab::NCWriteMPAS, moab::NCWriteHOMME, moab::ScdNCWriteHelper, and moab::NCWriteGCRM.
Referenced by write_values().
|
private |
Definition at line 525 of file NCWriteHelper.cpp.
References _fileId, _writeNC, moab::WriteNC::VarData::has_tsteps, moab::WriteNC::isParallel, MB_NOT_IMPLEMENTED, MB_SET_ERR, MB_SUCCESS, moab::WriteNC::VarData::memoryHogs, NCFUNC, NCFUNCP, moab::ParallelComm::proc_config(), moab::ProcConfig::proc_rank(), moab::WriteNC::VarData::varDataType, moab::WriteNC::VarData::varId, moab::WriteNC::VarData::varName, moab::WriteNC::VarData::writeCounts, and moab::WriteNC::VarData::writeStarts.
Referenced by write_values().
ErrorCode moab::NCWriteHelper::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.
Definition at line 468 of file NCWriteHelper.cpp.
References _writeNC, moab::WriteNC::dummyVarNames, moab::WriteNC::VarData::entLoc, moab::WriteNC::ENTLOCSET, MB_SET_ERR, MB_SUCCESS, moab::WriteNC::usedCoordinates, moab::WriteNC::varInfo, write_nonset_variables(), and write_set_variables().
Referenced by moab::WriteNC::write_file().
|
protected |
Cache some information from WriteNC.
Definition at line 63 of file NCWriteHelper.hpp.
Referenced by init_file(), moab::NCWriteGCRM::write_nonset_variables(), moab::ScdNCWriteHelper::write_nonset_variables(), moab::NCWriteHOMME::write_nonset_variables(), moab::NCWriteMPAS::write_nonset_variables(), and write_set_variables().
|
protected |
Definition at line 65 of file NCWriteHelper.hpp.
Referenced by moab::NCWriteGCRM::collect_mesh_info(), moab::ScdNCWriteHelper::collect_mesh_info(), moab::NCWriteHOMME::collect_mesh_info(), moab::NCWriteMPAS::collect_mesh_info(), and collect_variable_data().
|
protected |
Definition at line 64 of file NCWriteHelper.hpp.
|
protected |
Allow NCWriteHelper to directly access members of WriteNC.
Definition at line 60 of file NCWriteHelper.hpp.
Referenced by moab::NCWriteGCRM::collect_mesh_info(), moab::ScdNCWriteHelper::collect_mesh_info(), moab::NCWriteHOMME::collect_mesh_info(), moab::NCWriteMPAS::collect_mesh_info(), moab::NCWriteGCRM::collect_variable_data(), collect_variable_data(), moab::ScdNCWriteHelper::collect_variable_data(), moab::NCWriteHOMME::collect_variable_data(), moab::NCWriteMPAS::collect_variable_data(), init_file(), moab::NCWriteGCRM::write_nonset_variables(), moab::ScdNCWriteHelper::write_nonset_variables(), moab::NCWriteHOMME::write_nonset_variables(), moab::NCWriteMPAS::write_nonset_variables(), write_set_variables(), and write_values().
|
protected |
Definition at line 71 of file NCWriteHelper.hpp.
Referenced by moab::NCWriteGCRM::collect_mesh_info(), moab::ScdNCWriteHelper::collect_mesh_info(), moab::NCWriteHOMME::collect_mesh_info(), moab::NCWriteMPAS::collect_mesh_info(), moab::NCWriteGCRM::collect_variable_data(), collect_variable_data(), moab::NCWriteMPAS::collect_variable_data(), and init_file().
|
protected |
Local owned cells, edges and vertices.
Definition at line 74 of file NCWriteHelper.hpp.
Referenced by moab::NCWriteGCRM::collect_mesh_info(), moab::ScdNCWriteHelper::collect_mesh_info(), moab::NCWriteMPAS::collect_mesh_info(), moab::NCWriteGCRM::write_nonset_variables(), moab::ScdNCWriteHelper::write_nonset_variables(), and moab::NCWriteMPAS::write_nonset_variables().
|
protected |
Definition at line 74 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 74 of file NCWriteHelper.hpp.
Referenced by moab::NCWriteGCRM::collect_mesh_info(), moab::NCWriteHOMME::collect_mesh_info(), moab::NCWriteMPAS::collect_mesh_info(), moab::NCWriteGCRM::write_nonset_variables(), moab::NCWriteHOMME::write_nonset_variables(), and moab::NCWriteMPAS::write_nonset_variables().
|
protected |
Definition at line 68 of file NCWriteHelper.hpp.
Referenced by moab::NCWriteGCRM::collect_mesh_info(), moab::ScdNCWriteHelper::collect_mesh_info(), moab::NCWriteHOMME::collect_mesh_info(), moab::NCWriteMPAS::collect_mesh_info(), and collect_variable_data().
|
protected |
Dimensions of time and level.
Definition at line 68 of file NCWriteHelper.hpp.
Referenced by moab::NCWriteGCRM::collect_mesh_info(), moab::ScdNCWriteHelper::collect_mesh_info(), moab::NCWriteHOMME::collect_mesh_info(), moab::NCWriteMPAS::collect_mesh_info(), and collect_variable_data().
|
protected |
Dimension numbers for time and level.
Definition at line 71 of file NCWriteHelper.hpp.
Referenced by moab::NCWriteGCRM::collect_mesh_info(), moab::ScdNCWriteHelper::collect_mesh_info(), moab::NCWriteHOMME::collect_mesh_info(), moab::NCWriteMPAS::collect_mesh_info(), moab::NCWriteGCRM::collect_variable_data(), collect_variable_data(), moab::ScdNCWriteHelper::collect_variable_data(), moab::NCWriteHOMME::collect_variable_data(), moab::NCWriteMPAS::collect_variable_data(), init_file(), moab::NCWriteGCRM::write_nonset_variables(), moab::ScdNCWriteHelper::write_nonset_variables(), moab::NCWriteHOMME::write_nonset_variables(), and moab::NCWriteMPAS::write_nonset_variables().
|
protected |
Time values of output timesteps.
Definition at line 77 of file NCWriteHelper.hpp.
Referenced by collect_variable_data().