16#include "libmesh/enum_order.h"
17#include "libmesh/enum_quadrature_type.h"
18#include "libmesh/enum_fe_family.h"
19#include "libmesh/enum_elem_type.h"
67 std::ostringstream os;
76 return v ?
"true" :
"false";
83 return std::to_string(v);
88 return std::to_string(v);
93 return std::to_string(v);
98 return std::to_string(v);
103 return std::to_string(v);
108 return std::to_string(v);
113template <
typename T,
typename V>
117 return std::holds_alternative<T>(value) ?
stringify(std::get<T>(value)) :
"";
121template <
typename... T>
125 return (internal::stringify_variant<T>(v) + ...);
138std::string
stringify(
const std::string & s);
157template <
typename T,
typename U>
159stringify(
const std::pair<T, U> & p,
const std::string & delim =
":")
165template <
typename... Args>
167stringify(
const std::tuple<Args...> & t,
const std::string & delim =
":")
169 if constexpr (
sizeof...(Args) == 0)
175 [&delim](
const auto &... args)
179 ((result += (n++ == 0 ?
"" : delim) +
stringify(args)), ...);
198template <
template <
typename...>
class T,
typename... U>
201 const std::string & delim =
", ",
202 const std::string & elem_encl =
"",
203 bool enclose_list_in_curly_braces =
false)
206 if (enclose_list_in_curly_braces)
208 const auto begin = c.begin();
209 const auto end = c.end();
210 for (
auto i = begin; i != end; ++i)
211 str += (i != begin ? delim :
"") + elem_encl +
stringify(*i) + elem_encl;
212 if (enclose_list_in_curly_braces)
224template <
typename T1,
typename T2>
228 std::vector<T2> out(in.begin(), in.end());
Point toPoint(const std::vector< Real > &pos)
Convert point represented as std::vector into Point.
std::vector< T2 > vectorCast(std::vector< T2 > in)
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type.
std::string stringify_variant(const V &value)
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
SolveType stringToEnum< SolveType >(const std::string &s)
LineSearchType stringToEnum< LineSearchType >(const std::string &s)
std::vector< T > vectorStringsToEnum(const MultiMooseEnum &v)
T stringToEnum(const std::string &s)
SolveType
Type of the solve.
libMesh::Order stringToEnum< libMesh::Order >(const std::string &s)
TimeIntegratorType
Time integrators.
RelationshipManagerType stringToEnum< RelationshipManagerType >(const std::string &s)
LineSearchType
Type of the line search.
TimeIntegratorType stringToEnum< TimeIntegratorType >(const std::string &s)
CoordinateSystemType stringToEnum< CoordinateSystemType >(const std::string &s)
libMesh::QuadratureType stringToEnum< libMesh::QuadratureType >(const std::string &s)
std::string stringify(const T &t)
conversion to string
RelationshipManagerType
Main types of Relationship Managers.
std::string stringifyExact(Real)
Stringify Reals with enough precision to guarantee lossless Real -> string -> Real roundtrips.
EigenSolveType
Type of the eigen solve.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...