template<> ElemType string_to_enum< ElemType > (const std::string &s)
template<> std::string enum_to_string< ElemType > (const ElemType e)
template<> Order string_to_enum< Order > (const std::string &s)
template<> std::string enum_to_string< Order > (const Order o)
template<> FEFamily string_to_enum< FEFamily > (const std::string &s)
template<> std::string enum_to_string< FEFamily > (const FEFamily f)
template<> InfMapType string_to_enum< InfMapType > (const std::string &s)
template<> std::string enum_to_string< InfMapType > (const InfMapType i)
template<> QuadratureType string_to_enum< QuadratureType > (const std::string &s)
template<> std::string enum_to_string< QuadratureType > (const QuadratureType i)
template<> PreconditionerType string_to_enum< PreconditionerType > (const std::string &s)
template<> std::string enum_to_string< PreconditionerType > (const PreconditionerType i)
template<typename T > T string_to_enum (const std::string &s)
template<typename T > std::string enum_to_string (const T e)
std::string system_info ()
template<typename ForwardIter , typename T > void iota (ForwardIter first, ForwardIter last, T value)
template<class InputIterator > bool is_sorted (InputIterator first, InputIterator last)
template<class ForwardIterator , class T > ForwardIterator binary_find (ForwardIterator first, ForwardIterator last, const T &value)
template<int N> Real pow (const Real x)
template<> Real pow< 8 > (const Real x)
template<> Real pow< 6 > (const Real x)
template<> Real pow< 4 > (const Real x)
template<> Real pow< 3 > (const Real x)
template<> Real pow< 2 > (const Real x)
template<> Real pow< 1 > (const Real x)
template<> Real pow< 0 > (const Real)
unsigned int factorial (unsigned int n)
template<typename T > void deallocate (std::vector< T > &vec)
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)
Definition at line 130 of file utility.h.
{
ForwardIterator it = std::lower_bound(first, last, value);
return (it == last || value < *it) ? last : it;
}
Definition at line 95 of file utility.C.
References Quality::name().
Referenced by LegacyXdrIO::read_mgf_soln(), and LegacyXdrIO::write_mgf_soln().
{
std::string name(basename);
if (r_o_c == 0)
name.append('.real');
else
name.append('.imag');
return name;
}
Definition at line 232 of file utility.h.
Referenced by Nemesis_IO::read().
{
std::vector<T>().swap(vec);
}
Referenced by DofMap::reinit().
Definition at line 428 of file string_to_enum.C.
Referenced by MeshTools::Modification::all_tri().
{
init_enum_to_elem_type();
if (!enum_to_elem_type.count(e))
libmesh_error();
return enum_to_elem_type[e];
}
Definition at line 490 of file string_to_enum.C.
Referenced by System::get_info().
{
init_enum_to_fefamily();
if (!enum_to_fefamily.count(f))
libmesh_error();
return enum_to_fefamily[f];
}
Definition at line 521 of file string_to_enum.C.
Referenced by System::get_info().
{
init_enum_to_inf_map_type();
if (!enum_to_inf_map_type.count(i))
libmesh_error();
return enum_to_inf_map_type[i];
}
Definition at line 459 of file string_to_enum.C.
Referenced by System::get_info().
{
init_enum_to_order();
if (!enum_to_order.count(o))
libmesh_error();
return enum_to_order[o];
}
Definition at line 582 of file string_to_enum.C.
{
init_enum_to_preconditioner_type();
if (!enum_to_preconditioner_type.count(i))
libmesh_error();
return enum_to_preconditioner_type[i];
}
Definition at line 552 of file string_to_enum.C.
{
init_enum_to_quadrature_type();
if (!enum_to_quadrature_type.count(i))
libmesh_error();
return enum_to_quadrature_type[i];
}
Definition at line 212 of file utility.h.
Referenced by FE< Dim, T >::shape(), and FE< Dim, T >::shape_deriv().
{
unsigned int factorial_n = 1;
if (n==0)
return factorial_n;
for (unsigned int i=1; i<n; i++)
factorial_n *= i+1;
return factorial_n;
}
Definition at line 58 of file utility.h.
Referenced by PetscVector< T >::create_subvector(), PetscVector< T >::localize(), TransientSystem< Base >::re_update(), and System::re_update().
{
while (first != last)
{
*first = value++;
++first;
}
}
Definition at line 75 of file utility.h.
{
if ( first == last )
return true;
// 'prev' always points to the entry just to the left of 'first'
// [- - - - - -]
// ^ ^
// prev first
//
// [- - - - - -]
// ^ ^
// prev first
//
// [- - - - - -]
// ^ ^
// prev first
InputIterator prev( first );
for ( ++first; first != last; ++prev, ++first )
if ( *first < *prev ) // Note: this is the same as *prev > *first,
return false; // but we only require op< to be defined.
// If we haven't returned yet, it's sorted!
return true;
// A one-liner version using adjacent_find. This doesn't work for
// C-style arrays, since their pointers do not have a value_type.
//
// Works by checking to see if adjacent entries satisfy *i >
// *(i+1) and returns the first one which does. If 'last' is
// returned, no such pair was found, and therefore the range must
// be in non-decreasing order.
//
// return (last ==
// std::adjacent_find(first, last,
// std::greater< typename InputIterator::value_type >()));
// A second one-linear attempt. This one checks for a **strictly
// increasing** (no duplicate entries) range. Also doesn't work
// with C-style arrays.
//
// return (last ==
// std::adjacent_find(first, last,
// std::not2(std::less<typename InputIterator::value_type>())));
}
Definition at line 144 of file utility.h.
Referenced by GetPot::__DBE_expand(), ContinuationSystem::continuation_solve(), FEHermite< Dim >::hermite_raw_shape_second_deriv(), VariationalMeshSmoother::maxE(), VariationalMeshSmoother::metr_data_gen(), VariationalMeshSmoother::minJ(), VariationalMeshSmoother::minJ_BC(), FE< Dim, T >::shape(), FE< Dim, T >::shape_deriv(), FE< Dim, T >::shape_second_deriv(), MeshTools::Modification::smooth(), TwostepTimeSolver::solve(), PatchRecoveryErrorEstimator::specpoly(), and VariationalMeshSmoother::vertex().
{
libmesh_assert(N>1);
if (N%2) // odd exponent
return x * pow<N-1>(x);
const Real xNover2 = pow<N/2>(x);
return xNover2*xNover2;
}
Definition at line 204 of file utility.h.
{ return 1.; }
Definition at line 200 of file utility.h.
{ return x; }
Definition at line 196 of file utility.h.
Referenced by FE< Dim, T >::shape(), FE< Dim, T >::shape_deriv(), FE< Dim, T >::shape_second_deriv(), and VariationalMeshSmoother::writegr().
{ return x*x; }
Definition at line 192 of file utility.h.
Referenced by FE< Dim, T >::shape(), FE< Dim, T >::shape_deriv(), and FE< Dim, T >::shape_second_deriv().
{ return x*x*x; }
Definition at line 182 of file utility.h.
Referenced by FEHermite< Dim >::hermite_raw_shape_second_deriv(), FE< Dim, T >::shape(), FE< Dim, T >::shape_deriv(), and FE< Dim, T >::shape_second_deriv().
{
const Real
x2 = x*x,
x4 = x2*x2;
return x4;
}
Definition at line 170 of file utility.h.
Referenced by FE< Dim, T >::shape(), and FE< Dim, T >::shape_deriv().
{
const Real
x2 = x*x,
x4 = x2*x2,
x6 = x4*x2;
return x6;
}
Definition at line 158 of file utility.h.
{
const Real
x2 = x*x,
x4 = x2*x2,
x8 = x4*x4;
return x8;
}
Definition at line 111 of file utility.C.
Referenced by LegacyXdrIO::read_mgf_soln(), and LegacyXdrIO::write_mgf_soln().
{
const unsigned int len = source.size();
real_part.resize(len);
imag_part.resize(len);
for (unsigned int i=0; i<len; i++)
{
real_part[i] = source[i].real();
imag_part[i] = source[i].imag();
}
}
Definition at line 412 of file string_to_enum.C.
{
init_elem_type_to_enum();
std::string upper(s);
std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
if (!elem_type_to_enum.count(upper))
libmesh_error();
return elem_type_to_enum[upper];
}
Definition at line 474 of file string_to_enum.C.
{
init_fefamily_to_enum();
std::string upper(s);
std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
if (!fefamily_to_enum.count(upper))
libmesh_error();
return fefamily_to_enum[upper];
}
Definition at line 505 of file string_to_enum.C.
{
init_inf_map_type_to_enum();
std::string upper(s);
std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
if (!inf_map_type_to_enum.count(upper))
libmesh_error();
return inf_map_type_to_enum[upper];
}
Definition at line 443 of file string_to_enum.C.
{
init_order_to_enum();
std::string upper(s);
std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
if (!order_to_enum.count(upper))
libmesh_error();
return order_to_enum[upper];
}
Definition at line 566 of file string_to_enum.C.
{
init_preconditioner_type_to_enum();
std::string upper(s);
std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
if (!preconditioner_type_to_enum.count(upper))
libmesh_error();
return preconditioner_type_to_enum[upper];
}
Definition at line 536 of file string_to_enum.C.
Referenced by QBase::build().
{
init_quadrature_type_to_enum();
std::string upper(s);
std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
if (!quadrature_type_to_enum.count(upper))
libmesh_error();
return quadrature_type_to_enum[upper];
}
Definition at line 48 of file utility.C.
{
OStringStream out;
#ifdef LIBMESH_HAVE_LOCALE
typedef std::ostreambuf_iterator<char, std::char_traits<char> > TimeIter;
typedef std::time_put<char, TimeIter> TimePut;
std::locale loc;
OStringStream dateStr;
std::ostreambuf_iterator<char, std::char_traits<char> > begin(dateStr);
time_t tm = time(NULL);
struct tm* tmb = localtime(&tm);
const TimePut& tp = std::use_facet<TimePut>(loc);
tp.put(begin,
dateStr,
dateStr.fill(),
tmb,
'c');
// Get system information
struct utsname sysInfo;
uname(&sysInfo);
// Get user information
struct passwd* p = getpwuid(getuid());
out << '
<< ' ---------------------------------------------------------------------
<< '| Time: ' << dateStr.str() << '
<< '| OS: ' << sysInfo.sysname << '
<< '| HostName: ' << sysInfo.nodename << '
<< '| OS Release ' << sysInfo.release << '
<< '| OS Version: ' << sysInfo.version << '
<< '| Machine: ' << sysInfo.machine << '
<< '| Username: ' << p->pw_name << '
<< ' ---------------------------------------------------------------------;
#endif
return out.str();
}
Generated automatically by Doxygen for libMesh from the source code.