* DataOutInterface::write_vtu().
*/
void
- write_vtu_in_parallel(const char *filename, MPI_Comm comm) const;
+ write_vtu_in_parallel(const std::string &filename, MPI_Comm comm) const;
/**
* Some visualization programs, such as ParaView, can read several separate
* later use.
*/
static Event
- assign(const char *name);
+ assign(const std::string &name);
/**
* If you forgot to store the result of assign, here is how to retrieve it
* identifier for the program being run.
*/
static std::string
- base_name(const char *filename);
+ base_name(const std::string &filename);
/**
* Return the value of <tt>id</tt>.
* there for more information.
*/
virtual void
- parse_input_from_string(const char * s,
+ parse_input_from_string(const std::string &s,
const std::string &last_line = "",
const bool skip_undefined = false);
* interface between deal.II and p4est.
*/
void
- write_mesh_vtk(const char *file_basename) const;
+ write_mesh_vtk(const std::string &file_basename) const;
/**
* Produce a check sum of the triangulation. This is a collective
* cell-based data can be saved using register_data_attach().
*/
void
- save(const char *filename) const;
+ save(const std::string &filename) const;
/**
* Load the refinement information saved with save() back in. The mesh
* if a different number of MPI processes is encountered).
*/
void
- load(const char *filename, const bool autopartition = true);
+ load(const std::string &filename, const bool autopartition = true);
/**
* Register a function that can be used to attach data of fixed size
*/
void
save(const typename dealii::internal::p4est::types<dim>::forest
- * parallel_forest,
- const char *filename) const;
+ * parallel_forest,
+ const std::string &filename) const;
/**
* Transfer data from file system.
void
load(const typename dealii::internal::p4est::types<dim>::forest
* parallel_forest,
- const char * filename,
+ const std::string &filename,
const unsigned int n_attached_deserialize_fixed,
const unsigned int n_attached_deserialize_variable);
* compiler.
*/
void
- load(const char *filename, const bool autopartition = true);
+ load(const std::string &filename, const bool autopartition = true);
/**
* This function is not implemented, but needs to be present for the
* compiler.
*/
void
- save(const char *filename) const;
+ save(const std::string &filename) const;
/**
* This function is not implemented, but needs to be present for the
std::make_pair(numbers::invalid_unsigned_int,
numbers::invalid_unsigned_int)) const;
- /**
- * Same as above but takes a filename as a <code>char</code> pointer.
- *
- * @deprecated This function is deprecated. Use the one taking <code>std::string</code> instead.
- */
- DEAL_II_DEPRECATED void
- save(const char * filename,
- const std::pair<unsigned int, unsigned int> &chunk_size =
- std::make_pair(numbers::invalid_unsigned_int,
- numbers::invalid_unsigned_int)) const;
-
/**
* Loads the distributed matrix from file @p filename using HDF5.
* In case that deal.II was built without HDF5
void
load(const std::string &filename);
- /**
- * Same as above but takes a filename as a <code>char</code> pointer.
- *
- * @deprecated This function is deprecated. Use the one taking <code>std::string</code> instead.
- */
- DEAL_II_DEPRECATED void
- load(const char *filename);
-
/**
* Compute the Cholesky factorization of the matrix using ScaLAPACK
* function <code>pXpotrf</code>. The result of the factorization is stored in
template <int dim, int spacedim>
void
-DataOutInterface<dim, spacedim>::write_vtu_in_parallel(const char *filename,
- MPI_Comm comm) const
+DataOutInterface<dim, spacedim>::write_vtu_in_parallel(
+ const std::string &filename,
+ MPI_Comm comm) const
{
#ifndef DEAL_II_WITH_MPI
// without MPI fall back to the normal way to write a vtu file:
AssertThrowMPI(ierr);
MPI_File fh;
ierr = MPI_File_open(comm,
- const_cast<char *>(filename),
+ DEAL_II_MPI_CONST_CAST(filename.c_str()),
MPI_MODE_CREATE | MPI_MODE_WRONLY,
info,
&fh);
DataOutBase::write_vtu_header(ss, vtk_flags);
header_size = ss.str().size();
ierr = MPI_File_write(fh,
- const_cast<char *>(ss.str().c_str()),
+ DEAL_II_MPI_CONST_CAST(ss.str().c_str()),
header_size,
MPI_CHAR,
MPI_STATUS_IGNORE);
vtk_flags,
ss);
ierr = MPI_File_write_ordered(fh,
- const_cast<char *>(ss.str().c_str()),
+ DEAL_II_MPI_CONST_CAST(ss.str().c_str()),
ss.str().size(),
MPI_CHAR,
MPI_STATUS_IGNORE);
DataOutBase::write_vtu_footer(ss);
unsigned int footer_size = ss.str().size();
ierr = MPI_File_write_shared(fh,
- const_cast<char *>(ss.str().c_str()),
+ DEAL_II_MPI_CONST_CAST(ss.str().c_str()),
footer_size,
MPI_CHAR,
MPI_STATUS_IGNORE);
std::vector<std::string> Event::names;
Event
- Event::assign(const char *name)
+ Event::assign(const std::string &name)
{
unsigned int index = names.size();
names.emplace_back(name);
constant != constants.end();
++constant)
{
- fp.get()[component]->DefineConst(constant->first.c_str(),
- constant->second);
+ fp.get()[component]->DefineConst(constant->first, constant->second);
}
for (unsigned int iv = 0; iv < var_names.size(); ++iv)
- fp.get()[component]->DefineVar(var_names[iv].c_str(), &vars.get()[iv]);
+ fp.get()[component]->DefineVar(var_names[iv], &vars.get()[iv]);
// define some compatibility functions:
fp.get()[component]->DefineFun("if", internal::mu_if, true);
std::cerr << "Token: <" << e.GetToken() << ">\n";
std::cerr << "Position: <" << e.GetPos() << ">\n";
std::cerr << "Errc: <" << e.GetCode() << ">" << std::endl;
- AssertThrow(false, ExcParseError(e.GetCode(), e.GetMsg().c_str()));
+ AssertThrow(false, ExcParseError(e.GetCode(), e.GetMsg()));
}
}
}
std::cerr << "Token: <" << e.GetToken() << ">\n";
std::cerr << "Position: <" << e.GetPos() << ">\n";
std::cerr << "Errc: <" << e.GetCode() << ">" << std::endl;
- AssertThrow(false, ExcParseError(e.GetCode(), e.GetMsg().c_str()));
+ AssertThrow(false, ExcParseError(e.GetCode(), e.GetMsg()));
return 0.0;
}
}
std::string
-JobIdentifier::base_name(const char *filename)
+JobIdentifier::base_name(const std::string &filename)
{
std::string name(filename);
std::string::size_type pos;
void
-ParameterHandler::parse_input_from_string(const char * s,
+ParameterHandler::parse_input_from_string(const std::string &s,
const std::string &last_line,
const bool skip_undefined)
{
void
Triangulation<dim, spacedim>::DataTransfer::save(
const typename dealii::internal::p4est::types<dim>::forest
- * parallel_forest,
- const char *filename) const
+ * parallel_forest,
+ const std::string &filename) const
{
// Large fractions of this function have been copied from
// DataOutInterface::write_vtu_in_parallel.
Triangulation<dim, spacedim>::DataTransfer::load(
const typename dealii::internal::p4est::types<dim>::forest
* parallel_forest,
- const char * filename,
+ const std::string &filename,
const unsigned int n_attached_deserialize_fixed,
const unsigned int n_attached_deserialize_variable)
{
template <int dim, int spacedim>
void
Triangulation<dim, spacedim>::write_mesh_vtk(
- const char *file_basename) const
+ const std::string &file_basename) const
{
Assert(parallel_forest != nullptr,
ExcMessage("Can't produce output when no forest is created yet."));
- dealii::internal::p4est::functions<dim>::vtk_write_file(parallel_forest,
- nullptr,
- file_basename);
+ dealii::internal::p4est::functions<dim>::vtk_write_file(
+ parallel_forest, nullptr, file_basename.c_str());
}
template <int dim, int spacedim>
void
- Triangulation<dim, spacedim>::save(const char *filename) const
+ Triangulation<dim, spacedim>::save(const std::string &filename) const
{
Assert(
cell_attached_data.n_attached_deserialize == 0,
tria->data_transfer.clear();
}
- dealii::internal::p4est::functions<dim>::save(filename,
+ dealii::internal::p4est::functions<dim>::save(filename.c_str(),
parallel_forest,
false);
template <int dim, int spacedim>
void
- Triangulation<dim, spacedim>::load(const char *filename,
- const bool autopartition)
+ Triangulation<dim, spacedim>::load(const std::string &filename,
+ const bool autopartition)
{
Assert(
this->n_cells() > 0,
attached_count_fixed + attached_count_variable;
parallel_forest = dealii::internal::p4est::functions<dim>::load_ext(
- filename,
+ filename.c_str(),
this->mpi_communicator,
0,
false,
template <int spacedim>
void
- Triangulation<1, spacedim>::load(const char *, const bool)
+ Triangulation<1, spacedim>::load(const std::string &, const bool)
{
Assert(false, ExcNotImplemented());
}
template <int spacedim>
void
- Triangulation<1, spacedim>::save(const char *) const
+ Triangulation<1, spacedim>::save(const std::string &) const
{
Assert(false, ExcNotImplemented());
}
-template <typename NumberType>
-void
-ScaLAPACKMatrix<NumberType>::save(
- const char * filename,
- const std::pair<unsigned int, unsigned int> &chunk_size) const
-{
- save(std::string(filename), chunk_size);
-}
-
-
-
template <typename NumberType>
void
ScaLAPACKMatrix<NumberType>::save_serial(
-template <typename NumberType>
-void
-ScaLAPACKMatrix<NumberType>::load(const char *filename)
-{
- load(std::string(filename));
-}
-
-
-
template <typename NumberType>
void
ScaLAPACKMatrix<NumberType>::load_serial(const std::string &filename)