Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_String_Utilities.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Panzer: A partial differential equation assembly
4// engine for strongly coupled complex multiphysics systems
5//
6// Copyright 2011 NTESS and the Panzer contributors.
7// SPDX-License-Identifier: BSD-3-Clause
8// *****************************************************************************
9// @HEADER
10
11#ifndef PANZER_STRING_UTILITIES_HPP
12#define PANZER_STRING_UTILITIES_HPP
13
14#include <vector>
15#include <string>
16#include "Teuchos_RCP.hpp"
17#include "Teuchos_ParameterList.hpp"
18
19namespace panzer {
20
22 void trim(std::string& str);
23
25 void StringTokenizer(std::vector<std::string>& tokens,
26 const std::string& str,
27 const std::string delimiter = ",",bool trim=false);
28
30 void TokensToDoubles(std::vector<double> & values,const std::vector<std::string> & tokens);
31
33 void TokensToInts(std::vector<int> & values,const std::vector<std::string> & tokens);
34
38 template <typename ScalarT>
39 ScalarT getScalarParameter(const std::string & field,const Teuchos::ParameterList & plist)
40 {
41 return plist.get<double>(field);
42 }
43}
44
45#endif
PHX::MDField< ScalarT, panzer::Cell, panzer::BASIS > field
A field to which we'll contribute, or in which we'll store, the result of computing this integral.
void TokensToInts(std::vector< int > &values, const std::vector< std::string > &tokens)
Turn a vector of tokens into a vector of ints.
ScalarT getScalarParameter(const std::string &field, const Teuchos::ParameterList &plist)
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.
void trim(std::string &str)
Removes whitespace at beginning and end of string.
void TokensToDoubles(std::vector< double > &values, const std::vector< std::string > &tokens)
Turn a vector of tokens into a vector of doubles.