Tempus
Version of the Day
Time Integration
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Tempus_String_Utilities.hpp
Go to the documentation of this file.
1
// @HEADER
2
// ****************************************************************************
3
// Tempus: Copyright (2017) Sandia Corporation
4
//
5
// Distributed under BSD 3-clause license (See accompanying file Copyright.txt)
6
// ****************************************************************************
7
// @HEADER
8
9
#ifndef Tempus_String_Utilities_hpp
10
#define Tempus_String_Utilities_hpp
11
12
#include <vector>
13
#include <string>
14
#include "Teuchos_RCP.hpp"
15
#include "Teuchos_ParameterList.hpp"
16
#include "Tempus_config.hpp"
17
18
namespace
Tempus
{
19
21
void
trim
(std::string& str);
22
24
void
StringTokenizer
(std::vector<std::string>& tokens,
25
const
std::string& str,
26
const
std::string delimiter =
","
,
bool
trim
=
false
);
27
29
void
TokensToDoubles
(std::vector<double> & values,
30
const
std::vector<std::string> & tokens);
31
33
void
TokensToInts
(std::vector<int> & values,
34
const
std::vector<std::string> & tokens);
35
39
template
<
typename
ScalarT>
40
ScalarT
getScalarParameter
(
const
std::string & field,
41
const
Teuchos::ParameterList & plist)
42
{
43
return
plist.get<
double
>(field);
44
}
45
}
46
47
#endif
// Tempus_String_Utilities_hpp
Tempus
Definition
Tempus_AdjointAuxSensitivityModelEvaluator_decl.hpp:21
Tempus::getScalarParameter
ScalarT getScalarParameter(const std::string &field, const Teuchos::ParameterList &plist)
Definition
Tempus_String_Utilities.hpp:40
Tempus::TokensToDoubles
void TokensToDoubles(std::vector< double > &values, const std::vector< std::string > &tokens)
Turn a vector of tokens into a vector of doubles.
Definition
Tempus_String_Utilities.cpp:62
Tempus::trim
void trim(std::string &str)
Removes whitespace at beginning and end of string.
Definition
Tempus_String_Utilities.cpp:14
Tempus::StringTokenizer
void StringTokenizer(std::vector< std::string > &tokens, const std::string &str, const std::string delimiters, bool trim)
Tokenize a string, put tokens in a vector.
Definition
Tempus_String_Utilities.cpp:31
Tempus::TokensToInts
void TokensToInts(std::vector< int > &values, const std::vector< std::string > &tokens)
Turn a vector of tokens into a vector of ints.
Definition
Tempus_String_Utilities.cpp:76
Generated by
1.17.0