direct.solve(system_matrix, newton_update, right_hand_side);
- return std::pair<unsigned int, double>(solver_control.last_step(),
- solver_control.last_value());
+ return {solver_control.last_step(), solver_control.last_value()};
}
// Likewise, if we are to use an iterative solver, we use Aztec's GMRES
solver.Iterate(parameters.max_iterations,
parameters.linear_residual);
- return std::pair<unsigned int, double>(solver.NumIters(),
- solver.TrueResidual());
+ return {solver.NumIters(), solver.TrueResidual()};
}
}
Assert(false, ExcNotImplemented());
- return std::pair<unsigned int, double>(0, 0);
+ return {0, 0};
}
// indicator one.
Point<3> rotate_half_sphere(const Point<3> &in)
{
- return Point<3>(in(2), in(1), -in(0));
+ return {in(2), in(1), -in(0)};
}
template <int dim>
Point<2> operator()(const Point<2> &in) const
{
- return Point<2>(in(0), trans(in(1)));
+ return {in(0), trans(in(1))};
}
};
const double R_bar = R / std::sqrt(1 - (ellipticity * ellipticity *
std::sin(theta) * std::sin(theta)));
- return Point<3>((R_bar + d) * std::cos(phi) * std::cos(theta),
- (R_bar + d) * std::sin(phi) * std::cos(theta),
- ((1 - ellipticity * ellipticity) * R_bar + d) *
- std::sin(theta));
+ return {(R_bar + d) * std::cos(phi) * std::cos(theta),
+ (R_bar + d) * std::sin(phi) * std::cos(theta),
+ ((1 - ellipticity * ellipticity) * R_bar + d) * std::sin(theta)};
}
Point<3> AfricaGeometry::pull_back_wgs84(const Point<3> &x) const
Assert(vertex < vertices_per_cell,
ExcIndexRange(vertex, 0, vertices_per_cell));
- return Point<2>(vertex % 2, vertex / 2);
+ return {static_cast<double>(vertex % 2), static_cast<double>(vertex / 2)};
}
Assert(vertex < vertices_per_cell,
ExcIndexRange(vertex, 0, vertices_per_cell));
- return Point<3>(vertex % 2, vertex / 2 % 2, vertex / 4);
+ return {static_cast<double>(vertex % 2),
+ static_cast<double>(vertex / 2 % 2),
+ static_cast<double>(vertex / 4)};
}
IndexSet::IntervalAccessor::begin() const
{
Assert(is_valid(), ExcMessage("invalid iterator"));
- return IndexSet::ElementIterator(index_set,
- range_idx,
- index_set->ranges[range_idx].begin);
+ return {index_set, range_idx, index_set->ranges[range_idx].begin};
}
// point to first index in next interval unless we are the last interval.
if (range_idx < index_set->ranges.size() - 1)
- return IndexSet::ElementIterator(index_set,
- range_idx + 1,
- index_set->ranges[range_idx + 1].begin);
+ return {index_set, range_idx + 1, index_set->ranges[range_idx + 1].begin};
else
return index_set->end();
}
{
compress();
if (ranges.size() > 0)
- return IndexSet::ElementIterator(this, 0, ranges[0].begin);
+ return {this, 0, ranges[0].begin};
else
return end();
}
// [a,b[ and we will return an iterator pointing directly at global_index
// (else branch).
if (global_index < p->begin)
- return IndexSet::ElementIterator(this, p - ranges.begin(), p->begin);
+ return {this, static_cast<size_type>(p - ranges.begin()), p->begin};
else
- return IndexSet::ElementIterator(this, p - ranges.begin(), global_index);
+ return {this, static_cast<size_type>(p - ranges.begin()), global_index};
}
Assert(position < 2, ExcIndexRange(position, 0, 2));
if (position == 0)
- return TableIndices<2>(new_index, numbers::invalid_unsigned_int);
+ return {new_index, numbers::invalid_unsigned_int};
else
- return TableIndices<2>(previous_indices[0], new_index);
+ return {previous_indices[0], new_index};
}
switch (position)
{
case 0:
- return TableIndices<4>(new_index,
- numbers::invalid_unsigned_int,
- numbers::invalid_unsigned_int,
- numbers::invalid_unsigned_int);
+ return {new_index,
+ numbers::invalid_unsigned_int,
+ numbers::invalid_unsigned_int,
+ numbers::invalid_unsigned_int};
case 1:
- return TableIndices<4>(previous_indices[0],
- new_index,
- numbers::invalid_unsigned_int,
- numbers::invalid_unsigned_int);
+ return {previous_indices[0],
+ new_index,
+ numbers::invalid_unsigned_int,
+ numbers::invalid_unsigned_int};
case 2:
- return TableIndices<4>(previous_indices[0],
- previous_indices[1],
- new_index,
- numbers::invalid_unsigned_int);
+ return {previous_indices[0],
+ previous_indices[1],
+ new_index,
+ numbers::invalid_unsigned_int};
case 3:
- return TableIndices<4>(previous_indices[0],
- previous_indices[1],
- previous_indices[2],
- new_index);
+ return {previous_indices[0],
+ previous_indices[1],
+ previous_indices[2],
+ new_index};
}
Assert(false, ExcInternalError());
- return TableIndices<4>();
+ return {};
}
{
case 1:
{
- return TableIndices<2>(0, 0);
+ return {0, 0};
}
case 2:
default:
if (i < dim)
- return TableIndices<2>(i, i);
+ return {i, i};
for (unsigned int d = 0, c = 0; d < dim; ++d)
for (unsigned int e = d + 1; e < dim; ++e, ++c)
if (c == i)
- return TableIndices<2>(d, e);
+ return {d, e};
// should never get here:
Assert(false, ExcInternalError());
- return TableIndices<2>(0, 0);
+ return {0, 0};
}
}
Assert(n < 1, ExcIndexRange(n, 0, 1));
(void)n;
- const double array[1] = {t[0]};
- return dealii::SymmetricTensor<2, 1>(array);
+ return {{t[0]}};
}
{
case 0:
{
- const double array[3] = {t[0], 0, t[1] / 2};
- return dealii::SymmetricTensor<2, 2>(array);
+ return {{t[0], 0, t[1] / 2}};
}
case 1:
{
- const double array[3] = {0, t[1], t[0] / 2};
- return dealii::SymmetricTensor<2, 2>(array);
+ return {{0, t[1], t[0] / 2}};
}
default:
{
Assert(false, ExcIndexRange(n, 0, 2));
- return dealii::SymmetricTensor<2, 2>();
+ return {};
}
}
}
{
case 0:
{
- const double array[6] = {t[0], 0, 0, t[1] / 2, t[2] / 2, 0};
- return dealii::SymmetricTensor<2, 3>(array);
+ return {{t[0], 0, 0, t[1] / 2, t[2] / 2, 0}};
}
case 1:
{
- const double array[6] = {0, t[1], 0, t[0] / 2, 0, t[2] / 2};
- return dealii::SymmetricTensor<2, 3>(array);
+ return {{0, t[1], 0, t[0] / 2, 0, t[2] / 2}};
}
case 2:
{
- const double array[6] = {0, 0, t[2], 0, t[0] / 2, t[1] / 2};
- return dealii::SymmetricTensor<2, 3>(array);
+ return {{0, 0, t[2], 0, t[0] / 2, t[1] / 2}};
}
default:
{
Assert(false, ExcIndexRange(n, 0, 3));
- return dealii::SymmetricTensor<2, 3>();
+ return {};
}
}
}
inline RefinementCase<0>
TriaAccessor<0, dim, spacedim>::refinement_case()
{
- return RefinementCase<0>(RefinementPossibilities<0>::no_refinement);
+ return {RefinementPossibilities<0>::no_refinement};
}
inline RefinementCase<0>
TriaAccessor<0, 1, spacedim>::refinement_case()
{
- return RefinementCase<0>(RefinementPossibilities<0>::no_refinement);
+ return {RefinementPossibilities<0>::no_refinement};
}
template <int spacedim>
while (i < start_indices[block])
--block;
- return std::pair<unsigned int, size_type>(block, i - start_indices[block]);
+ return {block, i - start_indices[block]};
}
inline ChunkSparsityPattern::iterator
ChunkSparsityPattern::begin() const
{
- return iterator(this, 0);
+ return {this, 0};
}
inline ChunkSparsityPattern::iterator
ChunkSparsityPattern::end() const
{
- return iterator(this, n_rows());
+ return {this, n_rows()};
}
ChunkSparsityPattern::begin(const unsigned int r) const
{
Assert(r < n_rows(), ExcIndexRange(r, 0, n_rows()));
- return iterator(this, r);
+ return {this, r};
}
inline ChunkSparsityPattern::iterator
ChunkSparsityPattern::end(const unsigned int r) const
{
- Assert(r < n_rows(), ExcIndexRange(r, 0, n_rows())) return iterator(this,
- r + 1);
+ Assert(r < n_rows(), ExcIndexRange(r, 0, n_rows()));
+ return {this, r + 1};
}
inline DynamicSparsityPattern::iterator
DynamicSparsityPattern::end() const
{
- return iterator(this);
+ return {this};
}
Assert(r < n_rows(), ExcIndexRangeType<size_type>(r, 0, n_rows()));
if (!have_entries)
- return iterator(this);
+ return {this};
if (rowset.size() > 0)
{
if (it == rowset.end())
return end();
else
- return iterator(this, *it, 0);
+ return {this, *it, 0};
}
// Without an index set we have to do a linear search starting at
}
if (row == n_rows())
- return iterator(this);
+ return {this};
else
- return iterator(this, row, 0);
+ return {this, row, 0};
}
unsigned int row = r + 1;
if (row == n_rows())
- return iterator(this);
+ return {this};
else
return begin(row);
}
inline EmptyPayload
operator+(const EmptyPayload &, const EmptyPayload &)
{
- return EmptyPayload();
+ return {};
}
/**
*/
inline EmptyPayload operator*(const EmptyPayload &, const EmptyPayload &)
{
- return EmptyPayload();
+ return {};
}
SparsityPattern::begin() const
{
if (n_rows() > 0)
- return iterator(this, rowstart[0]);
+ return {this, rowstart[0]};
else
return end();
}
SparsityPattern::end() const
{
if (n_rows() > 0)
- return iterator(this, rowstart[rows]);
+ return {this, rowstart[rows]};
else
- return iterator(nullptr, 0);
+ return {nullptr, 0};
}
{
Assert(r < n_rows(), ExcIndexRangeType<size_type>(r, 0, n_rows()));
- return iterator(this, rowstart[r]);
+ return {this, rowstart[r]};
}
{
Assert(r < n_rows(), ExcIndexRangeType<size_type>(r, 0, n_rows()));
- return iterator(this, rowstart[r + 1]);
+ return {this, rowstart[r + 1]};
}
Accessor<false>::value() const
{
Assert(a_row < matrix->m(), ExcBeyondEndOfMatrix());
- return Reference(*this);
+ return {*this};
}
if (dof_info[dof_handler_component].fe_index_conversion[0][0] == degree)
return range;
else
- return std::pair<unsigned int, unsigned int>(range.second,
- range.second);
+ return {range.second, range.second};
}
const unsigned int fe_index =
dof_info[dof_handler_component].fe_index_from_degree(0, degree);
if (fe_index >= dof_info[dof_handler_component].max_fe_index)
- return std::pair<unsigned int, unsigned int>(range.second, range.second);
+ return {range.second, range.second};
else
return create_cell_subrange_hp_by_index(range,
fe_index,
}
else
{
- return XDMFEntry();
+ return {};
}
}
const unsigned int /*component*/) const
{
Assert(false, ExcNotImplemented());
- return Tensor<1, 2>();
+ return {};
}
Group
Group::open_group(const std::string &name) const
{
- return Group(name, *this, mpi, GroupAccessMode::open);
+ return {name, *this, mpi, GroupAccessMode::open};
}
Group
Group::create_group(const std::string &name) const
{
- return Group(name, *this, mpi, GroupAccessMode::create);
+ return {name, *this, mpi, GroupAccessMode::create};
}
DataSet
Group::open_dataset(const std::string &name) const
{
- return DataSet(name, *hdf5_reference, mpi);
+ return {name, *hdf5_reference, mpi};
}
const std::vector<hsize_t> &dimensions) const
{
std::shared_ptr<hid_t> t_type = internal::get_hdf5_datatype<number>();
- return DataSet(name, *hdf5_reference, dimensions, t_type, mpi);
+ return {name, *hdf5_reference, dimensions, t_type, mpi};
}
// multigrid is not currently implemented for shared triangulations
Assert(false, ExcNotImplemented());
- return NumberCache();
+ return {};
}
// if we get a block mask that represents all blocks, then
// do the same for the returned component mask
if (block_mask.represents_the_all_selected_mask())
- return ComponentMask();
+ return {};
AssertDimension(block_mask.size(), this->n_blocks());
// if we get a component mask that represents all component, then
// do the same for the returned block mask
if (component_mask.represents_the_all_selected_mask())
- return BlockMask();
+ return {};
AssertDimension(component_mask.size(), this->n_components());
switch (dim)
{
case 1:
- return TableIndices<2>(0U, 0U);
+ return {0U, 0U};
case 2:
- return TableIndices<2>(this->dofs_per_vertex + 2 * this->dofs_per_line,
- this->dofs_per_face);
+ return {this->dofs_per_vertex + 2 * this->dofs_per_line,
+ this->dofs_per_face};
case 3:
- return TableIndices<2>(5 * this->dofs_per_vertex +
- 12 * this->dofs_per_line +
- 4 * this->dofs_per_quad,
- this->dofs_per_face);
+ return {5 * this->dofs_per_vertex + 12 * this->dofs_per_line +
+ 4 * this->dofs_per_quad,
+ this->dofs_per_face};
default:
Assert(false, ExcNotImplemented());
}
- return TableIndices<2>(numbers::invalid_unsigned_int,
- numbers::invalid_unsigned_int);
+ return {numbers::invalid_unsigned_int, numbers::invalid_unsigned_int};
}
if (std::abs(xi_denominator0) > 1e-10 * max_x)
{
const double xi = (x + subexpr0) / xi_denominator0;
- return Point<2>(xi, eta);
+ return {xi, static_cast<double>(eta)};
}
else
{
if (std::abs(xi_denominator1) > 1e-10 * max_y)
{
const double xi = (subexpr1 + y) / xi_denominator1;
- return Point<2>(xi, eta);
+ return {xi, static_cast<double>(eta)};
}
else // give up and try Newton iteration
{
// bogus return to placate compiler. It should not be possible to get
// here.
Assert(false, ExcInternalError());
- return Point<2>(std::numeric_limits<double>::quiet_NaN(),
- std::numeric_limits<double>::quiet_NaN());
+ return {std::numeric_limits<double>::quiet_NaN(),
+ std::numeric_limits<double>::quiet_NaN()};
}
const Point<1> &) const
{
Assert(false, ExcNotImplemented());
- return Point<1>();
+ return {};
}
Point<2>
operator()(const Point<2> &p) const
{
- return Point<2>(std::cos(angle) * p(0) - std::sin(angle) * p(1),
- std::sin(angle) * p(0) + std::cos(angle) * p(1));
+ return {std::cos(angle) * p(0) - std::sin(angle) * p(1),
+ std::sin(angle) * p(0) + std::cos(angle) * p(1)};
}
private:
operator()(const Point<3> &p) const
{
if (axis == 0)
- return Point<3>(p(0),
- std::cos(angle) * p(1) - std::sin(angle) * p(2),
- std::sin(angle) * p(1) + std::cos(angle) * p(2));
+ return {p(0),
+ std::cos(angle) * p(1) - std::sin(angle) * p(2),
+ std::sin(angle) * p(1) + std::cos(angle) * p(2)};
else if (axis == 1)
- return Point<3>(std::cos(angle) * p(0) + std::sin(angle) * p(2),
- p(1),
- -std::sin(angle) * p(0) + std::cos(angle) * p(2));
+ return {std::cos(angle) * p(0) + std::sin(angle) * p(2),
+ p(1),
+ -std::sin(angle) * p(0) + std::cos(angle) * p(2)};
else
- return Point<3>(std::cos(angle) * p(0) - std::sin(angle) * p(1),
- std::sin(angle) * p(0) + std::cos(angle) * p(1),
- p(2));
+ return {std::cos(angle) * p(0) - std::sin(angle) * p(1),
+ std::sin(angle) * p(0) + std::cos(angle) * p(1),
+ p(2)};
}
private:
const Triangulation<1, 1>::face_iterator &) const
{
Assert(false, ExcImpossibleInDim(1));
- return Point<1>();
+ return {};
}
const Triangulation<1, 2>::face_iterator &) const
{
Assert(false, ExcImpossibleInDim(1));
- return Point<2>();
+ return {};
}
const Triangulation<1, 3>::face_iterator &) const
{
Assert(false, ExcImpossibleInDim(1));
- return Point<3>();
+ return {};
}
const Triangulation<1, 1>::quad_iterator &) const
{
Assert(false, ExcImpossibleInDim(1));
- return Point<1>();
+ return {};
}
const Triangulation<1, 2>::quad_iterator &) const
{
Assert(false, ExcImpossibleInDim(1));
- return Point<2>();
+ return {};
}
const Triangulation<1, 3>::quad_iterator &) const
{
Assert(false, ExcImpossibleInDim(1));
- return Point<3>();
+ return {};
}
// the implementation below is bogus for this case anyway
// (see the assert at the beginning of that function).
Assert(false, ExcNotImplemented());
- return Tensor<1, 3>();
+ return {};
}
const Point<1> &) const
{
Assert(false, ExcNotImplemented());
- return Tensor<1, 1>();
+ return {};
}
const Point<2> &) const
{
Assert(false, ExcNotImplemented());
- return Tensor<1, 2>();
+ return {};
}
const Point<3> &) const
{
Assert(false, ExcNotImplemented());
- return Tensor<1, 3>();
+ return {};
}
}
const double eta = std::acos(cos_eta);
const double pt1 = (std::signbit(y) ? 2.0 * numbers::PI - eta : eta);
- return Point<2>(pt0, pt1);
+ return {pt0, pt1};
}
const Point<spacedim> &) const
{
Assert(false, ExcNotImplemented());
- return DerivativeForm<1, spacedim, spacedim>();
+ return {};
}
double w = std::sqrt(std::pow(y - std::sin(phi) * R, 2.0) +
std::pow(x - std::cos(phi) * R, 2.0) + z * z) /
r;
- return Point<3>(phi, theta, w);
+ return {phi, theta, w};
}
double theta = chart_point(1);
double w = chart_point(2);
- return Point<3>(std::cos(phi) * R + r * w * std::cos(theta) * std::cos(phi),
- r * w * std::sin(theta),
- std::sin(phi) * R + r * w * std::cos(theta) * std::sin(phi));
+ return {std::cos(phi) * R + r * w * std::cos(theta) * std::cos(phi),
+ r * w * std::sin(theta),
+ std::sin(phi) * R + r * w * std::cos(theta) * std::sin(phi)};
}
t9 * y[1] - t11 * y[0] + x[0] * t53 - t59 * x[2] +
t59 * x[1] - t39 * x[0];
- return Point<2>(t27 * t37 / 3, t63 * t37 / 3);
+ return {t27 * t37 / 3, t63 * t37 / 3};
}
s2 = s3 * s4;
const double unknown2 = s1 * s2;
- return Point<3>(unknown0, unknown1, unknown2);
+ return {unknown0, unknown1, unknown2};
}
Assert(ptr.level() == 0, ExcInternalError());
const unsigned int coarse_index = ptr.index();
- return CellId(coarse_index, n_child_indices, id.data());
+ return {coarse_index, n_child_indices, id.data()};
}
double u = proj_params.X();
double v = proj_params.Y();
- return Point<2>(u, v);
+ return {u, v};
}
template <int dim, int spacedim>