Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_STK_TransformBCNameForIOSS.cpp
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
13#include <algorithm>
14#include <cctype>
15
16std::string panzer_stk::transformBCNameForIOSS(std::string& name)
17{
18 // strip off leading and trailing whitespace just in case this comes
19 // in from input file.
20 panzer::trim(name);
21
22 // replace internal whitespace with underscores and upper case with lower case.
23 std::transform(name.begin(), name.end(), name.begin(),
24 [](const char c)
25 {
26 if (c == ' ')
27 return '_';
28 else
29 return char(std::tolower(c));
30 });
31 return name;
32}
std::string transformBCNameForIOSS(std::string &bc_name)
void trim(std::string &str)
Removes whitespace at beginning and end of string.