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"
66 std::ostringstream os;
75 return v ?
"true" :
"false";
82 return std::to_string(v);
87 return std::to_string(v);
92 return std::to_string(v);
97 return std::to_string(v);
102 return std::to_string(v);
107 return std::to_string(v);
112template <
typename T,
typename V>
116 return std::holds_alternative<T>(value) ?
stringify(std::get<T>(value)) :
"";
120template <
typename... T>
124 return (internal::stringify_variant<T>(v) + ...);
137std::string
stringify(
const std::string & s);
152template <
typename T,
typename U>
154stringify(
const std::pair<T, U> & p,
const std::string & delim =
":")
160template <
typename... Args>
162stringify(
const std::tuple<Args...> & t,
const std::string & delim =
":")
164 if constexpr (
sizeof...(Args) == 0)
170 [&delim](
const auto &... args)
174 ((result += (n++ == 0 ?
"" : delim) +
stringify(args)), ...);
193template <
template <
typename...>
class T,
typename... U>
196 const std::string & delim =
", ",
197 const std::string & elem_encl =
"",
198 bool enclose_list_in_curly_braces =
false)
201 if (enclose_list_in_curly_braces)
203 const auto begin = c.begin();
204 const auto end = c.end();
205 for (
auto i = begin; i != end; ++i)
206 str += (i != begin ? delim :
"") + elem_encl +
stringify(*i) + elem_encl;
207 if (enclose_list_in_curly_braces)
219template <
typename T1,
typename T2>
223 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...