libMesh
|
Classes | |
struct | do_pow |
An efficient template instantiation for raising to an arbitrary integer power. More... | |
struct | do_pow< 0, T > |
struct | do_pow< 1, T > |
struct | do_pow< 6, T > |
class | ReverseBytes |
This Functor simply takes an object and reverses its byte representation. More... | |
Functions | |
template<typename T > | |
std::string | enum_to_string (const T e) |
uint32_t | hashword (const uint32_t *k, size_t length, uint32_t initval=0) |
The hashword function takes an array of uint32_t's of length 'length' and computes a single key from it. More... | |
uint32_t | hashword (const std::vector< uint32_t > &keys, uint32_t initval=0) |
Calls function above with slightly more convenient std::vector interface. More... | |
uint32_t | hashword2 (const uint32_t &first, const uint32_t &second, uint32_t initval=0) |
This is a hard-coded version of hashword for hashing exactly 2 numbers. More... | |
uint64_t | hashword2 (const uint64_t first, const uint64_t second) |
Call the 64-bit FNV hash function. More... | |
uint16_t | hashword2 (const uint16_t first, const uint16_t second) |
uint64_t | hashword (const uint64_t *k, size_t length) |
Call the 64-bit FNV hash function. More... | |
uint16_t | hashword (const uint16_t *k, size_t length) |
In a personal communication from Bob Jenkins, he recommended using "Probably final() from lookup3.c... More... | |
template<typename Container > | |
Container::value_type | hashword (const Container &keys) |
Calls functions above with slightly more convenient std::vector/array compatible interface. More... | |
template<typename T > | |
T | string_to_enum (const std::string &s) |
std::string | get_timestamp () |
void | print_timestamp (std::ostream &target=std::cout) |
std::string | system_info () |
template<typename Map > | |
Map::mapped_type & | map_find (Map &map, const typename Map::key_type &key, const char *filename, int line_number) |
This function should not be called directly (although it can be), instead see the libmesh_map_find() macro. More... | |
template<typename Map > | |
const Map::mapped_type & | map_find (const Map &map, const typename Map::key_type &key, const char *filename, int line_number) |
A version of the function above that works for const objects. More... | |
template<typename ForwardIter , typename T > | |
void | iota (ForwardIter first, ForwardIter last, T value) |
Utility::iota is a duplication of the SGI STL extension std::iota . More... | |
template<class InputIterator > | |
bool | is_sorted (InputIterator first, InputIterator last) |
Utility::is_sorted mimics the behavior of the SGI STL extension std::is_sorted. More... | |
template<class ForwardIterator , class T > | |
ForwardIterator | binary_find (ForwardIterator first, ForwardIterator last, const T &value) |
The STL provides std::binary_search() which returns true or false depending on whether the searched-for value is found. More... | |
template<class ForwardIterator , class T , class Compare > | |
ForwardIterator | binary_find (ForwardIterator first, ForwardIterator last, const T &value, Compare comp) |
As above, but takes a custom comparison object. More... | |
template<int N, typename T > | |
T | pow (const T &x) |
unsigned int | factorial (unsigned int n) |
A simple implementation of the factorial. More... | |
template<typename T > | |
T | binomial (T n, T k) |
template<typename T > | |
void | deallocate (std::vector< T > &vec) |
A convenient method to truly empty a vector using the "swap trick". More... | |
std::string | complex_filename (const std::string &basename, unsigned int r_o_c=0) |
void | prepare_complex_data (const std::vector< Complex > &source, std::vector< Real > &real_part, std::vector< Real > &imag_part) |
Prepare complex data for writing. More... | |
int | mkdir (const char *pathname) |
Create a directory. More... | |
ForwardIterator libMesh::Utility::binary_find | ( | ForwardIterator | first, |
ForwardIterator | last, | ||
const T & | value | ||
) |
The STL provides std::binary_search()
which returns true
or false
depending on whether the searched-for value is found.
In contrast, Utility::binary_find() uses a std::lower_bound() based search on a sorted range to find the required value.
Definition at line 183 of file utility.h.
References value.
Referenced by libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole().
ForwardIterator libMesh::Utility::binary_find | ( | ForwardIterator | first, |
ForwardIterator | last, | ||
const T & | value, | ||
Compare | comp | ||
) |
T libMesh::Utility::binomial | ( | T | n, |
T | k | ||
) |
Definition at line 272 of file utility.h.
Referenced by libMesh::FE< Dim, LAGRANGE_VEC >::shape(), and libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv().
std::string libMesh::Utility::complex_filename | ( | const std::string & | basename, |
unsigned int | r_o_c = 0 |
||
) |
r_o_c
= 0 the filename for output of the real part of complex data, and for r_o_c
= 1 the filename for the imaginary part. Definition at line 105 of file utility.C.
References libMesh::Quality::name().
void libMesh::Utility::deallocate | ( | std::vector< T > & | vec | ) |
A convenient method to truly empty a vector using the "swap trick".
Definition at line 295 of file utility.h.
Referenced by libMesh::Nemesis_IO::read().
std::string libMesh::Utility::enum_to_string | ( | const T | e | ) |
string
which matches the enumeration e
of type T
. Referenced by libMesh::RBDataSerialization::add_elem_to_builder(), libMesh::LaspackLinearSolver< T >::adjoint_solve(), libMesh::AbaqusIO::assign_sideset_ids(), libMesh::AbaqusIO::assign_subdomain_ids(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::ReferenceElem::get(), libMesh::FEInterface::get_continuity(), libMesh::Elem::get_info(), libMesh::QNodal::init_1D(), libMesh::QClough::init_2D(), libMesh::QGaussLobatto::init_2D(), libMesh::QTrap::init_2D(), libMesh::QConical::init_2D(), libMesh::QGrid::init_2D(), libMesh::QGauss::init_2D(), libMesh::QSimpson::init_2D(), libMesh::QNodal::init_2D(), libMesh::QGrundmann_Moller::init_2D(), libMesh::QClough::init_3D(), libMesh::QGaussLobatto::init_3D(), libMesh::QTrap::init_3D(), libMesh::QConical::init_3D(), libMesh::QGrid::init_3D(), libMesh::QGauss::init_3D(), libMesh::QSimpson::init_3D(), libMesh::QNodal::init_3D(), libMesh::QGrundmann_Moller::init_3D(), libMesh::LinearSolver< Number >::print_converged_reason(), libMesh::Elem::quality(), libMesh::ExodusII_IO::read(), libMesh::AbaqusIO::read_elements(), libMesh::DofMap::reinit(), libMesh::Elem::second_order_equivalent_type(), libMesh::PetscLinearSolver< Number >::set_petsc_solver_type(), libMesh::SlepcEigenSolver< libMesh::Number >::set_slepc_solver_type(), libMesh::AztecLinearSolver< T >::set_solver_type(), libMesh::EigenSparseLinearSolver< T >::solve(), libMesh::LaspackLinearSolver< T >::solve(), QuadratureTest::testBuild(), libMesh::GMVIO::write_ascii_old_impl(), libMesh::GMVIO::write_discontinuous_gmv(), and libMesh::ExodusII_IO_Helper::write_elements().
std::string libMesh::Utility::get_timestamp | ( | ) |
Definition at line 37 of file timestamp.C.
References libMesh::out.
Referenced by libMesh::RBConstruction::compute_Fq_representor_innerprods(), libMesh::RBConstruction::compute_output_dual_innerprods(), libMesh::PerfLog::get_info_header(), print_timestamp(), system_info(), libMesh::TransientRBConstruction::update_residual_terms(), and libMesh::RBConstruction::update_residual_terms().
|
inline |
Calls functions above with slightly more convenient std::vector/array compatible interface.
Definition at line 304 of file hashword.h.
References hashword().
|
inline |
Calls function above with slightly more convenient std::vector interface.
Definition at line 195 of file hashword.h.
References hashword().
|
inline |
In a personal communication from Bob Jenkins, he recommended using "Probably final() from lookup3.c...
You could hash up to 6 16-bit integers that way. The output is c, or the top or bottom 16 bits of c if you only need 16 bit hash values." [JWP]
Definition at line 263 of file hashword.h.
|
inline |
The hashword function takes an array of uint32_t's of length 'length' and computes a single key from it.
Definition at line 153 of file hashword.h.
Referenced by libMesh::Elem::compute_key(), libMesh::SparsityPattern::Build::handle_vi_vj(), hashword(), and libMesh::Elem::key().
|
inline |
Call the 64-bit FNV hash function.
Definition at line 249 of file hashword.h.
|
inline |
Definition at line 240 of file hashword.h.
|
inline |
This is a hard-coded version of hashword for hashing exactly 2 numbers.
Definition at line 210 of file hashword.h.
Referenced by libMesh::Elem::compute_key(), and libMesh::SparsityPattern::Build::handle_vi_vj().
|
inline |
void libMesh::Utility::iota | ( | ForwardIter | first, |
ForwardIter | last, | ||
T | value | ||
) |
Utility::iota
is a duplication of the SGI STL extension std::iota
.
It simply assigns sequentially increasing values to a range. That is, it assigns value
to *first
, value
+ 1 to *
(first + 1) and so on. In general, each iterator i
in the range [first, last) is assigned value
+ (i - first
).
Definition at line 105 of file utility.h.
References value.
Referenced by libMesh::PetscVector< libMesh::Number >::create_subvector(), libMesh::DTKAdapter::DTKAdapter(), libMesh::DynaIO::ElementDefinition::ElementDefinition(), libMesh::PetscVector< libMesh::Number >::localize(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectInteriors::operator()(), libMesh::System::project_vector(), libMesh::System::projection_matrix(), DiagonalMatrixTest::testNumerics(), QuadratureTest::testTetQuadrature(), and QuadratureTest::testTriQuadrature().
bool libMesh::Utility::is_sorted | ( | InputIterator | first, |
InputIterator | last | ||
) |
Utility::is_sorted mimics the behavior of the SGI STL extension std::is_sorted.
Checks to see if the range [first,last) is sorted in non-decreasing order, ie. for each "i" in [first,last) *i <= *(i+1).
Definition at line 125 of file utility.h.
References libMesh::MeshTools::Subdivision::prev.
|
inline |
|
inline |
This function should not be called directly (although it can be), instead see the libmesh_map_find() macro.
Calls find(key), and checks the result against end(). Returns the corresponding value if found, throws an error otherwise. Templated on the type of map, so this will work with both std::map and std::unordered_map.
int libMesh::Utility::mkdir | ( | const char * | pathname | ) |
Create a directory.
Definition at line 140 of file utility.C.
Referenced by libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEvaluation::write_out_vectors(), and libMesh::RBConstruction::write_riesz_representors_to_files().
|
inline |
Definition at line 246 of file utility.h.
References libMesh::Utility::do_pow< N, T >::apply().
Referenced by libMesh::FEHermite< Dim >::hermite_raw_shape_second_deriv(), libMesh::FESubdivision::regular_shape(), libMesh::FE< Dim, LAGRANGE_VEC >::shape(), and libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv().
void libMesh::Utility::prepare_complex_data | ( | const std::vector< Complex > & | source, |
std::vector< Real > & | real_part, | ||
std::vector< Real > & | imag_part | ||
) |
Prepare complex data for writing.
|
inline |
Definition at line 37 of file timestamp.h.
References get_timestamp().
T libMesh::Utility::string_to_enum | ( | const std::string & | s | ) |
T
which matches the string s
. std::string libMesh::Utility::system_info | ( | ) |
Definition at line 57 of file utility.C.
References get_timestamp().