GEOSX
Functions
geosx::SiloFileUtilities Namespace Reference

Functions

template<typename OUTTYPE >
int DB_TYPE ()
 
template<typename TYPE >
int GetNumberOfVariablesInField ()
 
template<typename TYPE >
int GetTensorRank ()
 
template<typename OUTTYPE , typename TYPE >
OUTTYPE CastField (const TYPE &field, int const i=0)
 
template<>
real64 CastField (R1Tensor const &field, int const i)
 Specialization for R1Tensor. More...
 
template<>
int CastField< int, int > (const int &field, int const dummy)
 
template<>
long int CastField< long int, long int > (const long int &field, int const dummy)
 
template<>
int CastField< int, long int > (const long int &field, int const dummy)
 
template<>
long long int CastField< long long int, long long int > (const long long int &field, int const dummy)
 
template<>
int CastField< int, long long int > (const long long int &field, int const dummy)
 
template<>
real64 CastField< real64, real64 > (const real64 &field, int const dummy)
 
template<>
float CastField< float, real64 > (const real64 &field, int const dummy)
 
template<typename TYPE >
void SetVariableNames (string const &fieldName, string_array &varnamestring, char const *varnames[])
 

Detailed Description

Namespace to hold some utilities needed by the functions in SiloFile.

Function Documentation

◆ CastField() [1/2]

template<typename OUTTYPE , typename TYPE >
OUTTYPE geosx::SiloFileUtilities::CastField ( const TYPE &  field,
int const  i = 0 
)
Template Parameters
OUTTYPEthe type to cast to
TYPEthe type to cast from
Parameters
fieldthe value to cast
ithe component of the varaible to cast, assuming there is dimensionaliy to the variable
Returns
the casted value

◆ CastField() [2/2]

template<>
real64 geosx::SiloFileUtilities::CastField ( R1Tensor const &  field,
int const  i 
)
inline

Specialization for R1Tensor.

Parameters
fieldthe value to cast
ithe component of the variable to cast
Returns
the casted value

Definition at line 749 of file SiloFile.hpp.

◆ CastField< float, real64 >()

template<>
float geosx::SiloFileUtilities::CastField< float, real64 > ( const real64 field,
int const  dummy 
)
inline
Todo:
Verify: the TPL version of doxygen on Travis cannot parse unnamed parameters, dummy parameter introduced to remove warning
Parameters
fieldthe value to cast
dummyunused parameter
Returns
the casted value

Definition at line 839 of file SiloFile.hpp.

◆ CastField< int, int >()

template<>
int geosx::SiloFileUtilities::CastField< int, int > ( const int &  field,
int const  dummy 
)
inline
Todo:
Verify: the TPL version of doxygen on Travis cannot parse unnamed parameters, dummy parameter introduced to remove warning
Parameters
fieldthe value to cast
dummyunused parameter
Returns
the casted value

Definition at line 761 of file SiloFile.hpp.

◆ CastField< int, long int >()

template<>
int geosx::SiloFileUtilities::CastField< int, long int > ( const long int &  field,
int const  dummy 
)
inline
Todo:
Verify: the TPL version of doxygen on Travis cannot parse unnamed parameters, dummy parameter introduced to remove warning
Parameters
fieldthe value to cast
dummyunused parameter
Returns
the casted value

Definition at line 787 of file SiloFile.hpp.

◆ CastField< int, long long int >()

template<>
int geosx::SiloFileUtilities::CastField< int, long long int > ( const long long int &  field,
int const  dummy 
)
inline
Todo:
Verify: the TPL version of doxygen on Travis cannot parse unnamed parameters, dummy parameter introduced to remove warning
Parameters
fieldthe value to cast
dummyunused parameter
Returns
the casted value

Definition at line 813 of file SiloFile.hpp.

◆ CastField< long int, long int >()

template<>
long int geosx::SiloFileUtilities::CastField< long int, long int > ( const long int &  field,
int const  dummy 
)
inline
Todo:
Verify: the TPL version of doxygen on Travis cannot parse unnamed parameters, dummy parameter introduced to remove warning
Parameters
fieldthe value to cast
dummyunused parameter
Returns
the casted value

Definition at line 774 of file SiloFile.hpp.

◆ CastField< long long int, long long int >()

template<>
long long int geosx::SiloFileUtilities::CastField< long long int, long long int > ( const long long int &  field,
int const  dummy 
)
inline
Todo:
Verify: the TPL version of doxygen on Travis cannot parse unnamed parameters, dummy parameter introduced to remove warning
Parameters
fieldthe value to cast
dummyunused parameter
Returns
the casted value

Definition at line 800 of file SiloFile.hpp.

◆ CastField< real64, real64 >()

template<>
real64 geosx::SiloFileUtilities::CastField< real64, real64 > ( const real64 field,
int const  dummy 
)
inline
Todo:
Verify: the TPL version of doxygen on Travis cannot parse unnamed parameters, dummy parameter introduced to remove warning
Parameters
fieldthe value to cast
dummyunused parameter
Returns
the casted value

Definition at line 826 of file SiloFile.hpp.

◆ DB_TYPE()

template<typename OUTTYPE >
int geosx::SiloFileUtilities::DB_TYPE ( )
Template Parameters
OUTTYPEthe type of data to write out (int,float,real64)
Returns
the integer identifier associated with the enum DBdatatype defined in the silo.h file.

This templated function is a "specialization only" definition. There is no general definition, only specializations for predetermined data types.

◆ GetNumberOfVariablesInField()

template<typename TYPE >
int geosx::SiloFileUtilities::GetNumberOfVariablesInField ( )
Template Parameters
TYPEthe data type in question
Returns
the number of "variables" in a data field. For instance, 1 for a int, float or real64. 1 for a scalar 3 for a R1Tensor...etc.

◆ GetTensorRank()

template<typename TYPE >
int geosx::SiloFileUtilities::GetTensorRank ( )
Template Parameters
TYPEthe data type in question
Returns
the silo DB_VARTYPE specifier that describes the rank of the variable.

◆ SetVariableNames()

template<typename TYPE >
void geosx::SiloFileUtilities::SetVariableNames ( string const &  fieldName,
string_array varnamestring,
char const *  varnames[] 
)
Template Parameters
thetype of the field
Parameters
fieldNamethe name of the field
varnamestringan array of strings that hold the generated names
varnamesa pointer to each of the strings that hold the generated names

This function sets variable names for a field. In some cases, this will just fill varnamestring with the input variable, and in other cases such as in the case of a tensor, the names will have a suffix with the component of the tensor.