// primarily used to write the updated nodal values, stored as
// <code>Tensor<1,problem_dimension></code>, into the global objects.
- template <std::size_t k>
+ template <std::size_t k, int k2>
DEAL_II_ALWAYS_INLINE inline void
scatter(std::array<LinearAlgebra::distributed::Vector<double>, k> &U,
- const Tensor<1, ((identity<std::size_t>::type)k)> & tensor,
+ const Tensor<1, k2> & tensor,
const unsigned int i)
{
+ static_assert(k == k2,
+ "The dimensions of the input arguments must agree");
for (unsigned int j = 0; j < k; ++j)
U[j].local_element(i) = tensor[j];
}
namespace
{
void print_head(ConditionalOStream &pcout,
- std::string header,
- std::string secondary = "")
+ const std::string & header,
+ const std::string & secondary = "")
{
const auto header_size = header.size();
const auto padded_header = std::string((34 - header_size) / 2, ' ') +
/**
* Number type for R matrix.
*/
- typedef typename VectorType::value_type Number;
+ using Number = typename VectorType::value_type;
protected:
/**
/**
* Number type for R matrix.
*/
- typedef typename VectorType::value_type Number;
+ using Number = typename VectorType::value_type;
/**
* Default constructor.
/**
* Number type for R matrix.
*/
- typedef typename VectorType::value_type Number;
+ using Number = typename VectorType::value_type;
/**
* Default constructor.
/**
* Number type.
*/
- typedef typename VectorType::value_type Number;
+ using Number = typename VectorType::value_type;
/**
{
std::set<std::string> entries_wrongly_not_set;
- for (auto it : entries_set_status)
+ for (const auto &it : entries_set_status)
if (it.second.first == true && it.second.second == false)
entries_wrongly_not_set.insert(it.first);
const Epetra_Map &domain_map = matrix.OperatorDomainMap();
const size_type constant_modes_dimension = constant_modes.size();
- ptr_distributed_constant_modes.reset(new Epetra_MultiVector(
- domain_map, constant_modes_dimension > 0 ? constant_modes_dimension : 1));
+ ptr_distributed_constant_modes = std_cxx14::make_unique<Epetra_MultiVector>(
+ domain_map, constant_modes_dimension > 0 ? constant_modes_dimension : 1);
Assert(ptr_distributed_constant_modes, ExcNotInitialized());
Epetra_MultiVector &distributed_constant_modes =
*ptr_distributed_constant_modes;
std::vector<TopoDS_Edge> edges;
std::vector<TopoDS_Face> faces;
OpenCASCADE::extract_geometrical_shapes(shape, faces, edges, vertices);
- bool mesh_is_present = true;
- for (unsigned int i = 0; i < faces.size(); ++i)
- {
+ const bool mesh_is_present =
+ std::none_of(faces.begin(), faces.end(), [&Loc](const TopoDS_Face &face) {
Handle(Poly_Triangulation) theTriangulation =
- BRep_Tool::Triangulation(faces[i], Loc);
- if (theTriangulation.IsNull())
- {
- mesh_is_present = false;
- break;
- }
- }
+ BRep_Tool::Triangulation(face, Loc);
+ return theTriangulation.IsNull();
+ });
TopoDS_Shape shape_to_be_written = shape;
if (!mesh_is_present)
{