* double double_attribute = 2.2;
* data_file.set_attribute("double_attribute", double_attribute);
* auto group = data_file.create_group("group");
- * group.set_attribute("simulation_type", std::string("elastic_equation"));
+ * group.set_attribute("simulation_type", "elastic_equation");
* auto dataset = group.create_dataset<double>("dataset_name", dimensions);
* dataset.set_attribute("complex_double_attribute",
* std::complex<double>(2,2.3));
/**
* Constructor. This is needed to allow users to specify
- * directly the separator without using std::string(";").
+ * directly the separator without using ";".
*
* Since we support a pure variadic templates version, without this
* specialization, the compiler will fail with cryptic errors.
template <class... PatternTypes>
Tuple::Tuple(const PatternTypes &...ps)
: // forward to the version with the separator argument
- Tuple(std::string(":"), ps...)
+ Tuple(":", ps...)
{}
// Now, just the [...]
// part should be left.
if (name.empty() || name[0] != '[')
- throw std::string("Invalid first character in ") + name;
+ throw "Invalid first character in " + name;
do
{
// Erase the
// we actually had a ']'
// there
if (name.empty() || name[0] != ']')
- throw std::string("Invalid first character in ") + name;
+ throw "Invalid first character in " + name;
name.erase(0, 1);
// just one more sanity check
Assert((base_fes.size() == base_multiplicities.size()) &&
// Now, just the (degree) or (Quadrature<1>(degree+1)) part should
// be left.
if (name.empty() || name[0] != '(')
- throw std::string("Invalid first character in ") + name;
+ throw "Invalid first character in " + name;
name.erase(0, 1);
if (name[0] != 'Q')
{
}
catch (const std::string &errline)
{
- AssertThrow(false,
- ExcInvalidFEName(parameter_name + std::string(" at ") +
- errline));
+ AssertThrow(false, ExcInvalidFEName(parameter_name + " at " + errline));
return nullptr;
}
}
communication_pattern);
AssertThrow(tpetra_comm_pattern != nullptr,
ExcMessage(
- std::string("The communication pattern is not of type ") +
+ "The communication pattern is not of type "
"LinearAlgebra::TpetraWrappers::CommunicationPattern."));
}
communication_pattern);
AssertThrow(epetra_comm_pattern != nullptr,
ExcMessage(
- std::string("The communication pattern is not of type ") +
+ "The communication pattern is not of type "
"LinearAlgebra::EpetraWrappers::CommunicationPattern."));
}
AssertThrow(
!tpetra_comm_pattern.is_null(),
- ExcMessage(
- std::string("The communication pattern is not of type ") +
- "LinearAlgebra::TpetraWrappers::CommunicationPattern."));
+ ExcMessage("The communication pattern is not of type "
+ "LinearAlgebra::TpetraWrappers::CommunicationPattern."));
}
Teuchos::RCP<const TpetraTypes::ExportType<MemorySpace>> tpetra_export =
* last step command. Numbers with less digits are filled with
* zeros from the left.
*/
- DoFOutputOperator(const std::string &filename_base = std::string("output"),
+ DoFOutputOperator(const std::string &filename_base = "output",
const unsigned int digits = 3);
void
if (i == 0)
{
// no value available for the first row
- add_value(rate_key, std::string("-"));
+ add_value(rate_key, "-");
}
else
{
if (i == 0)
{
// no value available for the first row
- add_value(rate_key, std::string("-"));
+ add_value(rate_key, "-");
}
else
{
if (i == 0)
{
// no value available for the first row
- add_value(rate_key, std::string("-"));
+ add_value(rate_key, "-");
}
else
{
if (i == 0)
{
// no value available for the first row
- add_value(rate_key, std::string("-"));
+ add_value(rate_key, "-");
}
else
{
for (const auto &map_entry : counter_map)
{
if (map_entry.second > 0)
- infostring += std::string("\n from Subscriber ") +
- std::string(map_entry.first);
+ infostring +=
+ "\n from Subscriber " + std::string(map_entry.first);
}
if (infostring.empty())
switch (io_mode)
{
case (H5D_MPIO_NO_COLLECTIVE):
- return std::string("H5D_MPIO_NO_COLLECTIVE");
+ return "H5D_MPIO_NO_COLLECTIVE";
break;
case (H5D_MPIO_CHUNK_INDEPENDENT):
- return std::string("H5D_MPIO_CHUNK_INDEPENDENT");
+ return "H5D_MPIO_CHUNK_INDEPENDENT";
break;
case (H5D_MPIO_CHUNK_COLLECTIVE):
- return std::string("H5D_MPIO_CHUNK_COLLECTIVE");
+ return "H5D_MPIO_CHUNK_COLLECTIVE";
break;
case (H5D_MPIO_CHUNK_MIXED):
- return std::string("H5D_MPIO_CHUNK_MIXED");
+ return "H5D_MPIO_CHUNK_MIXED";
break;
case (H5D_MPIO_CONTIGUOUS_COLLECTIVE):
- return std::string("H5D_MPIO_CONTIGUOUS_COLLECTIVE");
+ return "H5D_MPIO_CONTIGUOUS_COLLECTIVE";
break;
default:
DEAL_II_ASSERT_UNREACHABLE();
- return std::string("Internal error");
+ return "Internal error";
break;
}
// The function should not reach this line.
DEAL_II_ASSERT_UNREACHABLE();
- return std::string("Internal error");
+ return "Internal error";
}
JobIdentifier::JobIdentifier()
{
time_t t = std::time(nullptr);
- id = std::string("JobId ");
+ id = "JobId ";
#if defined(DEAL_II_HAVE_UNISTD_H) && defined(DEAL_II_HAVE_GETHOSTNAME)
char name[100];
gethostname(name, 99);
- id += std::string(name) + std::string(" ");
+ id += std::string(name) + " ";
#else
- id += std::string("unknown ");
+ id += "unknown ";
#endif
id += std::string(std::ctime(&t));
pre = get_prefixes().top();
pre += text;
- pre += std::string(":");
+ pre += ":";
get_prefixes().push(pre);
}
else
{
AssertThrow(false,
- ExcInternalError(
- std::string("Unrecognized file format: ") +
- error_file_format));
+ ExcInternalError("Unrecognized file format: " +
+ error_file_format));
}
table_file.close();
}
{
std::vector<std::string> v;
v.emplace_back();
- path_lists.insert(map_type(std::string("PARAMETER"), v));
+ path_lists.insert(map_type("PARAMETER", v));
/*
* TODO: re-enable some sensible default paths. Maier, 2012
*/
- path_lists.insert(map_type(std::string("MESH"), v));
+ path_lists.insert(map_type("MESH", v));
v.clear();
v.emplace_back();
v.emplace_back(".prm");
- suffix_lists.insert(map_type(std::string("PARAMETER"), v));
+ suffix_lists.insert(map_type("PARAMETER", v));
/*
* TODO: "Would require linking with the deal.II libraries"? This .cc
v.emplace_back(".plt");
v.emplace_back(".nc");
v.emplace_back(".msh");
- suffix_lists.insert(map_type(std::string("MESH"), v));
+ suffix_lists.insert(map_type("MESH", v));
}
std::vector<std::string> &
}
}
AssertThrow(false, ExcFileNotFound(filename, cls));
- return std::string("");
+ return "";
}
std::string
}
}
AssertThrow(false, ExcFileNotFound(filename, cls));
- return std::string("");
+ return "";
}
Assert(std::find(active_sections.begin(),
active_sections.end(),
section_name) == active_sections.end(),
- ExcMessage(std::string("Cannot enter the already active section <") +
- section_name + ">."));
+ ExcMessage("Cannot enter the already active section <" + section_name +
+ ">."));
if (sections.find(section_name) == sections.end())
{
{
const TableIndices<rank> indices(
out.unrolled_to_component_indices(i));
- out[indices] = Expression(sym + std::string("_") +
- internal::make_index_string(indices));
+ out[indices] =
+ Expression(sym + "_" + internal::make_index_string(indices));
}
return out;
}
{
const TableIndices<rank> indices(
out.unrolled_to_component_indices(i));
- out[indices] = Expression(sym + std::string("_") +
- internal::make_index_string(indices));
+ out[indices] =
+ Expression(sym + "_" + internal::make_index_string(indices));
}
return out;
}
{
const TableIndices<4> indices =
make_rank_4_tensor_indices<dim>(i, j);
- out[indices] =
- Expression(sym + std::string("_") +
- internal::make_index_string(indices));
+ out[indices] = Expression(
+ sym + "_" + internal::make_index_string(indices));
}
return out;
}
const TableIndices<rank> indices(
out.unrolled_to_component_indices(i));
out[indices] =
- Expression(sym + std::string("_") +
- internal::make_index_string(indices),
+ Expression(sym + "_" + internal::make_index_string(indices),
args);
}
return out;
const TableIndices<rank> indices(
out.unrolled_to_component_indices(i));
out[indices] =
- Expression(sym + std::string("_") +
- internal::make_index_string(indices),
+ Expression(sym + "_" + internal::make_index_string(indices),
args);
}
return out;
const TableIndices<4> indices =
make_rank_4_tensor_indices<dim>(i, j);
out[indices] =
- Expression(sym + std::string("_") +
- internal::make_index_string(indices),
+ Expression(sym + "_" + internal::make_index_string(indices),
args);
}
return out;
void
EpsFlagsBase::parse_parameters(ParameterHandler ¶m)
{
- if (param.get("Size by") == std::string("width"))
+ if (param.get("Size by") == "width")
size_type = width;
- else if (param.get("Size by") == std::string("height"))
+ else if (param.get("Size by") == "height")
size_type = height;
size = param.get_integer("Size");
line_width = param.get_double("Line width");
communication_pattern);
AssertThrow(
epetra_comm_pattern != nullptr,
- ExcMessage(
- std::string("The communication pattern is not of type ") +
- "LinearAlgebra::EpetraWrappers::CommunicationPattern."));
+ ExcMessage("The communication pattern is not of type "
+ "LinearAlgebra::EpetraWrappers::CommunicationPattern."));
}
Epetra_Import import_map(epetra_comm_pattern->get_epetra_import());
AssertThrow(Factory.Query(additional_data.solver_type.c_str()),
ExcMessage(
- std::string("You tried to select the solver type <") +
+ "You tried to select the solver type <" +
additional_data.solver_type +
"> but this solver is not supported by Trilinos either "
"because it does not exist, or because Trilinos was not "
AssertThrow(Factory.Query(additional_data.solver_type.c_str()),
ExcMessage(
- std::string("You tried to select the solver type <") +
+ "You tried to select the solver type <" +
additional_data.solver_type +
"> but this solver is not supported by Trilinos either "
"because it does not exist, or because Trilinos was not "