16 #ifndef dealii__utilities_h 17 #define dealii__utilities_h 19 #include <deal.II/base/config.h> 20 #include <deal.II/base/exceptions.h> 27 #ifdef DEAL_II_WITH_TRILINOS 28 # include <Epetra_Comm.h> 29 # include <Epetra_Map.h> 30 # ifdef DEAL_II_WITH_MPI 31 # include <Epetra_MpiComm.h> 33 # include <Epetra_SerialComm.h> 37 DEAL_II_NAMESPACE_OPEN
81 template <
typename number>
111 std::string
dim_string(
const int dim,
const int spacedim);
177 std::vector<std::string>
179 const char delimiter =
',');
190 std::vector<std::string>
192 const unsigned int width,
193 const char delimiter =
' ');
201 const std::string &pattern);
211 std::pair<int, unsigned int>
213 const unsigned int position);
220 const std::string &from,
221 const std::string &to);
229 trim(
const std::string &input);
268 template <
int N,
typename T>
281 template <
int a,
int N>
294 static const int value = 1;
318 template<
typename Iterator,
typename T>
330 template<
typename Iterator,
typename T,
typename Comp>
342 std::vector<unsigned int>
350 std::vector<unsigned int>
358 std::vector<unsigned long long int>
366 std::vector<unsigned long long int>
452 void posix_memalign (
void **memptr,
size_t alignment,
size_t size);
461 #ifdef DEAL_II_WITH_TRILINOS 524 duplicate_communicator (
const Epetra_Comm &communicator);
577 const Epetra_Comm &comm);
590 template <
int N,
typename T>
607 for (
int d=1; d<N; ++d)
615 template<
typename Iterator,
typename T>
628 template<
typename Iterator,
typename T,
typename Comp>
639 Assert (last - first >= 0,
640 ExcMessage (
"The given iterators do not satisfy the proper ordering."));
642 unsigned int len =
static_cast<unsigned int>(last-first);
659 if (!comp(*first, val))
663 if (!comp(*first, val))
667 if (!comp(*first, val))
671 if (!comp(*first, val))
675 if (!comp(*first, val))
679 if (!comp(*first, val))
683 if (!comp(*first, val))
702 const unsigned int half = len >> 1;
703 const Iterator middle = first + half;
710 if (comp(*middle, val))
722 DEAL_II_NAMESPACE_CLOSE
Iterator lower_bound(Iterator first, Iterator last, const T &val)
static const unsigned int invalid_unsigned_int
unsigned int get_n_mpi_processes(const Epetra_Comm &mpi_communicator)
std::string trim(const std::string &input)
std::pair< int, unsigned int > get_integer_at_position(const std::string &name, const unsigned int position)
std::vector< std::string > break_text_into_lines(const std::string &original_text, const unsigned int width, const char delimiter=' ')
const Epetra_Comm & comm_self()
std::string to_string(const number value, const unsigned int digits=numbers::invalid_unsigned_int)
void get_memory_stats(MemoryStats &stats)
double string_to_double(const std::string &s)
static ::ExceptionBase & ExcMessage(std::string arg1)
double generate_normal_random_number(const double a, const double sigma)
#define Assert(cond, exc)
std::vector< std::string > split_string_list(const std::string &s, const char delimiter=',')
bool match_at_string_start(const std::string &name, const std::string &pattern)
void posix_memalign(void **memptr, size_t alignment, size_t size)
std::vector< unsigned int > invert_permutation(const std::vector< unsigned int > &permutation)
bool job_supports_mpi() 1
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
std::string replace_in_string(const std::string &input, const std::string &from, const std::string &to)
std::string dim_string(const int dim, const int spacedim)
void destroy_communicator(Epetra_Comm &communicator)
std::string get_hostname()
const Epetra_Comm & comm_world()
int string_to_int(const std::string &s)
std::vector< unsigned int > reverse_permutation(const std::vector< unsigned int > &permutation)
static ::ExceptionBase & ExcNotImplemented()
unsigned int get_this_mpi_process(const Epetra_Comm &mpi_communicator)
Epetra_Map duplicate_map(const Epetra_BlockMap &map, const Epetra_Comm &comm)
unsigned int needed_digits(const unsigned int max_number)
static ::ExceptionBase & ExcInternalError()