General support utilities. More...
General support utilities.
Classes | |
struct | CmpPairs |
class | ComLineObject |
Command line processing. More... | |
class | ConfigParameters |
class | ConfigurationObject |
class | MenuObject |
class | Parameters |
class | sizeextent |
Simple Block Structured Mesh object. More... | |
class | testmanager |
Typedefs | |
typedef std::string::size_type | strsize |
typedef primitive::KeyValuePairObj< std::string, std::string > | ParamType |
typedef int | Error |
Error type. More... | |
Functions | |
std::ostream & | operator<< (std::ostream &Ostr, const util::ConfigurationObject &cob) |
Stream output operator for util::ConfigurationObject. More... | |
std::istream & | operator>> (std::istream &Istr, util::ConfigurationObject &cob) |
Stream input operator for util::ConfigurationObject. More... | |
template<typename DataType > | |
bool | IntervalOverlaps (const DataType &i1, const DataType &i2, const DataType &j1, const DataType &j2) |
std::ostream & | operator<< (std::ostream &outStream, const ix::util::sizeextent &sizeExtent) |
std::istream & | operator>> (std::istream &inStream, ix::util::sizeextent &sizeExtent) |
std::ostream & | operator<< (std::ostream &Ostr, const util::ParamType ¶m) |
std::ostream & | operator<< (std::ostream &oSt, const util::Parameters &pv) |
std::istream & | operator>> (std::istream &iSt, util::Parameters &pv) |
template<typename Container > | |
bool | LessThan (const Container &c1, const Container &c2) |
template<typename Container > | |
void | InvertContainer (const Container &c1, Container &c2) |
template<typename ContainerType > | |
void | DumpContents (std::ostream &Ostr, const ContainerType &c, std::string del="\) |
Dump container contents. More... | |
template<typename BufferDataType > | |
int | PackBuffer (const BufferDataType *sourceBuffer, const std::vector< size_t > &sourceIndices, BufferDataType *targetBuffer, const std::vector< size_t > &targetIndices) |
Pack subset of target buffer from subset of source buffer. More... | |
template<typename ContainerType , typename T > | |
void | CopyIntoContainer (ContainerType &cont, const T *src, size_t count) |
template<typename OuterCont , typename OutCont , typename InnerCont , typename MapType > | |
void | MapElements (OuterCont &src, OutCont &trg, MapType &m) |
template<typename ListContainerType , typename ListType > | |
primitive::IndexType | MaxNodeId (const ListContainerType &fc) |
Return the maximum of all elements of a multicontainer. More... | |
template<typename OuterCont , typename InnerCont , typename OutCont > | |
void | Flatten (OuterCont &con, OutCont &ocon) |
Populate OutCont with a flat list of entries from a multicontainer. More... | |
template<typename OuterContType > | |
primitive::IndexType | GetTotalSize (OuterContType &con) |
Return the total number of entries in a multicontainer. More... | |
template<typename OuterContType , typename InnerContType , typename RetCont , typename idxtype > | |
void | MultiContainer2CSR (RetCont &xadj, RetCont &adj, OuterContType &source) |
template<typename ListContainerType , typename ListType > | |
void | CreateAdjacentNodeList (std::vector< std::list< primitive::IndexType > > &anodelist, ListContainerType &fc, primitive::IndexType nnodes=0) |
Given an array of adjacent node lists (like an array of face connectivities), this function will loop thru and create a list of unique adjacent nodes for each node with the nodes that are actually adjacent in the lists More... | |
template<typename ListContainerType , typename ListType > | |
void | AdjEList (std::vector< std::list< primitive::IndexType > > &aelist, ListContainerType &dual_con, unsigned long nel=0) |
Given an array of adjacent node lists (like an array of face connectivities), this function will loop thru and create a list of unique adjacent nodes for each node Note that this is a little different from the AdjNodeList because in this version every node in each list is considered adjacent. More... | |
template<typename ConType , typename IConType > | |
primitive::IndexType | NumberOfEdges (ConType &con) |
template<typename ContainerType , typename Icont > | |
void | FormGraph (const ContainerType &adjlist) |
template<typename BufferDataType > | |
void | ReportBufferStats (std::ostream &outStream, size_t numValues, const BufferDataType *dataBuffer) |
Reports min/max/mean/stddev for data in buffer. More... | |
template<typename Container > | |
bool | HaveSameOrientation (Container &c1, Container &c2) |
Cyclic test. More... | |
template<typename Container > | |
bool | HaveOppositeOrientation (Container &c1, Container &c2) |
Anti-cyclic test. More... | |
template<class T > | |
CmpPairs< T > | CreateCmpPairs (const std::vector< T > &v) |
template<class T > | |
void | SortPermutation (const std::vector< T > &values, std::vector< unsigned int > &v) |
std::string | GetNextContent (std::istream &In) |
void | GetContentUntil (std::istream &In, std::string ret, const std::string &etag) |
int | NumLines (const std::string &instr) |
int | String2Buf (const std::string &instr, void **buf) |
void | Trim (std::string &instr, bool preserve_newline=false) |
Creates space delimited tokens in place. More... | |
const std::string | Trimmed (const std::string &instr, bool preserve_newline=false) |
Returns space delimited tokens. More... | |
const std::string | stripdirs (const std::string &pname) |
Strip absolute path. More... | |
void | TokenizeString (std::vector< std::string > &tokens, const std::string &source) |
Tokenize string. More... | |
void | TokenizeString (std::vector< std::string > &tokens, const std::string &source, const char delim) |
Tokenize string w/ delimiter. More... | |
template<typename NumType > | |
void | ProcessRange (NumType &t1, NumType &t2, const std::string stinter) |
Process a range in the format "t1:t2". More... | |
int | OpenFile (std::ifstream &Inf, const std::string &filename) |
File opener. More... | |
void | Vectorize (std::vector< std::string > &retVal, const char **in) |
void | Vectorize (std::vector< std::string > &retVal, const char **in, int n) |
void | RenewStream (std::ostringstream &outStream) |
void | RenewStream (std::istringstream &inStream) |
int | CheckResults (int argc, char *argv[]) |
Check numerical results utility. More... | |
std::istream & | operator>> (std::istream &In, ComLineObject &cl) |
std::ostream & | operator<< (std::ostream &Out, const ComLineObject &cl) |
int | UtilTest (int argc, char *argv[]) |
Drives the ix::util namespace's test object. More... | |
typedef int Error |
Error type.
Definition at line 27 of file primitive_utilities.H.
typedef primitive::KeyValuePairObj<std::string,std::string> ParamType |
Definition at line 15 of file Parameters.H.
void ix::util::AdjEList | ( | std::vector< std::list< primitive::IndexType > > & | aelist, |
ListContainerType & | dual_con, | ||
unsigned long | nel = 0 |
||
) |
Given an array of adjacent node lists (like an array of face connectivities), this function will loop thru and create a list of unique adjacent nodes for each node Note that this is a little different from the AdjNodeList because in this version every node in each list is considered adjacent.
Definition at line 250 of file primitive_utilities.H.
int ix::util::CheckResults | ( | int | argc, |
char * | argv[] | ||
) |
Check numerical results utility.
argc | integer indicating how many words are in the command line. |
argv | string words of the command line. |
This utility numerically checks the numbers on a line that matches a specified string. The lines in the file are assumed to have the following format:
UniqueString : <numerical entries>="">
This utility will perform the indicated test(s) on the numerical entires associated with the "UniqueString" identifier given as input. The result is a binary YES(1) or NO(0) which is output to stdout as:
TestName = 1||0
If the test passed(=YES), this utility returns a 0, otherwise it returns 1.
Definition at line 8 of file CheckResults.C.
References ComLineObject::GetOption(), CheckResultsComLine::Initialize(), ComLineObject::LongUsage(), ComLineObject::ProcessOptions(), ComLineObject::ProcessRange(), and x.
Referenced by main().
void ix::util::CopyIntoContainer | ( | ContainerType & | cont, |
const T * | src, | ||
size_t | count | ||
) |
Definition at line 121 of file primitive_utilities.H.
void ix::util::CreateAdjacentNodeList | ( | std::vector< std::list< primitive::IndexType > > & | anodelist, |
ListContainerType & | fc, | ||
primitive::IndexType | nnodes = 0 |
||
) |
Given an array of adjacent node lists (like an array of face connectivities), this function will loop thru and create a list of unique adjacent nodes for each node with the nodes that are actually adjacent in the lists
Definition at line 214 of file primitive_utilities.H.
CmpPairs<T> ix::util::CreateCmpPairs | ( | const std::vector< T > & | v | ) |
Definition at line 400 of file primitive_utilities.H.
Referenced by SortPermutation().
void ix::util::DumpContents | ( | std::ostream & | Ostr, |
const ContainerType & | c, | ||
std::string | del = "\n" |
||
) |
Dump container contents.
Dumps the contents of the container to the specified std::ostream object.
Definition at line 82 of file primitive_utilities.H.
Referenced by GlobalObj< StackType, ErrorType, ProfilerType >::DumpErrors(), ProfilerObj::DumpEvents(), GlobalObj< StackType, ErrorType, ProfilerType >::DumpStack(), and ComLineObject::ErrorReport().
void ix::util::Flatten | ( | OuterCont & | con, |
OutCont & | ocon | ||
) |
Populate OutCont with a flat list of entries from a multicontainer.
Definition at line 164 of file primitive_utilities.H.
void ix::util::FormGraph | ( | const ContainerType & | adjlist | ) |
Definition at line 300 of file primitive_utilities.H.
|
inline |
Definition at line 430 of file primitive_utilities.H.
Referenced by operator>>().
|
inline |
Definition at line 415 of file primitive_utilities.H.
Referenced by operator>>(), and testmanager::Test__GetNextContent().
primitive::IndexType ix::util::GetTotalSize | ( | OuterContType & | con | ) |
Return the total number of entries in a multicontainer.
Definition at line 177 of file primitive_utilities.H.
bool ix::util::HaveOppositeOrientation | ( | Container & | c1, |
Container & | c2 | ||
) |
Anti-cyclic test.
Typically, this is used to determine if two representations of the same face are oriented the same.
Definition at line 372 of file primitive_utilities.H.
bool ix::util::HaveSameOrientation | ( | Container & | c1, |
Container & | c2 | ||
) |
Cyclic test.
Typically, this is used to determine if two representations of the same face are oriented the same.
Definition at line 344 of file primitive_utilities.H.
bool ix::util::IntervalOverlaps | ( | const DataType & | i1, |
const DataType & | i2, | ||
const DataType & | j1, | ||
const DataType & | j2 | ||
) |
Definition at line 11 of file IndexUtil.H.
Referenced by sizeextent::Neighboring().
void ix::util::InvertContainer | ( | const Container & | c1, |
Container & | c2 | ||
) |
Definition at line 66 of file primitive_utilities.H.
bool ix::util::LessThan | ( | const Container & | c1, |
const Container & | c2 | ||
) |
Definition at line 42 of file primitive_utilities.H.
void ix::util::MapElements | ( | OuterCont & | src, |
OutCont & | trg, | ||
MapType & | m | ||
) |
Definition at line 129 of file primitive_utilities.H.
primitive::IndexType ix::util::MaxNodeId | ( | const ListContainerType & | fc | ) |
Return the maximum of all elements of a multicontainer.
Definition at line 145 of file primitive_utilities.H.
void ix::util::MultiContainer2CSR | ( | RetCont & | xadj, |
RetCont & | adj, | ||
OuterContType & | source | ||
) |
Definition at line 189 of file primitive_utilities.H.
primitive::IndexType ix::util::NumberOfEdges | ( | ConType & | con | ) |
Definition at line 279 of file primitive_utilities.H.
|
inline |
Definition at line 454 of file primitive_utilities.H.
Referenced by testmanager::Test__SystemInfo().
|
inline |
File opener.
Definition at line 610 of file primitive_utilities.H.
std::ostream & operator<< | ( | std::ostream & | Ostr, |
const util::ParamType & | param | ||
) |
Definition at line 145 of file Parameters.C.
References KeyValuePairObj< K, V >::Key(), and KeyValuePairObj< K, V >::Value().
std::ostream & operator<< | ( | std::ostream & | Ostr, |
const util::ConfigurationObject & | cob | ||
) |
Stream output operator for util::ConfigurationObject.
Definition at line 124 of file Configuration.C.
References ConfigurationObject::_parameters, and ConfigurationObject::_sections.
std::ostream& ix::util::operator<< | ( | std::ostream & | Out, |
const ComLineObject & | cl | ||
) |
Definition at line 86 of file ComLine.C.
References ComLineObject::_arghelp, ComLineObject::_argname, ComLineObject::_args, ComLineObject::_description, ComLineObject::_help, and ComLineObject::_type.
std::ostream & operator<< | ( | std::ostream & | oSt, |
const util::Parameters & | pv | ||
) |
Definition at line 132 of file Parameters.C.
References Parameters::WriteToStream().
std::ostream & operator<< | ( | std::ostream & | outStream, |
const ix::util::sizeextent & | sizeExtent | ||
) |
Definition at line 24 of file IndexUtil.C.
References sizeextent::ND().
std::istream& ix::util::operator>> | ( | std::istream & | In, |
ComLineObject & | cl | ||
) |
Definition at line 14 of file ComLine.C.
References ComLineObject::_arghelp, ComLineObject::_argname, ComLineObject::_description, ComLineObject::_error_messages, ComLineObject::_help, ComLineObject::_type, GetContentUntil(), GetNextContent(), and x.
std::istream & operator>> | ( | std::istream & | Istr, |
util::ConfigurationObject & | cob | ||
) |
Stream input operator for util::ConfigurationObject.
Definition at line 150 of file Configuration.C.
References ConfigurationObject::_parameters, ConfigurationObject::_sections, ConfigurationObject::AdvanceToNextSection(), ConfigurationObject::ExtractSection(), ConfigParameters::Name(), ConfigurationObject::ReadSection(), and TokenizeString().
std::istream & operator>> | ( | std::istream & | iSt, |
util::Parameters & | pv | ||
) |
Definition at line 138 of file Parameters.C.
References Parameters::ReadFromStream().
std::istream & operator>> | ( | std::istream & | inStream, |
ix::util::sizeextent & | sizeExtent | ||
) |
Definition at line 35 of file IndexUtil.C.
References a, and sizeextent::Sync().
int ix::util::PackBuffer | ( | const BufferDataType * | sourceBuffer, |
const std::vector< size_t > & | sourceIndices, | ||
BufferDataType * | targetBuffer, | ||
const std::vector< size_t > & | targetIndices | ||
) |
Pack subset of target buffer from subset of source buffer.
Copies data from source buffer at source indices specified by sourceIndices into target buffer location specified by targetIndices
sourceBuffer | pointer to source data |
sourceIndices | vector of source locations |
targetBuffer | pointer to target buffer |
targetIndices | vector of target locations |
Definition at line 107 of file primitive_utilities.H.
void ix::util::ProcessRange | ( | NumType & | t1, |
NumType & | t2, | ||
const std::string | stinter | ||
) |
Process a range in the format "t1:t2".
Definition at line 578 of file primitive_utilities.H.
References x.
|
inline |
Definition at line 638 of file primitive_utilities.H.
Referenced by base::ClearMessages(), application::ConfigureApplication(), application::ConfigureDomains(), application::ConfigureSimulation(), plascom2::util::ConvertLegacyConfiguration(), navierstokes::CreateDictionaryConfiguration(), euler::util::InitializeProtoY4Test1(), pcpp::io::hdf5::LegacyFileInfo(), plascom2::util::PC2Compare(), pcpp::util::ProcessConfigurationFile(), rhs< GridT, StateT, OperatorT >::RHS(), application::RunApplication(), application::RunMaxwellSolver(), application::RunPlasCom2(), pcpp::comm::SetupCartesianTopology(), TestGrid_CartesianMetric(), TestGrid_CurvilinearMetric(), TestGrid_CurvilinearVGWavy(), TestGrid_PBS_IntegratedHalo(), TestGrid_RectilinearMetric(), TestHaloParallel(), TestHaloPeriodic(), TestHDF5GridIO(), TestHDF5HyperSlab(), TestHDF5PBSGridIO(), TestHDF5Read2DBlockStructuredGrid(), TestIntegrated_PFCurvilinear2DX(), TestIntegrated_PFCurvilinear2DY(), TestIntegrated_PFCurvilinear3DZ(), TestIntegrated_PFRectilinear2DX(), TestIntegrated_PFRectilinear2DY(), TestIntegrated_PFRectilinear3DZ(), TestIntegrated_Poiseuille2DX(), TestIntegrated_Poiseuille2DY(), TestIntegrated_Poiseuille3DZ(), TestIntegrated_ViscousShock2DX(), TestIntegrated_ViscousShock2DY(), TestIntegrated_ViscousShock3DZ(), TestIntegrated_VSCurvilinear2DX(), TestIntegrated_VSCurvilinear2DY(), TestIntegrated_VSCurvilinear3DZ(), TestIntegrated_VSRectilinear2DX(), TestIntegrated_VSRectilinear2DY(), TestIntegrated_VSRectilinear3DZ(), TestMaxwellRHSTimeIntegrate(), TestPCPPHDF5Read(), TestPlasCom2Input(), TestPlasCom2Output(), TestProbe(), TestRK4Advancer(), and TestRK4Advancer2().
|
inline |
Definition at line 644 of file primitive_utilities.H.
void ix::util::ReportBufferStats | ( | std::ostream & | outStream, |
size_t | numValues, | ||
const BufferDataType * | dataBuffer | ||
) |
Reports min/max/mean/stddev for data in buffer.
Definition at line 307 of file primitive_utilities.H.
void ix::util::SortPermutation | ( | const std::vector< T > & | values, |
std::vector< unsigned int > & | v | ||
) |
Definition at line 404 of file primitive_utilities.H.
References CreateCmpPairs().
Referenced by base< GridT, StateT >::PartitionDomain().
|
inline |
Definition at line 463 of file primitive_utilities.H.
Referenced by MobileParameters::Pack(), MobileObject::Pack(), and MobileString::Pack().
|
inline |
Strip absolute path.
Strips the absolute path to recover the base file name or the executable file name.
Definition at line 526 of file primitive_utilities.H.
References x.
Referenced by GlobalObj< StackType, ErrorType, ProfilerType >::GlobalObj(), ParallelGlobalObj< CommunicatorType, StackType, ErrorType, ProfilerType >::Init(), mpiglobal::mpiglobal(), ParallelGlobalObj< CommunicatorType, StackType, ErrorType, ProfilerType >::ParallelGlobalObj(), and ComLineObject::Record().
|
inline |
Tokenize string.
Breaks source string up into a vector of space delimited tokens
Definition at line 541 of file primitive_utilities.H.
Referenced by ConfigurationObject::AdvanceToNextSection(), ConfigurationObject::ExtractSection(), operator>>(), Parameters::ReadFromStream(), and ConfigurationObject::ReadSection().
|
inline |
Tokenize string w/ delimiter.
Breaks source string up into a vector of tokens delimited by specified delimiter
Definition at line 556 of file primitive_utilities.H.
References x.
|
inline |
Creates space delimited tokens in place.
Definition at line 478 of file primitive_utilities.H.
Referenced by ix::TestResults().
|
inline |
Returns space delimited tokens.
Definition at line 500 of file primitive_utilities.H.
|
inline |
Definition at line 620 of file primitive_utilities.H.
|
inline |
Definition at line 628 of file primitive_utilities.H.