}
}
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
ChunkSparseMatrix<number>::print(std::ostream &out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
Assert(cols != nullptr, ExcNeedsSparsityPattern());
Assert(val != nullptr, ExcNotInitialized());
Assert(false, ExcNotImplemented());
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
const char * zero_string,
const double denominator) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
Assert(cols != nullptr, ExcNeedsSparsityPattern());
Assert(val != nullptr, ExcNotInitialized());
out << std::setw(width) << zero_string << ' ';
out << std::endl;
};
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// reset output format
out.precision(old_precision);
ChunkSparseMatrix<number>::print_pattern(std::ostream &out,
const double threshold) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
Assert(cols != nullptr, ExcNeedsSparsityPattern());
Assert(val != nullptr, ExcNotInitialized());
out << std::endl;
}
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
ChunkSparseMatrix<number>::block_write(std::ostream &out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// first the simple objects, bracketed in [...]
out << '[' << max_len << "][";
reinterpret_cast<const char *>(val.get()));
out << ']';
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
ChunkSparseMatrix<number>::block_read(std::istream &in)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
char c;
}
out << std::endl;
};
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// reset output format
out.precision(old_precision);
out << std::endl;
};
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// reset output format
out.flags(old_flags);
out.precision(old_precision);
const bool across) const
{
Assert(partitioner.get() != nullptr, ExcInternalError());
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
std::ios::fmtflags old_flags = out.flags();
unsigned int old_precision = out.precision(precision);
}
#endif
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// reset output format
out.flags(old_flags);
out.precision(old_precision);
Vector<Number>::print_as_numpy_array(std::ostream & out,
const unsigned int precision) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
boost::io::ios_flags_saver restore_flags(out);
out.precision(precision);
out << this->values[i] << ' ';
out << '\n' << std::flush;
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
Vector<Number>::block_write(std::ostream &out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// Other version of the following
// out << size() << std::endl << '[';
const char outro = ']';
out.write(&outro, 1);
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
Vector<Number>::block_read(std::istream &in)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
size_type sz;
const unsigned int precision,
const bool scientific) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
boost::io::ios_flags_saver restore_flags(out);
out.precision(precision);
out << '[' << idx << "]: " << values[i++] << '\n';
out << std::flush;
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
out << std::setw(width) << zero_string << ' ';
out << std::endl;
};
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// reset output format
out.precision(old_precision);
out << ':';
out << std::endl;
};
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
SparseMatrix<number>::print_as_numpy_arrays(std::ostream & out,
const unsigned int precision) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
boost::io::ios_flags_saver restore_flags(out);
out.precision(precision);
out << '\n';
out << std::flush;
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
SparseMatrix<number>::block_write(std::ostream &out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// first the simple objects,
// bracketed in [...]
reinterpret_cast<const char *>(val.get()));
out << ']';
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
SparseMatrix<number>::block_read(std::istream &in)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
char c;
void
SparseMatrixEZ<number>::print(std::ostream &out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
const_iterator i = begin();
const const_iterator e = end();
const char * zero_string,
const double denominator) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
Assert(m() != 0, ExcNotInitialized());
Assert(n() != 0, ExcNotInitialized());
void
SparseMatrixEZ<number>::block_write(std::ostream &out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// first the simple objects,
// bracketed in [...]
out << ']';
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
SparseMatrixEZ<number>::block_read(std::istream &in)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
char c;
int n;
const bool scientific,
const bool across) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
boost::io::ios_flags_saver restore_flags(out);
// Get a representation of the vector and loop over all
// restore the representation
// of the vector
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
operator<<(std::ostream &out, const Vector<number> &v)
{
Assert(v.size() != 0, ExcEmptyObject());
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
for (typename Vector<number>::size_type i = 0; i < v.size() - 1; ++i)
out << v(i) << ' ';
out << v(v.size() - 1);
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
return out;
}
const bool across) const
{
Assert(size() != 0, ExcEmptyObject());
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
std::ios::fmtflags old_flags = out.flags();
unsigned int old_precision = out.precision(precision);
out << values[i] << std::endl;
out << std::endl;
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// reset output format
out.flags(old_flags);
out.precision(old_precision);
void
Vector<Number>::block_write(std::ostream &out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// other version of the following
// out << size() << std::endl << '[';
const char outro = ']';
out.write(&outro, 1);
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
Vector<Number>::block_read(std::istream &in)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
size_type sz;
// tested, therefore currently not allowed.
AssertThrow(dim > 0, ExcNotImplemented());
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
#ifndef DEAL_II_WITH_MPI
// verify that there are indeed patches to be written out. most of the
out.flush();
// assert the stream is still ok
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
// Point output is currently not implemented.
AssertThrow(dim > 0, ExcNotImplemented());
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
#ifndef DEAL_II_WITH_MPI
// verify that there are indeed patches to be written out. most of the
out.flush();
// assert the stream is still ok
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
const GnuplotFlags &flags,
std::ostream & out)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
#ifndef DEAL_II_WITH_MPI
// verify that there are indeed patches to be written out. most
// make sure everything now gets to disk
out.flush();
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
const PovrayFlags & flags,
std::ostream & out)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
#ifndef DEAL_II_WITH_MPI
// verify that there are indeed patches to be written out. most
// make sure everything now gets to disk
out.flush();
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
} // namespace
const EpsFlags &flags,
std::ostream & out)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
#ifndef DEAL_II_WITH_MPI
// verify that there are indeed patches to be written out. most of the
out.flush();
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
AssertThrow(dim > 0, ExcNotImplemented());
Assert(dim <= 3, ExcNotImplemented());
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
#ifndef DEAL_II_WITH_MPI
// verify that there are indeed patches to be written out. most of the
out.flush();
// assert the stream is still ok
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
const TecplotFlags &flags,
std::ostream & out)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// The FEBLOCK or FEPOINT formats of tecplot only allows full elements (e.g.
// triangles), not single points. Other tecplot format allow point output,
out.flush();
// assert the stream is still ok
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
}
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
# ifndef DEAL_II_WITH_MPI
// verify that there are indeed patches to be written out. most of the
const VtkFlags &flags,
std::ostream & out)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
#ifndef DEAL_II_WITH_MPI
// verify that there are indeed patches to be written out. most of the
out.flush();
// assert the stream is still ok
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
write_vtu_header(std::ostream &out, const VtkFlags &flags)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
out << "<?xml version=\"1.0\" ?> \n";
out << "<!-- \n";
out << "# vtk DataFile Version 3.0" << '\n'
void
write_vtu_footer(std::ostream &out)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
out << " </UnstructuredGrid>\n";
out << "</VTKFile>\n";
}
const VtkFlags &flags,
std::ostream & out)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// If the user provided physical units, make sure that they don't contain
// quote characters as this would make the VTU file invalid XML and
out.flush();
// assert the stream is still ok
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
& nonscalar_data_ranges,
const VtkFlags &flags)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// If the user provided physical units, make sure that they don't contain
// quote characters as this would make the VTU file invalid XML and
out.flush();
// assert the stream is still ok
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
std::ostream & out,
const std::vector<std::pair<double, std::string>> ×_and_names)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
out << "<?xml version=\"1.0\"?>\n";
out.flush();
out.precision(ss);
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
write_visit_record(std::ostream & out,
const std::vector<std::vector<std::string>> &piece_names)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
if (piece_names.size() == 0)
return;
const std::vector<std::pair<double, std::vector<std::string>>>
×_and_piece_names)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
if (times_and_piece_names.size() == 0)
return;
const Deal_II_IntermediateFlags & /*flags*/,
std::ostream &out)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// first write tokens indicating the template parameters. we need this in
// here because we may want to read in data again even if we don't know in
std::pair<unsigned int, unsigned int>
determine_intermediate_format_dimensions(std::istream &input)
{
- AssertThrow(input, ExcIO());
+ AssertThrow(input.fail() == false, ExcIO());
unsigned int dim, spacedim;
input >> dim >> spacedim;
void
DataOutReader<dim, spacedim>::read(std::istream &in)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// first empty previous content
{
std::get<2>(nonscalar_data_ranges[i]) = name;
}
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
}
std::istream &
operator>>(std::istream &in, Patch<dim, spacedim> &patch)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// read a header line and compare it to what we usually write. skip all
// lines that contain only blanks at the start
for (unsigned int j = 0; j < patch.data.n_cols(); ++j)
in >> patch.data[i][j];
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
return in;
}
void
IndexSet::read(std::istream &in)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
size_type s;
unsigned int n_ranges;
set_size(s);
for (unsigned int i = 0; i < n_ranges; ++i)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
size_type b, e;
in >> b >> e;
void
IndexSet::block_write(std::ostream &out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
out.write(reinterpret_cast<const char *>(&index_space_size),
sizeof(index_space_size));
std::size_t n_ranges = ranges.size();
if (ranges.empty() == false)
out.write(reinterpret_cast<const char *>(&*ranges.begin()),
ranges.size() * sizeof(Range));
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
ParameterAcceptor::initialize(std::istream &input_stream, ParameterHandler &prm)
{
- AssertThrow(input_stream, ExcIO());
+ AssertThrow(input_stream.fail() == false, ExcIO());
declare_all_parameters(prm);
prm.parse_input(input_stream);
parse_all_parameters(prm);
const std::string &last_line,
const bool skip_undefined)
{
- AssertThrow(input, ExcIO());
+ AssertThrow(input.fail() == false, ExcIO());
// store subsections we are currently in
const std::vector<std::string> saved_path = subsection_path;
ParameterHandler::parse_input_from_xml(std::istream &in,
const bool skip_undefined)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// read the XML tree assuming that (as we
// do in print_parameters(XML) it has only
// a single top-level node called
ParameterHandler::parse_input_from_json(std::istream &in,
const bool skip_undefined)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
boost::property_tree::ptree node_tree;
// This boost function will raise an exception if this is not a valid JSON
ParameterHandler::print_parameters(std::ostream & out,
const OutputStyle style) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
assert_validity_of_output_style(style);
output_style = style | LaTeX;
std::ofstream out(filename);
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
print_parameters(out, output_style);
}
const unsigned int indent_level,
std::ostream & out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// this function should not be necessary for XML or JSON output...
Assert(!(style & (XML | JSON)), ExcInternalError());
const std::string &last_line,
const bool skip_undefined)
{
- AssertThrow(input, ExcIO());
+ AssertThrow(input.fail() == false, ExcIO());
// Note that (to avoid infinite recursion) we have to explicitly call the
// base class version of parse_input and *not* a wrapper (which may be
void
TableHandler::write_text(std::ostream &out, const TextOutputFormat format) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
boost::io::ios_flags_saver restore_flags(out);
// first pad the table from below if necessary
{
// TODO[TH]: update code similar to
// write_text() to use the cache
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
if (with_header)
out << "\\documentclass[10pt]{report}" << '\n'
<< "\\usepackage{float}" << '\n'
std::ifstream cpuinfo;
cpuinfo.open("/proc/loadavg");
- AssertThrow(cpuinfo, ExcIO());
+ AssertThrow(cpuinfo.fail() == false, ExcIO());
double load;
cpuinfo >> load;
{
std::string fname = std::string(filename) + ".info";
std::ifstream f(fname.c_str());
- AssertThrow(f, ExcIO());
+ AssertThrow(f.fail() == false, ExcIO());
std::string firstline;
getline(f, firstline); // skip first line
f >> version >> numcpus >> attached_count_fixed >>
{
std::string fname = std::string(filename) + ".info";
std::ifstream f(fname.c_str());
- AssertThrow(f, ExcIO());
+ AssertThrow(f.fail() == false, ExcIO());
std::string firstline;
getline(f, firstline); // skip first line
f >> version >> numcpus >> attached_count_fixed >>
std::ostream & out,
const std::map<types::global_dof_index, Point<spacedim>> &support_points)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
std::map<Point<spacedim>,
std::vector<types::global_dof_index>,
" file."));
std::ifstream grid_file(msh_file_name);
- Assert(grid_file, ExcIO());
+ Assert(grid_file.fail() == false, ExcIO());
GridIn<2, spacedim> gridin;
gridin.attach_triangulation(tria);
Assert(tria != nullptr, ExcNoTriangulationSelected());
Assert((dim == 2) || (dim == 3), ExcNotImplemented());
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
skip_comment_lines(in, '#'); // skip comments (if any) at beginning of file
int tmp;
// loop over sections, read until section 2411 is found, and break once found
while (true)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
in >> tmp;
AssertThrow(tmp == -1,
ExcMessage("Invalid UNV file format. "
"Expected '-1' before and after a section."));
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
in >> tmp;
AssertThrow(tmp >= 0, ExcUnknownSectionType(tmp));
if (tmp != 2411)
while (true)
{
std::string line;
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
std::getline(in, line);
// remove leading and trailing spaces in the line
boost::algorithm::trim(line);
int dummy;
double x[3];
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
in >> no;
tmp = no;
in >> dummy >> dummy >> dummy;
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
in >> x[0] >> x[1] >> x[2];
vertices.emplace_back();
no_vertex++;
}
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
in >> tmp;
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
in >> tmp;
// section 2412 describes elements: see
int type;
int dummy;
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
in >> no;
tmp = no;
const auto reference_cell = ReferenceCells::get_hypercube<dim>();
cells.emplace_back();
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
in >> cells.back()
.vertices[reference_cell.unv_vertex_to_deal_vertex(v)];
else if (((type == 11) && (dim == 2)) ||
((type == 11) && (dim == 3))) // boundary line
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
in >> dummy >> dummy >> dummy;
subcelldata.boundary_lines.emplace_back();
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
for (unsigned int &vertex :
subcelldata.boundary_lines.back().vertices)
in >> vertex;
const auto reference_cell = ReferenceCells::Quadrilateral;
subcelldata.boundary_quads.emplace_back();
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
Assert(subcelldata.boundary_quads.back().vertices.size() ==
GeometryInfo<2>::vertices_per_cell,
ExcInternalError());
if (!in.eof())
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
in >> tmp;
// section 2467 (2477) describes (materials - first and bcs - second) or
int no; // unv
int dummy;
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
in >> dummy;
tmp = dummy;
in >> dummy >> dummy >> dummy >> dummy >> dummy >> dummy >>
n_entities;
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
in >> id;
const unsigned int n_lines =
for (unsigned int no_fragment = 0; no_fragment < n_fragments;
no_fragment++)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
in >> dummy >> no >> dummy >> dummy;
if (cell_indices.count(no) > 0) // cell - material
const bool apply_all_indicators_to_manifolds)
{
Assert(tria != nullptr, ExcNoTriangulationSelected());
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// skip comments at start of file
skip_comment_lines(in, '#');
in >> n_vertices >> n_cells >> dummy // number of data vectors
>> dummy // cell data
>> dummy; // model data
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// set up array of vertices
std::vector<Point<spacedim>> vertices(n_vertices);
double x[3];
// read vertex
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
in >> vertex_number >> x[0] >> x[1] >> x[2];
// store vertex
// cells at the top, there
// should still be input here,
// so check this:
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
std::string cell_type;
// check that no forbidden arrays are used
Assert(subcelldata.check_consistency(dim), ExcInternalError());
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// do some clean-up on vertices...
GridTools::delete_unused_vertices(vertices, cells, subcelldata);
Assert((spacedim == 2 && dim == spacedim) ||
(spacedim == 3 && (dim == spacedim || dim == spacedim - 1)),
ExcNotImplemented());
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// Read in the Abaqus file into an intermediate object
// that is to be passed along to the UCD reader
Assert(tria != nullptr, ExcNoTriangulationSelected());
Assert(dim == 2, ExcNotImplemented());
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// skip comments at start of file
skip_comment_lines(in, '#');
// check that no forbidden arrays are used
Assert(subcelldata.check_consistency(dim), ExcInternalError());
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// do some clean-up on vertices...
GridTools::delete_unused_vertices(vertices, cells, subcelldata);
GridIn<dim, spacedim>::read_xda(std::istream &in)
{
Assert(tria != nullptr, ExcNoTriangulationSelected());
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
const auto reference_cell = ReferenceCells::get_hypercube<dim>();
{
// note that since in the input file we found the number of cells at the
// top, there should still be input here, so check this:
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// XDA happens to use ExodusII's numbering because XDA/XDR is libMesh's
// native format, and libMesh's node numberings come from ExodusII:
in >> dummy;
}
}
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// do some clean-up on vertices...
GridTools::delete_unused_vertices(vertices, cells, subcelldata);
GridIn<dim, spacedim>::read_comsol_mphtxt(std::istream &in)
{
Assert(tria != nullptr, ExcNoTriangulationSelected());
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// Start by making our life a bit easier: The file format
// allows for comments in a whole bunch of places, including
// # Types
// 3 obj
- AssertThrow(whole_file, ExcIO());
+ AssertThrow(whole_file.fail() == false, ExcIO());
{
unsigned int version_major, version_minor;
//
// # Mesh vertex coordinates
// ...
- AssertThrow(whole_file, ExcIO());
+ AssertThrow(whole_file.fail() == false, ExcIO());
{
unsigned int dummy;
whole_file >> dummy >> dummy >> dummy;
// 6
// 3
// [...]
- AssertThrow(whole_file, ExcIO());
+ AssertThrow(whole_file.fail() == false, ExcIO());
std::vector<CellData<dim>> cells;
SubCellData subcelldata;
n_vertices_per_element);
for (unsigned int e = 0; e < n_elements; ++e)
{
- AssertThrow(whole_file, ExcIO());
+ AssertThrow(whole_file.fail() == false, ExcIO());
for (unsigned int v = 0; v < n_vertices_per_element; ++v)
{
whole_file >> vertices_for_this_element[v];
{
for (unsigned int e = 0; e < n_geom_entity_indices; ++e)
{
- AssertThrow(whole_file, ExcIO());
+ AssertThrow(whole_file.fail() == false, ExcIO());
unsigned int geometric_entity_index;
whole_file >> geometric_entity_index;
if (object_type == ReferenceCells::Vertex)
}
}
}
- AssertThrow(whole_file, ExcIO());
+ AssertThrow(whole_file.fail() == false, ExcIO());
// Now finally create the mesh. Because of the quirk with boundary
// edges and faces described in the documentation of this function,
GridIn<dim, spacedim>::read_msh(std::istream &in)
{
Assert(tria != nullptr, ExcNoTriangulationSelected());
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
unsigned int n_vertices;
unsigned int n_cells;
// cells at the top, there
// should still be input here,
// so check this:
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
unsigned int nod_num;
// check that no forbidden arrays are used
Assert(subcelldata.check_consistency(dim), ExcInternalError());
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// check that we actually read some cells.
AssertThrow(cells.size() > 0,
const unsigned int dim = 2;
const unsigned int spacedim = 2;
Assert(tria != nullptr, ExcNoTriangulationSelected());
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// skip comments at start of file
skip_comment_lines(in, '#');
// we found the number of cells at
// the top, there should still be
// input here, so check this:
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// get the connectivity from the
// input file. the vertices are
// used. as we do not read in any
// subcelldata, nothing should happen here.
Assert(subcelldata.check_consistency(dim), ExcInternalError());
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// do some cleanup on cells
GridTools::invert_all_negative_measure_cells(vertices, cells);
// http://www.egr.msu.edu/software/abaqus/Documentation/docs/v6.7/books/usb/default.htm?startat=pt01ch02.html
// http://www.cprogramming.com/tutorial/string.html
- AssertThrow(input_stream, ExcIO());
+ AssertThrow(input_stream.fail() == false, ExcIO());
std::string line;
while (std::getline(input_stream, line))
// http://www.dealii.org/developer/doxygen/deal.II/structGeometryInfo.html
// http://people.scs.fsu.edu/~burkardt/data/ucd/ucd.html
- AssertThrow(output, ExcIO());
+ AssertThrow(output.fail() == false, ExcIO());
// save old formatting options
const boost::io::ios_base_all_saver formatting_saver(output);
{
// TODO:[GK] allow for boundary faces only
Assert(dx_flags.write_all_faces, ExcNotImplemented());
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// Copied and adapted from write_ucd
const std::vector<Point<spacedim>> &vertices = tria.get_vertices();
const std::vector<bool> & vertex_used = tria.get_used_vertices();
// disk
out.flush();
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
GridOut::write_msh(const Triangulation<dim, spacedim> &tria,
std::ostream & out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// get the positions of the
// vertices and whether they are
// disk
out.flush();
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
GridOut::write_ucd(const Triangulation<dim, spacedim> &tria,
std::ostream & out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// get the positions of the
// vertices and whether they are
// disk
out.flush();
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
// disk
out.flush();
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
GridOut::write_mathgl(const Triangulation<dim, spacedim> &tria,
std::ostream & out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// (i) write header
{
// make sure everything now gets to the output stream
out.flush();
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
GridOut::write_vtk(const Triangulation<dim, spacedim> &tria,
std::ostream & out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// get the positions of the vertices
const std::vector<Point<spacedim>> &vertices = tria.get_vertices();
out.flush();
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
GridOut::write_vtu(const Triangulation<dim, spacedim> &tria,
std::ostream & out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// convert the cells of the triangulation into a set of patches
// and then have them output. since there is no data attached to
DataOutBase::write_vtu_footer(out);
out << std::flush;
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
const Mapping<1, spacedim> *,
const GridOutFlags::Gnuplot &gnuplot_flags)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
for (const auto &cell : tria.active_cell_iterators())
{
// disk
out.flush();
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
const Mapping<2, spacedim> * mapping,
const GridOutFlags::Gnuplot & gnuplot_flags)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
const int dim = 2;
// make sure everything now gets to disk
out.flush();
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
const Mapping<3, spacedim> * mapping,
const GridOutFlags::Gnuplot & gnuplot_flags)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
const int dim = 3;
// make sure everything now gets to disk
out.flush();
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
} // namespace
} // namespace internal
static_cast<const GridOutFlags::EpsFlagsBase &>(eps_flags_2) :
static_cast<const GridOutFlags::EpsFlagsBase &>(eps_flags_3);
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
const unsigned int n_points = eps_flags_base.n_boundary_face_points;
// make up a list of lines by which
// disk
out.flush();
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
} // namespace
} // namespace internal
{
const unsigned int n_flag_levels = refine_flags.size();
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
out << mn_persistent_tria_flags_begin << ' ' << n_flag_levels << std::endl;
out << mn_persistent_tria_flags_end << std::endl;
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
{
Assert(refine_flags.size() == 0 && coarsen_flags.size() == 0,
ExcFlagsNotCleared());
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
unsigned int magic_number;
in >> magic_number;
AssertThrow(magic_number == mn_persistent_tria_flags_end,
typename Triangulation<dim>::ExcGridReadError());
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
}
std::ostream &
operator<<(std::ostream &out, const ReferenceCell &reference_cell)
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// Output as an integer to avoid outputting it as a character with
// potentially non-printing value:
std::istream &
operator>>(std::istream &in, ReferenceCell &reference_cell)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
// Read the information as an integer and convert it to the correct type
unsigned int value;
for (unsigned int position = 0; position < N; ++position)
flags[position / 8] |= (v[position] ? (1 << (position % 8)) : 0);
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// format:
// 0. magic number
delete[] flags;
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
const unsigned int magic_number2,
std::istream & in)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
unsigned int magic_number;
in >> magic_number;
delete[] flags;
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
}
(sparsity_pattern.colnums != nullptr),
ExcEmptyObject());
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
for (size_type i = 0; i < sparsity_pattern.rows; ++i)
for (size_type d = 0; (d < chunk_size) && (i * chunk_size + d < n_rows());
out << ']' << std::endl;
}
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
(sparsity_pattern.colnums != nullptr),
ExcEmptyObject());
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// for each entry in the underlying sparsity pattern, repeat everything
// chunk_size x chunk_size times
out << sparsity_pattern.colnums[j] * chunk_size + d << " "
<< -static_cast<signed int>(i * chunk_size + e) << std::endl;
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
ChunkSparsityPattern::block_write(std::ostream &out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// first the simple objects, bracketed in [...]
out << '[' << rows << ' ' << cols << ' ' << chunk_size << ' ' << "][";
sparsity_pattern.block_write(out);
out << ']';
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
ChunkSparsityPattern::block_read(std::istream &in)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
char c;
const bool scientific,
const bool) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
std::ios::fmtflags old_flags = out.flags();
unsigned int old_precision = out.precision(precision);
out << cpu_val[i] << std::endl;
out << std::flush;
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// reset output format
out.flags(old_flags);
out.precision(old_precision);
out << ']' << std::endl;
}
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
}
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
out << std::endl;
}
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// reset output format
out.flags(old_flags);
out.precision(old_precision);
AssertThrow(ierr == 0, ExcPETScError(ierr));
}
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
const bool scientific,
const bool across) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// get a representation of the vector and
// loop over all the elements
ierr = VecRestoreArray(vector, &val);
AssertThrow(ierr == 0, ExcPETScError(ierr));
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
} // namespace MPI
const bool scientific,
const bool across) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// get a representation of the vector and
// loop over all the elements
ierr = VecRestoreArray(vector, &val);
AssertThrow(ierr == 0, ExcPETScError(ierr));
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
{
Assert((rowstart != nullptr) && (colnums != nullptr), ExcEmptyObject());
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
for (size_type i = 0; i < rows; ++i)
{
out << ']' << std::endl;
}
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
{
Assert((rowstart != nullptr) && (colnums != nullptr), ExcEmptyObject());
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
for (size_type i = 0; i < rows; ++i)
for (size_type j = rowstart[i]; j < rowstart[i + 1]; ++j)
// the order of output
out << colnums[j] << " " << -static_cast<signed int>(i) << std::endl;
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
void
SparsityPattern::block_write(std::ostream &out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
// first the simple objects, bracketed in [...]
out << '[' << max_dim << ' ' << rows << ' ' << cols << ' ' << max_vec_len
reinterpret_cast<const char *>(colnums.get()));
out << ']';
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
SparsityPattern::block_read(std::istream &in)
{
- AssertThrow(in, ExcIO());
+ AssertThrow(in.fail() == false, ExcIO());
char c;
const bool scientific,
const bool across) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
boost::io::ios_flags_saver restore_flags(out);
// Get a representation of the vector and loop over all
// restore the representation
// of the vector
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
}
}
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
}
}
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
<< std::endl;
}
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
// TODO: Implement!
const bool scientific,
const bool across) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
boost::io::ios_flags_saver restore_flags(out);
out << std::endl;
}
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}
void
Histogram::write_gnuplot(std::ostream &out) const
{
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
Assert(!intervals.empty(),
ExcMessage("There is nothing to write into the output file. "
"Did you forget to call the evaluate() function?"));
out << std::endl;
}
- AssertThrow(out, ExcIO());
+ AssertThrow(out.fail() == false, ExcIO());
}