inline typename ArrayView<ElementType, MemorySpaceType>::value_type &
ArrayView<ElementType, MemorySpaceType>::operator[](const std::size_t i) const
{
- Assert(i < n_elements, ExcIndexRange(i, 0, n_elements));
+ AssertIndexRange(i, n_elements);
Assert(
(std::is_same<MemorySpaceType, MemorySpace::Host>::value),
ExcMessage(
inline Tensor<order, dim, Number> &
DerivativeForm<order, dim, spacedim, Number>::operator[](const unsigned int i)
{
- Assert(i < spacedim, ExcIndexRange(i, 0, spacedim));
+ AssertIndexRange(i, spacedim);
return tensor[i];
}
DerivativeForm<order, dim, spacedim, Number>::
operator[](const unsigned int i) const
{
- Assert(i < spacedim, ExcIndexRange(i, 0, spacedim));
+ AssertIndexRange(i, spacedim);
return tensor[i];
}
const Point<dim> &,
const unsigned int component) const
{
- Assert(component < this->n_components,
- ExcIndexRange(component, 0, this->n_components));
+ AssertIndexRange(component, this->n_components);
return function_value_vector[component];
}
{
// To avoid warning of unused parameter
(void)points;
- Assert(component < this->n_components,
- ExcIndexRange(component, 0, this->n_components));
+ AssertIndexRange(component, this->n_components);
Assert(return_values.size() == points.size(),
ExcDimensionMismatch(return_values.size(), points.size()))
: ConstantFunction<dim, RangeNumberType>(1., n_components)
, selected_components(std::make_pair(selected, selected + 1))
{
- Assert(selected < n_components, ExcIndexRange(selected, 0, n_components));
+ AssertIndexRange(selected, n_components);
}
, function_object(function_object)
, selected_component(selected_component)
{
- Assert(selected_component < this->n_components,
- ExcIndexRange(selected_component, 0, this->n_components));
+ AssertIndexRange(selected_component, this->n_components);
}
const Point<dim> & p,
const unsigned int component) const
{
- Assert(component < this->n_components,
- ExcIndexRange(component, 0, this->n_components));
+ AssertIndexRange(component, this->n_components);
if (component == selected_component)
return function_object(p);
{
// Verify that the Tensor<1,dim,RangeNumberType> will fit in the given length
// selected_components and not hang over the end of the vector.
- Assert(selected_component + dim - 1 < this->n_components,
- ExcIndexRange(selected_component, 0, this->n_components));
+ AssertIndexRange(selected_component + dim - 1, this->n_components);
}
const Point<dim> & p,
const unsigned int component) const
{
- Assert(component < this->n_components,
- ExcIndexRange(component, 0, this->n_components));
+ AssertIndexRange(component, this->n_components);
// if the requested component is out of the range selected, then we can
// return early
inline RefinementCase<1>
RefinementCase<1>::cut_axis(const unsigned int i)
{
- Assert(i < 1, ExcIndexRange(i, 0, 1));
+ AssertIndexRange(i, 1);
const RefinementCase options[1] = {RefinementPossibilities<1>::cut_x};
return options[i];
inline RefinementCase<2>
RefinementCase<2>::cut_axis(const unsigned int i)
{
- Assert(i < 2, ExcIndexRange(i, 0, 2));
+ AssertIndexRange(i, 2);
const RefinementCase options[2] = {RefinementPossibilities<2>::cut_x,
RefinementPossibilities<2>::cut_y};
inline RefinementCase<3>
RefinementCase<3>::cut_axis(const unsigned int i)
{
- Assert(i < 3, ExcIndexRange(i, 0, 3));
+ AssertIndexRange(i, 3);
const RefinementCase options[3] = {RefinementPossibilities<3>::cut_x,
RefinementPossibilities<3>::cut_y,
inline Point<1>
GeometryInfo<1>::unit_cell_vertex(const unsigned int vertex)
{
- Assert(vertex < vertices_per_cell,
- ExcIndexRange(vertex, 0, vertices_per_cell));
+ AssertIndexRange(vertex, vertices_per_cell);
return Point<1>(static_cast<double>(vertex));
}
inline Point<2>
GeometryInfo<2>::unit_cell_vertex(const unsigned int vertex)
{
- Assert(vertex < vertices_per_cell,
- ExcIndexRange(vertex, 0, vertices_per_cell));
+ AssertIndexRange(vertex, vertices_per_cell);
return {static_cast<double>(vertex % 2), static_cast<double>(vertex / 2)};
}
inline Point<3>
GeometryInfo<3>::unit_cell_vertex(const unsigned int vertex)
{
- Assert(vertex < vertices_per_cell,
- ExcIndexRange(vertex, 0, vertices_per_cell));
+ AssertIndexRange(vertex, vertices_per_cell);
return {static_cast<double>(vertex % 2),
static_cast<double>(vertex / 2 % 2),
const RefinementCase<1> refine_case)
{
- Assert(child_index < 2, ExcIndexRange(child_index, 0, 2));
+ AssertIndexRange(child_index, 2);
Assert(refine_case == RefinementCase<1>::cut_x, ExcInternalError());
(void)refine_case; // removes -Wunused-parameter warning in optimized mode
const RefinementCase<2> refine_case)
{
- Assert(child_index < GeometryInfo<2>::n_children(refine_case),
- ExcIndexRange(child_index,
- 0,
- GeometryInfo<2>::n_children(refine_case)));
+ AssertIndexRange(child_index, GeometryInfo<2>::n_children(refine_case));
Point<2> point = p;
switch (refine_case)
const RefinementCase<3> refine_case)
{
- Assert(child_index < GeometryInfo<3>::n_children(refine_case),
- ExcIndexRange(child_index,
- 0,
- GeometryInfo<3>::n_children(refine_case)));
+ AssertIndexRange(child_index, GeometryInfo<3>::n_children(refine_case));
Point<3> point = p;
// there might be a cleverer way to do
const RefinementCase<1> refine_case)
{
- Assert(child_index < 2, ExcIndexRange(child_index, 0, 2));
+ AssertIndexRange(child_index, 2);
Assert(refine_case == RefinementCase<1>::cut_x, ExcInternalError());
(void)refine_case; // removes -Wunused-parameter warning in optimized mode
const RefinementCase<3> refine_case)
{
- Assert(child_index < GeometryInfo<3>::n_children(refine_case),
- ExcIndexRange(child_index,
- 0,
- GeometryInfo<3>::n_children(refine_case)));
+ AssertIndexRange(child_index, GeometryInfo<3>::n_children(refine_case));
Point<3> point = p;
// there might be a cleverer way to do
const unsigned int child_index,
const RefinementCase<2> refine_case)
{
- Assert(child_index < GeometryInfo<2>::n_children(refine_case),
- ExcIndexRange(child_index,
- 0,
- GeometryInfo<2>::n_children(refine_case)));
+ AssertIndexRange(child_index, GeometryInfo<2>::n_children(refine_case));
Point<2> point = p;
switch (refine_case)
const unsigned int vertex)
{
(void)line;
- Assert(line < lines_per_cell, ExcIndexRange(line, 0, lines_per_cell));
- Assert(vertex < 2, ExcIndexRange(vertex, 0, 2));
+ AssertIndexRange(line, lines_per_cell);
+ AssertIndexRange(vertex, 2);
return vertex;
}
GeometryInfo<3>::line_to_cell_vertices(const unsigned int line,
const unsigned int vertex)
{
- Assert(line < lines_per_cell, ExcIndexRange(line, 0, lines_per_cell));
- Assert(vertex < 2, ExcIndexRange(vertex, 0, 2));
+ AssertIndexRange(line, lines_per_cell);
+ AssertIndexRange(vertex, 2);
constexpr unsigned vertices[lines_per_cell][2] = {{0, 2}, // bottom face
{1, 3},
const bool face_flip,
const bool face_rotation)
{
- Assert(vertex < GeometryInfo<3>::vertices_per_face,
- ExcIndexRange(vertex, 0, GeometryInfo<3>::vertices_per_face));
+ AssertIndexRange(vertex, GeometryInfo<3>::vertices_per_face);
// set up a table to make sure that
// we handle non-standard faces correctly
const bool)
{
Assert(dim > 1, ExcImpossibleInDim(dim));
- Assert(vertex < GeometryInfo<dim>::vertices_per_face,
- ExcIndexRange(vertex, 0, GeometryInfo<dim>::vertices_per_face));
+ AssertIndexRange(vertex, GeometryInfo<dim>::vertices_per_face);
return vertex;
}
const bool)
{
const unsigned int dim = 2;
- Assert(cell_refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(cell_refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
- Assert(face_no < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_no, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(cell_refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
+ AssertIndexRange(face_no, GeometryInfo<dim>::faces_per_cell);
const RefinementCase<dim - 1>
ref_cases[RefinementCase<dim>::isotropic_refinement +
const bool face_rotation)
{
const unsigned int dim = 3;
- Assert(cell_refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(cell_refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
- Assert(face_no < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_no, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(cell_refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
+ AssertIndexRange(face_no, GeometryInfo<dim>::faces_per_cell);
const RefinementCase<dim - 1>
ref_cases[RefinementCase<dim>::isotropic_refinement + 1]
(void)line_no;
const unsigned int dim = 1;
(void)dim;
- Assert(cell_refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(cell_refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
- Assert(line_no < GeometryInfo<dim>::lines_per_cell,
- ExcIndexRange(line_no, 0, GeometryInfo<dim>::lines_per_cell));
+ AssertIndexRange(cell_refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
+ AssertIndexRange(line_no, GeometryInfo<dim>::lines_per_cell);
return cell_refinement_case;
}
const unsigned int line_no)
{
const unsigned int dim = 3;
- Assert(cell_refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(cell_refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
- Assert(line_no < GeometryInfo<dim>::lines_per_cell,
- ExcIndexRange(line_no, 0, GeometryInfo<dim>::lines_per_cell));
+ AssertIndexRange(cell_refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
+ AssertIndexRange(line_no, GeometryInfo<dim>::lines_per_cell);
// array indicating, which simple refine
// case cuts a line in direction x, y or
const bool)
{
const unsigned int dim = 2;
- Assert(face_refinement_case <
- RefinementCase<dim - 1>::isotropic_refinement + 1,
- ExcIndexRange(face_refinement_case,
- 0,
- RefinementCase<dim - 1>::isotropic_refinement + 1));
- Assert(face_no < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_no, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(face_refinement_case,
+ RefinementCase<dim - 1>::isotropic_refinement + 1);
+ AssertIndexRange(face_no, GeometryInfo<dim>::faces_per_cell);
if (face_refinement_case == RefinementCase<dim>::cut_x)
return (face_no / 2) ? RefinementCase<dim>::cut_x :
const bool face_rotation)
{
const unsigned int dim = 3;
- Assert(face_refinement_case <
- RefinementCase<dim - 1>::isotropic_refinement + 1,
- ExcIndexRange(face_refinement_case,
- 0,
- RefinementCase<dim - 1>::isotropic_refinement + 1));
- Assert(face_no < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_no, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(face_refinement_case,
+ RefinementCase<dim - 1>::isotropic_refinement + 1);
+ AssertIndexRange(face_no, GeometryInfo<dim>::faces_per_cell);
const RefinementCase<2> flip[4] = {RefinementCase<2>::no_refinement,
RefinementCase<2>::cut_y,
const unsigned int line_no)
{
(void)line_no;
- Assert(line_no == 0, ExcIndexRange(line_no, 0, 1));
+ AssertIndexRange(line_no, 1);
return RefinementCase<1>::cut_x;
}
{
const unsigned int dim = 2;
(void)dim;
- Assert(line_no < GeometryInfo<dim>::lines_per_cell,
- ExcIndexRange(line_no, 0, GeometryInfo<dim>::lines_per_cell));
+ AssertIndexRange(line_no, GeometryInfo<dim>::lines_per_cell);
return (line_no / 2) ? RefinementCase<2>::cut_x : RefinementCase<2>::cut_y;
}
const unsigned int line_no)
{
const unsigned int dim = 3;
- Assert(line_no < GeometryInfo<dim>::lines_per_cell,
- ExcIndexRange(line_no, 0, GeometryInfo<dim>::lines_per_cell));
+ AssertIndexRange(line_no, GeometryInfo<dim>::lines_per_cell);
const RefinementCase<dim> ref_cases[6] = {
RefinementCase<dim>::cut_y, // lines 0 and 1
const bool face_flip,
const bool face_rotation)
{
- Assert(vertex < GeometryInfo<3>::vertices_per_face,
- ExcIndexRange(vertex, 0, GeometryInfo<3>::vertices_per_face));
+ AssertIndexRange(vertex, GeometryInfo<3>::vertices_per_face);
// set up a table to make sure that
// we handle non-standard faces correctly
const bool)
{
Assert(dim > 1, ExcImpossibleInDim(dim));
- Assert(vertex < GeometryInfo<dim>::vertices_per_face,
- ExcIndexRange(vertex, 0, GeometryInfo<dim>::vertices_per_face));
+ AssertIndexRange(vertex, GeometryInfo<dim>::vertices_per_face);
return vertex;
}
const bool face_flip,
const bool face_rotation)
{
- Assert(line < GeometryInfo<3>::lines_per_face,
- ExcIndexRange(line, 0, GeometryInfo<3>::lines_per_face));
+ AssertIndexRange(line, GeometryInfo<3>::lines_per_face);
// make sure we handle
const bool face_flip,
const bool face_rotation)
{
- Assert(line < GeometryInfo<3>::lines_per_face,
- ExcIndexRange(line, 0, GeometryInfo<3>::lines_per_face));
+ AssertIndexRange(line, GeometryInfo<3>::lines_per_face);
// make sure we handle
const RefinementCase<0> &)
{
(void)subface;
- Assert(face < faces_per_cell, ExcIndexRange(face, 0, faces_per_cell));
- Assert(subface < max_children_per_face,
- ExcIndexRange(subface, 0, max_children_per_face));
+ AssertIndexRange(face, faces_per_cell);
+ AssertIndexRange(subface, max_children_per_face);
return face;
}
const bool /*face_rotation*/,
const RefinementCase<1> &)
{
- Assert(face < faces_per_cell, ExcIndexRange(face, 0, faces_per_cell));
- Assert(subface < max_children_per_face,
- ExcIndexRange(subface, 0, max_children_per_face));
+ AssertIndexRange(face, faces_per_cell);
+ AssertIndexRange(subface, max_children_per_face);
// always return the child adjacent to the specified
// subface. if the face of a cell is not refined, don't
Assert(ref_case > RefinementCase<dim - 1>::no_refinement,
ExcMessage("Cell has no children."));
- Assert(face < faces_per_cell, ExcIndexRange(face, 0, faces_per_cell));
- Assert(subface < GeometryInfo<dim - 1>::n_children(face_ref_case) ||
- (subface == 0 &&
- face_ref_case == RefinementCase<dim - 1>::no_refinement),
- ExcIndexRange(subface, 0, GeometryInfo<2>::n_children(face_ref_case)));
+ AssertIndexRange(face, faces_per_cell);
+ if (!(subface == 0 &&
+ face_ref_case == RefinementCase<dim - 1>::no_refinement))
+ {
+ AssertIndexRange(subface,
+ GeometryInfo<dim - 1>::n_children(face_ref_case));
+ }
// invalid number used for invalid cases,
// e.g. when the children are more refined at
const bool)
{
(void)line;
- Assert(face < faces_per_cell, ExcIndexRange(face, 0, faces_per_cell));
- Assert(line < lines_per_face, ExcIndexRange(line, 0, lines_per_face));
+ AssertIndexRange(face, faces_per_cell);
+ AssertIndexRange(line, lines_per_face);
// The face is a line itself.
return face;
const bool face_flip,
const bool face_rotation)
{
- Assert(face < faces_per_cell, ExcIndexRange(face, 0, faces_per_cell));
- Assert(line < lines_per_face, ExcIndexRange(line, 0, lines_per_face));
+ AssertIndexRange(face, faces_per_cell);
+ AssertIndexRange(line, lines_per_face);
const unsigned lines[faces_per_cell][lines_per_face] = {
{8, 10, 0, 4}, // left face
GeometryInfo<dim>::d_linear_shape_function(const Point<dim> & xi,
const unsigned int i)
{
- Assert(i < GeometryInfo<dim>::vertices_per_cell,
- ExcIndexRange(i, 0, GeometryInfo<dim>::vertices_per_cell));
+ AssertIndexRange(i, GeometryInfo<dim>::vertices_per_cell);
switch (dim)
{
const Point<1> &,
const unsigned int i)
{
- Assert(i < GeometryInfo<1>::vertices_per_cell,
- ExcIndexRange(i, 0, GeometryInfo<1>::vertices_per_cell));
+ AssertIndexRange(i, GeometryInfo<1>::vertices_per_cell);
switch (i)
{
const Point<2> & xi,
const unsigned int i)
{
- Assert(i < GeometryInfo<2>::vertices_per_cell,
- ExcIndexRange(i, 0, GeometryInfo<2>::vertices_per_cell));
+ AssertIndexRange(i, GeometryInfo<2>::vertices_per_cell);
const double x = xi[0];
const double y = xi[1];
const Point<3> & xi,
const unsigned int i)
{
- Assert(i < GeometryInfo<3>::vertices_per_cell,
- ExcIndexRange(i, 0, GeometryInfo<3>::vertices_per_cell));
+ AssertIndexRange(i, GeometryInfo<3>::vertices_per_cell);
const double x = xi[0];
const double y = xi[1];
IndexSet::at(const size_type global_index) const
{
compress();
- Assert(global_index < size(),
- ExcIndexRangeType<size_type>(global_index, 0, size()));
+ AssertIndexRange(global_index, size());
if (ranges.empty())
return end();
inline void
IndexSet::add_index(const size_type index)
{
- Assert(index < index_space_size,
- ExcIndexRangeType<size_type>(index, 0, index_space_size));
+ AssertIndexRange(index, index_space_size);
const Range new_range(index, index + 1);
if (ranges.size() == 0 || index > ranges.back().end)
ExcIndexRangeType<size_type>(begin, 0, index_space_size));
Assert(end <= index_space_size,
ExcIndexRangeType<size_type>(end, 0, index_space_size + 1));
- Assert(begin <= end, ExcIndexRangeType<size_type>(begin, 0, end));
+ AssertIndexRange(begin, end + 1);
if (begin != end)
{
inline IndexSet::size_type
IndexSet::nth_index_in_set(const size_type n) const
{
- Assert(n < n_elements(), ExcIndexRangeType<size_type>(n, 0, n_elements()));
+ AssertIndexRange(n, n_elements());
compress();
// to make this call thread-safe, compress() must not be called through this
// function
Assert(is_compressed == true, ExcMessage("IndexSet must be compressed."));
- Assert(n < size(), ExcIndexRangeType<size_type>(n, 0, size()));
+ AssertIndexRange(n, size());
// return immediately if the index set is empty
if (is_empty())
const auto n_procs = dealii::Utilities::MPI::n_mpi_processes(comm);
const auto my_rank = dealii::Utilities::MPI::this_mpi_process(comm);
- Assert(root_process < n_procs, ExcIndexRange(root_process, 0, n_procs));
+ AssertIndexRange(root_process, n_procs);
std::vector<char> buffer = Utilities::pack(object_to_send);
int n_local_data = buffer.size();
const unsigned int new_index,
const unsigned int position)
{
- Assert(position < 2, ExcIndexRange(position, 0, 2));
+ AssertIndexRange(position, 2);
if (position == 0)
return {new_index, numbers::invalid_unsigned_int};
const unsigned int new_index,
const unsigned int position)
{
- Assert(position < 4, ExcIndexRange(position, 0, 4));
+ AssertIndexRange(position, 4);
switch (position)
{
operator()(const TableIndices<rank_> &indices)
{
for (unsigned int r = 0; r < rank; ++r)
- Assert(indices[r] < dimension, ExcIndexRange(indices[r], 0, dimension));
+ AssertIndexRange(indices[r], dimension);
return internal::symmetric_tensor_access<dim, Number>(indices, data);
}
operator()(const TableIndices<rank_> &indices) const
{
for (unsigned int r = 0; r < rank; ++r)
- Assert(indices[r] < dimension, ExcIndexRange(indices[r], 0, dimension));
+ AssertIndexRange(indices[r], dimension);
return internal::symmetric_tensor_access<dim, Number>(indices, data);
}
DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE unsigned int
component_to_unrolled_index(const TableIndices<2> &indices)
{
- Assert(indices[0] < dim, ExcIndexRange(indices[0], 0, dim));
- Assert(indices[1] < dim, ExcIndexRange(indices[1], 0, dim));
+ AssertIndexRange(indices[0], dim);
+ AssertIndexRange(indices[1], dim);
switch (dim)
{
const double rotation_angle,
const unsigned int axis = 0)
{
- Assert(axis < 3, ExcIndexRange(axis, 0, 3));
+ AssertIndexRange(axis, 3);
Tensor<2, 3> R;
switch (axis)
inline Accessor<N, T, C, P - 1> Accessor<N, T, C, P>::
operator[](const size_type i) const
{
- Assert(i < table.size()[N - P], ExcIndexRange(i, 0, table.size()[N - P]));
+ AssertIndexRange(i, table.size()[N - P]);
// access i-th
// subobject. optimize on the
inline typename TableBase<N, T>::size_type
TableBase<N, T>::size(const unsigned int i) const
{
- Assert(i < N, ExcIndexRange(i, 0, N));
+ AssertIndexRange(i, N);
return table_size[i];
}
{
// We cannot use Assert in a CUDA kernel
#ifndef __CUDA_ARCH__
- Assert(i < dim, ExcIndexRange(i, 0, dim));
+ AssertIndexRange(i, dim);
#endif
return values[i];
}
DEAL_II_CONSTEXPR inline TableIndices<rank_>
Tensor<rank_, dim, Number>::unrolled_to_component_indices(const unsigned int i)
{
- Assert(i < n_independent_components,
- ExcIndexRange(i, 0, n_independent_components));
+ AssertIndexRange(i, n_independent_components);
TableIndices<rank_> indices;
: ArrayViewType(
make_array_view(std::begin(v) + start, std::begin(v) + start + length))
{
- Assert((start + length <= v.size()),
- ExcIndexRange(length, 0, v.size() - start + 1));
+ AssertIndexRange(length, v.size() - start + 1);
}
DEAL_II_NAMESPACE_CLOSE
const NumberType & value)
{
// Where possible, set values using TableIndices
- Assert(unrolled_index < t.n_independent_components,
- ExcIndexRange(unrolled_index, 0, t.n_independent_components));
+ AssertIndexRange(unrolled_index, t.n_independent_components);
t[TensorType::unrolled_to_component_indices(unrolled_index)] = value;
}
const unsigned int & unrolled_index,
const NumberType & value)
{
- Assert(unrolled_index == 0, ExcIndexRange(unrolled_index, 0, 1));
+ AssertIndexRange(unrolled_index, 1);
(void)unrolled_index;
t = value;
}
const unsigned int &unrolled_index,
const NumberType & value)
{
- Assert(unrolled_index == 0, ExcIndexRange(unrolled_index, 0, 1));
+ AssertIndexRange(unrolled_index, 1);
(void)unrolled_index;
t = value;
}
// Fourth order symmetric tensors require a specialized interface
// to extract values.
using SubTensorType = SymmetricTensor<2, dim, NumberType>;
- Assert(unrolled_index_row < SubTensorType::n_independent_components,
- ExcIndexRange(unrolled_index_row,
- 0,
- SubTensorType::n_independent_components));
- Assert(unrolled_index_col < SubTensorType::n_independent_components,
- ExcIndexRange(unrolled_index_col,
- 0,
- SubTensorType::n_independent_components));
+ AssertIndexRange(unrolled_index_row,
+ SubTensorType::n_independent_components);
+ AssertIndexRange(unrolled_index_col,
+ SubTensorType::n_independent_components);
const TableIndices<2> indices_row =
SubTensorType::unrolled_to_component_indices(unrolled_index_row);
const TableIndices<2> indices_col =
const unsigned int & unrolled_index)
{
// Where possible, get values using TableIndices
- Assert(unrolled_index < t.n_independent_components,
- ExcIndexRange(unrolled_index, 0, t.n_independent_components));
+ AssertIndexRange(unrolled_index, t.n_independent_components);
return t[TensorType<rank, dim, NumberType>::
unrolled_to_component_indices(unrolled_index)];
}
get_tensor_entry(const TensorType<0, dim, NumberType> &t,
const unsigned int & unrolled_index)
{
- Assert(unrolled_index == 0, ExcIndexRange(unrolled_index, 0, 1));
+ AssertIndexRange(unrolled_index, 1);
(void)unrolled_index;
return t;
}
inline const NumberType &
get_tensor_entry(const NumberType &t, const unsigned int &unrolled_index)
{
- Assert(unrolled_index == 0, ExcIndexRange(unrolled_index, 0, 1));
+ AssertIndexRange(unrolled_index, 1);
(void)unrolled_index;
return t;
}
const unsigned int & unrolled_index)
{
// Where possible, get values using TableIndices
- Assert(unrolled_index < t.n_independent_components,
- ExcIndexRange(unrolled_index, 0, t.n_independent_components));
+ AssertIndexRange(unrolled_index, t.n_independent_components);
return t[TensorType<rank, dim, NumberType>::
unrolled_to_component_indices(unrolled_index)];
}
NumberType &get_tensor_entry(TensorType<0, dim, NumberType> &t,
const unsigned int & index)
{
- Assert(index == 0, ExcIndexRange(index, 0, 1));
+ AssertIndexRange(index, 1);
(void)index;
return t;
}
inline NumberType &
get_tensor_entry(NumberType &t, const unsigned int &index)
{
- Assert(index == 0, ExcIndexRange(index, 0, 1));
+ AssertIndexRange(index, 1);
(void)index;
return t;
}
true)) == true,
ExcMessage("This cell is not active and therefore can't be "
"queried for its active FE indices"));
- Assert(n == 0, ExcIndexRange(n, 0, 1));
+ AssertIndexRange(n, 1);
return dealii::DoFHandler<dim, spacedim>::default_fe_index;
}
(fe_index == dealii::DoFHandler<dim, spacedim>::default_fe_index),
ExcMessage(
"Only the default FE index is allowed for non-hp DoFHandler objects"));
- Assert(local_index < dof_handler.get_fe().dofs_per_vertex,
- ExcIndexRange(local_index,
- 0,
- dof_handler.get_fe().dofs_per_vertex));
+ AssertIndexRange(local_index, dof_handler.get_fe().dofs_per_vertex);
dof_handler
.vertex_dofs[vertex_index * dof_handler.get_fe().dofs_per_vertex +
Assert(dof_handler.fe_collection.size() > 0,
ExcMessage("No finite element collection is associated with "
"this DoFHandler"));
- Assert(local_index < dof_handler.get_fe(fe_index).dofs_per_vertex,
- ExcIndexRange(local_index,
- 0,
- dof_handler.get_fe(fe_index).dofs_per_vertex));
+ AssertIndexRange(local_index,
+ dof_handler.get_fe(fe_index).dofs_per_vertex);
Assert(fe_index < dof_handler.fe_collection.size(), ExcInternalError());
Assert(dof_handler.vertex_dof_offsets[vertex_index] !=
numbers::invalid_unsigned_int,
(fe_index == dealii::DoFHandler<dim, spacedim>::default_fe_index),
ExcMessage(
"Only the default FE index is allowed for non-hp DoFHandler objects"));
- Assert(local_index < dof_handler.get_fe().dofs_per_vertex,
- ExcIndexRange(local_index,
- 0,
- dof_handler.get_fe().dofs_per_vertex));
+ AssertIndexRange(local_index, dof_handler.get_fe().dofs_per_vertex);
return dof_handler
.vertex_dofs[vertex_index * dof_handler.get_fe().dofs_per_vertex +
Assert(dof_handler.fe_collection.size() > 0,
ExcMessage("No finite element collection is associated with "
"this DoFHandler"));
- Assert(local_index < dof_handler.get_fe(fe_index).dofs_per_vertex,
- ExcIndexRange(local_index,
- 0,
- dof_handler.get_fe(fe_index).dofs_per_vertex));
- Assert(vertex_index < dof_handler.vertex_dof_offsets.size(),
- ExcIndexRange(vertex_index,
- 0,
- dof_handler.vertex_dof_offsets.size()));
+ AssertIndexRange(local_index,
+ dof_handler.get_fe(fe_index).dofs_per_vertex);
+ AssertIndexRange(vertex_index, dof_handler.vertex_dof_offsets.size());
Assert(dof_handler.vertex_dof_offsets[vertex_index] !=
numbers::invalid_unsigned_int,
ExcMessage(
{
(void)fe_index;
Assert(this->dof_handler != nullptr, ExcInvalidObject());
- Assert(vertex < GeometryInfo<structdim>::vertices_per_cell,
- ExcIndexRange(vertex, 0, GeometryInfo<structdim>::vertices_per_cell));
- Assert(i < this->dof_handler->get_fe(fe_index).dofs_per_vertex,
- ExcIndexRange(i,
- 0,
- this->dof_handler->get_fe(fe_index).dofs_per_vertex));
+ AssertIndexRange(vertex, GeometryInfo<structdim>::vertices_per_cell);
+ AssertIndexRange(i, this->dof_handler->get_fe(fe_index).dofs_per_vertex);
return dealii::internal::DoFAccessorImplementation::Implementation::
mg_vertex_dof_index(*this->dof_handler,
{
(void)fe_index;
Assert(this->dof_handler != nullptr, ExcInvalidObject());
- Assert(vertex < GeometryInfo<structdim>::vertices_per_cell,
- ExcIndexRange(vertex, 0, GeometryInfo<structdim>::vertices_per_cell));
- Assert(i < this->dof_handler->get_fe(fe_index).dofs_per_vertex,
- ExcIndexRange(i,
- 0,
- this->dof_handler->get_fe(fe_index).dofs_per_vertex));
+ AssertIndexRange(vertex, GeometryInfo<structdim>::vertices_per_cell);
+ AssertIndexRange(i, this->dof_handler->get_fe(fe_index).dofs_per_vertex);
return dealii::internal::DoFAccessorImplementation::Implementation::
set_mg_vertex_dof_index(
const unsigned int fe_index) const
{
(void)vertex;
- Assert(vertex == 0, ExcIndexRange(vertex, 0, 1));
+ AssertIndexRange(vertex, 1);
return dealii::internal::DoFAccessorImplementation::Implementation::
get_vertex_dof_index(*dof_handler, this->global_vertex_index, fe_index, i);
}
DoFCellAccessor<DoFHandlerType, level_dof_access>::face(
const unsigned int i) const
{
- Assert(i < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(i, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(i, GeometryInfo<dim>::faces_per_cell);
const unsigned int dim = DoFHandlerType::dimension;
return dealii::internal::DoFCellAccessorImplementation::get_face(
{
// otherwise check the validity of the index and
// return whatever is appropriate
- Assert(block_index < block_mask.size(),
- ExcIndexRange(block_index, 0, block_mask.size()));
+ AssertIndexRange(block_index, block_mask.size());
return block_mask[block_index];
}
}
FiniteElement<dim, spacedim>::system_to_component_index(
const unsigned int index) const
{
- Assert(index < system_to_component_table.size(),
- ExcIndexRange(index, 0, system_to_component_table.size()));
+ AssertIndexRange(index, system_to_component_table.size());
Assert(is_primitive(index),
(typename FiniteElement<dim, spacedim>::ExcShapeFunctionNotPrimitive(
index)));
FiniteElement<dim, spacedim>::face_system_to_component_index(
const unsigned int index) const
{
- Assert(index < face_system_to_component_table.size(),
- ExcIndexRange(index, 0, face_system_to_component_table.size()));
+ AssertIndexRange(index, face_system_to_component_table.size());
// in debug mode, check whether the
// function is primitive, since
FiniteElement<dim, spacedim>::system_to_base_index(
const unsigned int index) const
{
- Assert(index < system_to_base_table.size(),
- ExcIndexRange(index, 0, system_to_base_table.size()));
+ AssertIndexRange(index, system_to_base_table.size());
return system_to_base_table[index];
}
FiniteElement<dim, spacedim>::face_system_to_base_index(
const unsigned int index) const
{
- Assert(index < face_system_to_base_table.size(),
- ExcIndexRange(index, 0, face_system_to_base_table.size()));
+ AssertIndexRange(index, face_system_to_base_table.size());
return face_system_to_base_table[index];
}
FiniteElement<dim, spacedim>::component_to_base_index(
const unsigned int index) const
{
- Assert(index < component_to_base_table.size(),
- ExcIndexRange(index, 0, component_to_base_table.size()));
+ AssertIndexRange(index, component_to_base_table.size());
return component_to_base_table[index].first;
}
FiniteElement<dim, spacedim>::system_to_block_index(
const unsigned int index) const
{
- Assert(index < this->dofs_per_cell,
- ExcIndexRange(index, 0, this->dofs_per_cell));
+ AssertIndexRange(index, this->dofs_per_cell);
// The block is computed simply as
// first block of this base plus
// the index within the base blocks
FiniteElement<dim, spacedim>::restriction_is_additive(
const unsigned int index) const
{
- Assert(index < this->dofs_per_cell,
- ExcIndexRange(index, 0, this->dofs_per_cell));
+ AssertIndexRange(index, this->dofs_per_cell);
return restriction_is_additive_flags[index];
}
inline const ComponentMask &
FiniteElement<dim, spacedim>::get_nonzero_components(const unsigned int i) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
return nonzero_components[i];
}
inline unsigned int
FiniteElement<dim, spacedim>::n_nonzero_components(const unsigned int i) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
return n_nonzero_components_table[i];
}
inline bool
FiniteElement<dim, spacedim>::is_primitive(const unsigned int i) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
// return primitivity of a shape
// function by checking whether it
FiniteElement<dim, spacedim>::get_associated_geometry_primitive(
const unsigned int cell_dof_index) const
{
- Assert(cell_dof_index < this->dofs_per_cell,
- ExcIndexRange(cell_dof_index, 0, this->dofs_per_cell));
+ AssertIndexRange(cell_dof_index, this->dofs_per_cell);
// just go through the usual cases, taking into account how DoFs
// are enumerated on the reference cell
FE_Poly<PolynomialType, dim, spacedim>::shape_value(const unsigned int i,
const Point<dim> & p) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
return poly_space.compute_value(i, p);
}
const unsigned int component) const
{
(void)component;
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, 1);
return poly_space.compute_value(i, p);
}
FE_Poly<PolynomialType, dim, spacedim>::shape_grad(const unsigned int i,
const Point<dim> & p) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
return poly_space.template compute_derivative<1>(i, p);
}
const unsigned int component) const
{
(void)component;
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, 1);
return poly_space.template compute_derivative<1>(i, p);
}
const unsigned int i,
const Point<dim> & p) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
return poly_space.template compute_derivative<2>(i, p);
}
const unsigned int component) const
{
(void)component;
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, 1);
return poly_space.template compute_derivative<2>(i, p);
}
const unsigned int i,
const Point<dim> & p) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
return poly_space.template compute_derivative<3>(i, p);
}
const unsigned int component) const
{
(void)component;
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, 1);
return poly_space.template compute_derivative<3>(i, p);
}
const unsigned int i,
const Point<dim> & p) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
return poly_space.template compute_derivative<4>(i, p);
}
const unsigned int component) const
{
(void)component;
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, 1);
return poly_space.template compute_derivative<4>(i, p);
}
Scalar<dim, spacedim>::value(const unsigned int shape_function,
const unsigned int q_point) const
{
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(
fe_values->update_flags & update_values,
((typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
Scalar<dim, spacedim>::gradient(const unsigned int shape_function,
const unsigned int q_point) const
{
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_gradients")));
Scalar<dim, spacedim>::hessian(const unsigned int shape_function,
const unsigned int q_point) const
{
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_hessians,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_hessians")));
Scalar<dim, spacedim>::third_derivative(const unsigned int shape_function,
const unsigned int q_point) const
{
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_3rd_derivatives,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_3rd_derivatives")));
Vector<dim, spacedim>::value(const unsigned int shape_function,
const unsigned int q_point) const
{
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_values,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_values")));
Vector<dim, spacedim>::gradient(const unsigned int shape_function,
const unsigned int q_point) const
{
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_gradients")));
const unsigned int q_point) const
{
// this function works like in the case above
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_gradients")));
{
// this function works like in the case above
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_gradients")));
const unsigned int q_point) const
{
// this function works like in the case above
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_hessians,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_hessians")));
const unsigned int q_point) const
{
// this function works like in the case above
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_3rd_derivatives,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_3rd_derivatives")));
inline dealii::SymmetricTensor<2, 1>
symmetrize_single_row(const unsigned int n, const dealii::Tensor<1, 1> &t)
{
- Assert(n < 1, ExcIndexRange(n, 0, 1));
+ AssertIndexRange(n, 1);
(void)n;
return {{t[0]}};
}
default:
{
- Assert(false, ExcIndexRange(n, 0, 2));
+ AssertIndexRange(n, 2);
return {};
}
}
}
default:
{
- Assert(false, ExcIndexRange(n, 0, 3));
+ AssertIndexRange(n, 3);
return {};
}
}
Vector<dim, spacedim>::symmetric_gradient(const unsigned int shape_function,
const unsigned int q_point) const
{
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_gradients")));
SymmetricTensor<2, dim, spacedim>::value(const unsigned int shape_function,
const unsigned int q_point) const
{
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_values,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_values")));
const unsigned int shape_function,
const unsigned int q_point) const
{
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_gradients")));
Tensor<2, dim, spacedim>::value(const unsigned int shape_function,
const unsigned int q_point) const
{
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_values,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_values")));
Tensor<2, dim, spacedim>::divergence(const unsigned int shape_function,
const unsigned int q_point) const
{
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_gradients")));
Tensor<2, dim, spacedim>::gradient(const unsigned int shape_function,
const unsigned int q_point) const
{
- Assert(shape_function < fe_values->fe->dofs_per_cell,
- ExcIndexRange(shape_function, 0, fe_values->fe->dofs_per_cell));
+ AssertIndexRange(shape_function, fe_values->fe->dofs_per_cell);
Assert(fe_values->update_flags & update_gradients,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_gradients")));
inline const FEValuesViews::Scalar<dim, spacedim> &FEValuesBase<dim, spacedim>::
operator[](const FEValuesExtractors::Scalar &scalar) const
{
- Assert(scalar.component < fe_values_views_cache.scalars.size(),
- ExcIndexRange(scalar.component,
- 0,
- fe_values_views_cache.scalars.size()));
+ AssertIndexRange(scalar.component, fe_values_views_cache.scalars.size());
return fe_values_views_cache.scalars[scalar.component];
}
inline const FEValuesViews::Vector<dim, spacedim> &FEValuesBase<dim, spacedim>::
operator[](const FEValuesExtractors::Vector &vector) const
{
- Assert(vector.first_vector_component < fe_values_views_cache.vectors.size(),
- ExcIndexRange(vector.first_vector_component,
- 0,
- fe_values_views_cache.vectors.size()));
+ AssertIndexRange(vector.first_vector_component,
+ fe_values_views_cache.vectors.size());
return fe_values_views_cache.vectors[vector.first_vector_component];
}
FEValuesBase<dim, spacedim>::
operator[](const FEValuesExtractors::Tensor<2> &tensor) const
{
- Assert(tensor.first_tensor_component <
- fe_values_views_cache.second_order_tensors.size(),
- ExcIndexRange(tensor.first_tensor_component,
- 0,
- fe_values_views_cache.second_order_tensors.size()));
+ AssertIndexRange(tensor.first_tensor_component,
+ fe_values_views_cache.second_order_tensors.size());
return fe_values_views_cache
.second_order_tensors[tensor.first_tensor_component];
FEValuesBase<dim, spacedim>::shape_value(const unsigned int i,
const unsigned int j) const
{
- Assert(i < fe->dofs_per_cell, ExcIndexRange(i, 0, fe->dofs_per_cell));
+ AssertIndexRange(i, fe->dofs_per_cell);
Assert(this->update_flags & update_values,
ExcAccessToUninitializedField("update_values"));
Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
const unsigned int j,
const unsigned int component) const
{
- Assert(i < fe->dofs_per_cell, ExcIndexRange(i, 0, fe->dofs_per_cell));
+ AssertIndexRange(i, fe->dofs_per_cell);
Assert(this->update_flags & update_values,
ExcAccessToUninitializedField("update_values"));
- Assert(component < fe->n_components(),
- ExcIndexRange(component, 0, fe->n_components()));
+ AssertIndexRange(component, fe->n_components());
Assert(present_cell.get() != nullptr,
ExcMessage("FEValues object is not reinit'ed to any cell"));
FEValuesBase<dim, spacedim>::shape_grad(const unsigned int i,
const unsigned int j) const
{
- Assert(i < fe->dofs_per_cell, ExcIndexRange(i, 0, fe->dofs_per_cell));
+ AssertIndexRange(i, fe->dofs_per_cell);
Assert(this->update_flags & update_gradients,
ExcAccessToUninitializedField("update_gradients"));
Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
const unsigned int j,
const unsigned int component) const
{
- Assert(i < fe->dofs_per_cell, ExcIndexRange(i, 0, fe->dofs_per_cell));
+ AssertIndexRange(i, fe->dofs_per_cell);
Assert(this->update_flags & update_gradients,
ExcAccessToUninitializedField("update_gradients"));
- Assert(component < fe->n_components(),
- ExcIndexRange(component, 0, fe->n_components()));
+ AssertIndexRange(component, fe->n_components());
Assert(present_cell.get() != nullptr,
ExcMessage("FEValues object is not reinit'ed to any cell"));
// check whether the shape function
FEValuesBase<dim, spacedim>::shape_hessian(const unsigned int i,
const unsigned int j) const
{
- Assert(i < fe->dofs_per_cell, ExcIndexRange(i, 0, fe->dofs_per_cell));
+ AssertIndexRange(i, fe->dofs_per_cell);
Assert(this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
const unsigned int j,
const unsigned int component) const
{
- Assert(i < fe->dofs_per_cell, ExcIndexRange(i, 0, fe->dofs_per_cell));
+ AssertIndexRange(i, fe->dofs_per_cell);
Assert(this->update_flags & update_hessians,
ExcAccessToUninitializedField("update_hessians"));
- Assert(component < fe->n_components(),
- ExcIndexRange(component, 0, fe->n_components()));
+ AssertIndexRange(component, fe->n_components());
Assert(present_cell.get() != nullptr,
ExcMessage("FEValues object is not reinit'ed to any cell"));
// check whether the shape function
FEValuesBase<dim, spacedim>::shape_3rd_derivative(const unsigned int i,
const unsigned int j) const
{
- Assert(i < fe->dofs_per_cell, ExcIndexRange(i, 0, fe->dofs_per_cell));
+ AssertIndexRange(i, fe->dofs_per_cell);
Assert(this->update_flags & update_3rd_derivatives,
ExcAccessToUninitializedField("update_3rd_derivatives"));
Assert(fe->is_primitive(i), ExcShapeFunctionNotPrimitive(i));
const unsigned int j,
const unsigned int component) const
{
- Assert(i < fe->dofs_per_cell, ExcIndexRange(i, 0, fe->dofs_per_cell));
+ AssertIndexRange(i, fe->dofs_per_cell);
Assert(this->update_flags & update_3rd_derivatives,
ExcAccessToUninitializedField("update_3rd_derivatives"));
- Assert(component < fe->n_components(),
- ExcIndexRange(component, 0, fe->n_components()));
+ AssertIndexRange(component, fe->n_components());
Assert(present_cell.get() != nullptr,
ExcMessage("FEValues object is not reinit'ed to any cell"));
// check whether the shape function
{
Assert(this->update_flags & update_quadrature_points,
ExcAccessToUninitializedField("update_quadrature_points"));
- Assert(i < this->mapping_output.quadrature_points.size(),
- ExcIndexRange(i, 0, this->mapping_output.quadrature_points.size()));
+ AssertIndexRange(i, this->mapping_output.quadrature_points.size());
Assert(present_cell.get() != nullptr,
ExcMessage("FEValues object is not reinit'ed to any cell"));
{
Assert(this->update_flags & update_JxW_values,
ExcAccessToUninitializedField("update_JxW_values"));
- Assert(i < this->mapping_output.JxW_values.size(),
- ExcIndexRange(i, 0, this->mapping_output.JxW_values.size()));
+ AssertIndexRange(i, this->mapping_output.JxW_values.size());
Assert(present_cell.get() != nullptr,
ExcMessage("FEValues object is not reinit'ed to any cell"));
{
Assert(this->update_flags & update_jacobians,
ExcAccessToUninitializedField("update_jacobians"));
- Assert(i < this->mapping_output.jacobians.size(),
- ExcIndexRange(i, 0, this->mapping_output.jacobians.size()));
+ AssertIndexRange(i, this->mapping_output.jacobians.size());
Assert(present_cell.get() != nullptr,
ExcMessage("FEValues object is not reinit'ed to any cell"));
{
Assert(this->update_flags & update_jacobian_grads,
ExcAccessToUninitializedField("update_jacobians_grads"));
- Assert(i < this->mapping_output.jacobian_grads.size(),
- ExcIndexRange(i, 0, this->mapping_output.jacobian_grads.size()));
+ AssertIndexRange(i, this->mapping_output.jacobian_grads.size());
Assert(present_cell.get() != nullptr,
ExcMessage("FEValues object is not reinit'ed to any cell"));
{
Assert(this->update_flags & update_inverse_jacobians,
ExcAccessToUninitializedField("update_inverse_jacobians"));
- Assert(i < this->mapping_output.inverse_jacobians.size(),
- ExcIndexRange(i, 0, this->mapping_output.inverse_jacobians.size()));
+ AssertIndexRange(i, this->mapping_output.inverse_jacobians.size());
Assert(present_cell.get() != nullptr,
ExcMessage("FEValues object is not reinit'ed to any cell"));
Assert(this->update_flags & update_normal_vectors,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_normal_vectors")));
- Assert(i < this->mapping_output.normal_vectors.size(),
- ExcIndexRange(i, 0, this->mapping_output.normal_vectors.size()));
+ AssertIndexRange(i, this->mapping_output.normal_vectors.size());
Assert(present_cell.get() != nullptr,
ExcMessage("FEValues object is not reinit'ed to any cell"));
inline const Tensor<1, spacedim> &
FEFaceValuesBase<dim, spacedim>::boundary_form(const unsigned int i) const
{
- Assert(i < this->mapping_output.boundary_forms.size(),
- ExcIndexRange(i, 0, this->mapping_output.boundary_forms.size()));
+ AssertIndexRange(i, this->mapping_output.boundary_forms.size());
Assert(this->update_flags & update_boundary_forms,
(typename FEValuesBase<dim, spacedim>::ExcAccessToUninitializedField(
"update_boundary_forms")));
const unsigned int qpoint,
const unsigned int shape_nr) const
{
- Assert(qpoint * n_shape_functions + shape_nr < shape_values.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_values.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr, shape_values.size());
return shape_values[qpoint * n_shape_functions + shape_nr];
}
MappingQGeneric<dim, spacedim>::InternalData::shape(const unsigned int qpoint,
const unsigned int shape_nr)
{
- Assert(qpoint * n_shape_functions + shape_nr < shape_values.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_values.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr, shape_values.size());
return shape_values[qpoint * n_shape_functions + shape_nr];
}
const unsigned int qpoint,
const unsigned int shape_nr) const
{
- Assert(qpoint * n_shape_functions + shape_nr < shape_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_derivatives.size());
return shape_derivatives[qpoint * n_shape_functions + shape_nr];
}
const unsigned int qpoint,
const unsigned int shape_nr)
{
- Assert(qpoint * n_shape_functions + shape_nr < shape_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_derivatives.size());
return shape_derivatives[qpoint * n_shape_functions + shape_nr];
}
const unsigned int qpoint,
const unsigned int shape_nr) const
{
- Assert(qpoint * n_shape_functions + shape_nr <
- shape_second_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_second_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_second_derivatives.size());
return shape_second_derivatives[qpoint * n_shape_functions + shape_nr];
}
const unsigned int qpoint,
const unsigned int shape_nr)
{
- Assert(qpoint * n_shape_functions + shape_nr <
- shape_second_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_second_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_second_derivatives.size());
return shape_second_derivatives[qpoint * n_shape_functions + shape_nr];
}
const unsigned int qpoint,
const unsigned int shape_nr) const
{
- Assert(qpoint * n_shape_functions + shape_nr < shape_third_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_third_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_third_derivatives.size());
return shape_third_derivatives[qpoint * n_shape_functions + shape_nr];
}
const unsigned int qpoint,
const unsigned int shape_nr)
{
- Assert(qpoint * n_shape_functions + shape_nr < shape_third_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_third_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_third_derivatives.size());
return shape_third_derivatives[qpoint * n_shape_functions + shape_nr];
}
const unsigned int qpoint,
const unsigned int shape_nr) const
{
- Assert(qpoint * n_shape_functions + shape_nr <
- shape_fourth_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_fourth_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_fourth_derivatives.size());
return shape_fourth_derivatives[qpoint * n_shape_functions + shape_nr];
}
const unsigned int qpoint,
const unsigned int shape_nr)
{
- Assert(qpoint * n_shape_functions + shape_nr <
- shape_fourth_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_fourth_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_fourth_derivatives.size());
return shape_fourth_derivatives[qpoint * n_shape_functions + shape_nr];
}
inline bool
Triangulation<dim, spacedim>::vertex_used(const unsigned int index) const
{
- Assert(index < vertices_used.size(),
- ExcIndexRange(index, 0, vertices_used.size()));
+ AssertIndexRange(index, vertices_used.size());
return vertices_used[index];
}
quad_index(const TriaAccessor<3, dim, spacedim> &accessor,
const unsigned int i)
{
- Assert(i < GeometryInfo<3>::quads_per_cell,
- ExcIndexRange(i, 0, GeometryInfo<3>::quads_per_cell));
+ AssertIndexRange(i, GeometryInfo<3>::quads_per_cell);
return accessor.tria->levels[accessor.present_level]
->cells.cells[accessor.present_index]
.face(i);
face_flip(const TriaAccessor<3, dim, spacedim> &accessor,
const unsigned int face)
{
- Assert(face < GeometryInfo<3>::faces_per_cell,
- ExcIndexRange(face, 0, GeometryInfo<3>::faces_per_cell));
+ AssertIndexRange(face, GeometryInfo<3>::faces_per_cell);
Assert(accessor.present_index * GeometryInfo<3>::faces_per_cell + face <
accessor.tria->levels[accessor.present_level]
->cells.face_flips.size(),
face_rotation(const TriaAccessor<3, dim, spacedim> &accessor,
const unsigned int face)
{
- Assert(face < GeometryInfo<3>::faces_per_cell,
- ExcIndexRange(face, 0, GeometryInfo<3>::faces_per_cell));
+ AssertIndexRange(face, GeometryInfo<3>::faces_per_cell);
Assert(accessor.present_index * GeometryInfo<3>::faces_per_cell + face <
accessor.tria->levels[accessor.present_level]
->cells.face_rotations.size(),
const unsigned int line)
{
Assert(accessor.used(), TriaAccessorExceptions::ExcCellNotUsed());
- Assert(line < GeometryInfo<3>::lines_per_cell,
- ExcIndexRange(line, 0, GeometryInfo<3>::lines_per_cell));
+ AssertIndexRange(line, GeometryInfo<3>::lines_per_cell);
// get the line index by asking the
// quads. first assume standard orientation
const bool value)
{
Assert(accessor.used(), TriaAccessorExceptions::ExcCellNotUsed());
- Assert(face < GeometryInfo<3>::faces_per_cell,
- ExcIndexRange(face, 0, GeometryInfo<3>::faces_per_cell));
+ AssertIndexRange(face, GeometryInfo<3>::faces_per_cell);
Assert(accessor.present_index * GeometryInfo<3>::faces_per_cell + face <
accessor.tria->levels[accessor.present_level]
->cells.face_orientations.size(),
const unsigned int face,
const bool value)
{
- Assert(face < GeometryInfo<3>::faces_per_cell,
- ExcIndexRange(face, 0, GeometryInfo<3>::faces_per_cell));
+ AssertIndexRange(face, GeometryInfo<3>::faces_per_cell);
Assert(accessor.present_index * GeometryInfo<3>::faces_per_cell + face <
accessor.tria->levels[accessor.present_level]
->cells.face_flips.size(),
const unsigned int face,
const bool value)
{
- Assert(face < GeometryInfo<3>::faces_per_cell,
- ExcIndexRange(face, 0, GeometryInfo<3>::faces_per_cell));
+ AssertIndexRange(face, GeometryInfo<3>::faces_per_cell);
Assert(accessor.present_index * GeometryInfo<3>::faces_per_cell + face <
accessor.tria->levels[accessor.present_level]
->cells.face_rotations.size(),
const bool value)
{
Assert(accessor.used(), TriaAccessorExceptions::ExcCellNotUsed());
- Assert(line < GeometryInfo<3>::lines_per_face,
- ExcIndexRange(line, 0, GeometryInfo<3>::lines_per_face));
+ AssertIndexRange(line, GeometryInfo<3>::lines_per_face);
Assert(accessor.present_index * GeometryInfo<3>::lines_per_face + line <
accessor.tria->faces->quads.line_orientations.size(),
ExcInternalError());
TriaAccessor<structdim, dim, spacedim>::vertex_index(
const unsigned int corner) const
{
- Assert(corner < GeometryInfo<structdim>::vertices_per_cell,
- ExcIndexRange(corner, 0, GeometryInfo<structdim>::vertices_per_cell));
+ AssertIndexRange(corner, GeometryInfo<structdim>::vertices_per_cell);
return dealii::internal::TriaAccessorImplementation::Implementation::
vertex_index(*this, corner);
inline unsigned int
TriaAccessor<structdim, dim, spacedim>::line_index(const unsigned int i) const
{
- Assert(i < GeometryInfo<structdim>::lines_per_cell,
- ExcIndexRange(i, 0, GeometryInfo<structdim>::lines_per_cell));
+ AssertIndexRange(i, GeometryInfo<structdim>::lines_per_cell);
return dealii::internal::TriaAccessorImplementation::Implementation::
line_index(*this, i);
const unsigned int line) const
{
Assert(used(), TriaAccessorExceptions::ExcCellNotUsed());
- Assert(line < GeometryInfo<structdim>::lines_per_cell,
- ExcIndexRange(line, 0, GeometryInfo<structdim>::lines_per_cell));
+ AssertIndexRange(line, GeometryInfo<structdim>::lines_per_cell);
return dealii::internal::TriaAccessorImplementation::Implementation::
line_orientation(*this, line);
const bool value) const
{
Assert(used(), TriaAccessorExceptions::ExcCellNotUsed());
- Assert(line < GeometryInfo<structdim>::lines_per_cell,
- ExcIndexRange(line, 0, GeometryInfo<structdim>::lines_per_cell));
+ AssertIndexRange(line, GeometryInfo<structdim>::lines_per_cell);
dealii::internal::TriaAccessorImplementation::Implementation::
set_line_orientation(*this, line, value);
TriaAccessor<structdim, dim, spacedim>::child_index(const unsigned int i) const
{
Assert(has_children(), TriaAccessorExceptions::ExcCellHasNoChildren());
- Assert(i < n_children(), ExcIndexRange(i, 0, n_children()));
+ AssertIndexRange(i, n_children());
// each set of two children are stored
// consecutively, so we only have to find
TriaAccessor<structdim, dim, spacedim>::isotropic_child_index(
const unsigned int i) const
{
- Assert(i < GeometryInfo<structdim>::max_children_per_cell,
- ExcIndexRange(i, 0, GeometryInfo<structdim>::max_children_per_cell));
+ AssertIndexRange(i, GeometryInfo<structdim>::max_children_per_cell);
switch (structdim)
{
inline unsigned int
TriaAccessor<0, 1, spacedim>::vertex_index(const unsigned int i) const
{
- Assert(i == 0, ExcIndexRange(i, 0, 1));
+ AssertIndexRange(i, 1);
(void)i;
return global_vertex_index;
}
inline Point<spacedim> &
TriaAccessor<0, 1, spacedim>::vertex(const unsigned int i) const
{
- Assert(i == 0, ExcIndexRange(i, 0, 1));
+ AssertIndexRange(i, 1);
(void)i;
return const_cast<Point<spacedim> &>(
this->tria->vertices[global_vertex_index]);
const RefinementCase<dim - 1> &face_refinement_case) const
{
Assert(dim > 1, ExcImpossibleInDim(dim));
- Assert(face_no < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_no, 0, GeometryInfo<dim>::faces_per_cell));
- Assert(face_refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(face_refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
+ AssertIndexRange(face_no, GeometryInfo<dim>::faces_per_cell);
+ AssertIndexRange(face_refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
// the new refinement case is a combination
// of the minimum required one for the given
const unsigned int line_no) const
{
Assert(dim > 1, ExcImpossibleInDim(dim));
- Assert(line_no < GeometryInfo<dim>::lines_per_cell,
- ExcIndexRange(line_no, 0, GeometryInfo<dim>::lines_per_cell));
+ AssertIndexRange(line_no, GeometryInfo<dim>::lines_per_cell);
// the new refinement case is a combination
// of the minimum required one for the given
CellAccessor<2>::subface_case(const unsigned int face_no) const
{
Assert(active(), TriaAccessorExceptions::ExcCellNotActive());
- Assert(face_no < GeometryInfo<2>::faces_per_cell,
- ExcIndexRange(face_no, 0, GeometryInfo<2>::faces_per_cell));
+ AssertIndexRange(face_no, GeometryInfo<2>::faces_per_cell);
return ((face(face_no)->has_children()) ?
dealii::internal::SubfaceCase<2>::case_x :
dealii::internal::SubfaceCase<2>::case_none);
CellAccessor<2, 3>::subface_case(const unsigned int face_no) const
{
Assert(active(), TriaAccessorExceptions::ExcCellNotActive());
- Assert(face_no < GeometryInfo<2>::faces_per_cell,
- ExcIndexRange(face_no, 0, GeometryInfo<2>::faces_per_cell));
+ AssertIndexRange(face_no, GeometryInfo<2>::faces_per_cell);
return ((face(face_no)->has_children()) ?
dealii::internal::SubfaceCase<2>::case_x :
dealii::internal::SubfaceCase<2>::case_none);
CellAccessor<3>::subface_case(const unsigned int face_no) const
{
Assert(active(), TriaAccessorExceptions::ExcCellNotActive());
- Assert(face_no < GeometryInfo<3>::faces_per_cell,
- ExcIndexRange(face_no, 0, GeometryInfo<3>::faces_per_cell));
+ AssertIndexRange(face_no, GeometryInfo<3>::faces_per_cell);
switch (static_cast<std::uint8_t>(face(face_no)->refinement_case()))
{
case RefinementCase<3>::no_refinement:
inline int
TriaObject<structdim>::face(const unsigned int i) const
{
- Assert(i < GeometryInfo<structdim>::faces_per_cell,
- ExcIndexRange(i, 0, GeometryInfo<structdim>::faces_per_cell));
+ AssertIndexRange(i, GeometryInfo<structdim>::faces_per_cell);
return faces[i];
}
inline void
TriaObject<structdim>::set_face(const unsigned int i, const int index)
{
- Assert(i < GeometryInfo<structdim>::faces_per_cell,
- ExcIndexRange(i, 0, GeometryInfo<structdim>::faces_per_cell));
+ AssertIndexRange(i, GeometryInfo<structdim>::faces_per_cell);
faces[i] = index;
}
ExcPointerIndexClash());
user_data_type = data_pointer;
- Assert(i < user_data.size(), ExcIndexRange(i, 0, user_data.size()));
+ AssertIndexRange(i, user_data.size());
return user_data[i].p;
}
ExcPointerIndexClash());
user_data_type = data_pointer;
- Assert(i < user_data.size(), ExcIndexRange(i, 0, user_data.size()));
+ AssertIndexRange(i, user_data.size());
return user_data[i].p;
}
ExcPointerIndexClash());
user_data_type = data_index;
- Assert(i < user_data.size(), ExcIndexRange(i, 0, user_data.size()));
+ AssertIndexRange(i, user_data.size());
return user_data[i].i;
}
inline void
TriaObjects<G>::clear_user_data(const unsigned int i)
{
- Assert(i < user_data.size(), ExcIndexRange(i, 0, user_data.size()));
+ AssertIndexRange(i, user_data.size());
user_data[i].i = 0;
}
ExcPointerIndexClash());
user_data_type = data_index;
- Assert(i < user_data.size(), ExcIndexRange(i, 0, user_data.size()));
+ AssertIndexRange(i, user_data.size());
return user_data[i].i;
}
TriaObjectsHex::face_orientation(const unsigned int cell,
const unsigned int face) const
{
- Assert(cell < face_orientations.size() / GeometryInfo<3>::faces_per_cell,
- ExcIndexRange(0,
- cell,
- face_orientations.size() /
- GeometryInfo<3>::faces_per_cell));
- Assert(face < GeometryInfo<3>::faces_per_cell,
- ExcIndexRange(0, face, GeometryInfo<3>::faces_per_cell));
+ AssertIndexRange(cell,
+ face_orientations.size() /
+ GeometryInfo<3>::faces_per_cell);
+ AssertIndexRange(face, GeometryInfo<3>::faces_per_cell);
return face_orientations[cell * GeometryInfo<3>::faces_per_cell + face];
}
dealii::hp::DoFHandler<dim, spacedim>::default_fe_index),
ExcMessage("You need to specify a FE index when working "
"with hp DoFHandlers"));
- Assert(fe_index < dof_handler.get_fe_collection().size(),
- ExcIndexRange(fe_index,
- 0,
- dof_handler.get_fe_collection().size()));
- Assert(local_index < dof_handler.get_fe(fe_index)
- .template n_dofs_per_object<structdim>(),
- ExcIndexRange(local_index,
- 0,
- dof_handler.get_fe(fe_index)
- .template n_dofs_per_object<structdim>()));
- Assert(obj_index < dof_offsets.size(),
- ExcIndexRange(obj_index, 0, dof_offsets.size()));
+ AssertIndexRange(fe_index, dof_handler.get_fe_collection().size());
+ AssertIndexRange(
+ local_index,
+ dof_handler.get_fe(fe_index).template n_dofs_per_object<structdim>());
+ AssertIndexRange(obj_index, dof_offsets.size());
// make sure we are on an
// object for which DoFs have
dealii::hp::DoFHandler<dim, spacedim>::default_fe_index),
ExcMessage("You need to specify a FE index when working "
"with hp DoFHandlers"));
- Assert(fe_index < dof_handler.get_fe_collection().size(),
- ExcIndexRange(fe_index,
- 0,
- dof_handler.get_fe_collection().size()));
- Assert(local_index < dof_handler.get_fe(fe_index)
- .template n_dofs_per_object<structdim>(),
- ExcIndexRange(local_index,
- 0,
- dof_handler.get_fe(fe_index)
- .template n_dofs_per_object<structdim>()));
- Assert(obj_index < dof_offsets.size(),
- ExcIndexRange(obj_index, 0, dof_offsets.size()));
+ AssertIndexRange(fe_index, dof_handler.get_fe_collection().size());
+ AssertIndexRange(
+ local_index,
+ dof_handler.get_fe(fe_index).template n_dofs_per_object<structdim>());
+ AssertIndexRange(obj_index, dof_offsets.size());
// make sure we are on an
// object for which DoFs have
const dealii::hp::DoFHandler<dim, spacedim> &dof_handler,
const unsigned int obj_index) const
{
- Assert(obj_index < dof_offsets.size(),
- ExcIndexRange(obj_index, 0, dof_offsets.size()));
+ AssertIndexRange(obj_index, dof_offsets.size());
// make sure we are on an
// object for which DoFs have
const unsigned int obj_index,
const unsigned int n) const
{
- Assert(obj_index < dof_offsets.size(),
- ExcIndexRange(obj_index, 0, dof_offsets.size()));
+ AssertIndexRange(obj_index, dof_offsets.size());
// make sure we are on an
// object for which DoFs have
Assert(structdim < dim,
ExcMessage("This object can not be used for cells."));
- Assert(n < n_active_fe_indices(dof_handler, obj_index),
- ExcIndexRange(n, 0, n_active_fe_indices(dof_handler, obj_index)));
+ AssertIndexRange(n, n_active_fe_indices(dof_handler, obj_index));
// there may be multiple finite elements associated with
// this object. hop along the list of index sets until we
const unsigned int fe_index,
const unsigned int /*obj_level*/) const
{
- Assert(obj_index < dof_offsets.size(),
- ExcIndexRange(obj_index,
- 0,
- static_cast<unsigned int>(dof_offsets.size())));
+ AssertIndexRange(obj_index, dof_offsets.size());
Assert((fe_index !=
dealii::hp::DoFHandler<dim, spacedim>::default_fe_index),
ExcMessage("You need to specify a FE index when working "
"with hp DoFHandlers"));
- Assert(fe_index < dof_handler.get_fe_collection().size(),
- ExcIndexRange(fe_index,
- 0,
- dof_handler.get_fe_collection().size()));
+ AssertIndexRange(fe_index, dof_handler.get_fe_collection().size());
// make sure we are on an
// object for which DoFs have
const unsigned int local_index) const
{
(void)fe_index;
- Assert(obj_index < dof_offsets.size(),
- ExcIndexRange(obj_index, 0, dof_offsets.size()));
+ AssertIndexRange(obj_index, dof_offsets.size());
// make sure we are on an object for which DoFs have been
// allocated at all
const types::global_dof_index global_index)
{
(void)fe_index;
- Assert(obj_index < dof_offsets.size(),
- ExcIndexRange(obj_index, 0, dof_offsets.size()));
+ AssertIndexRange(obj_index, dof_offsets.size());
// make sure we are on an
// object for which DoFs have
inline unsigned int
DoFLevel::active_fe_index(const unsigned int obj_index) const
{
- Assert(obj_index < active_fe_indices.size(),
- ExcIndexRange(obj_index, 0, active_fe_indices.size()));
+ AssertIndexRange(obj_index, active_fe_indices.size());
if (is_compressed_entry(active_fe_indices[obj_index]) == false)
return active_fe_indices[obj_index];
DoFLevel::set_active_fe_index(const unsigned int obj_index,
const unsigned int fe_index)
{
- Assert(obj_index < active_fe_indices.size(),
- ExcIndexRange(obj_index, 0, active_fe_indices.size()));
+ AssertIndexRange(obj_index, active_fe_indices.size());
// check whether the given fe_index is within the range of
// values that we interpret as "not compressed". if not, then
inline unsigned int
DoFLevel::future_fe_index(const unsigned int obj_index) const
{
- Assert(obj_index < future_fe_indices.size(),
- ExcIndexRange(obj_index, 0, future_fe_indices.size()));
+ AssertIndexRange(obj_index, future_fe_indices.size());
if (future_fe_index_set(obj_index))
return future_fe_indices[obj_index];
DoFLevel::set_future_fe_index(const unsigned int obj_index,
const unsigned int fe_index)
{
- Assert(obj_index < future_fe_indices.size(),
- ExcIndexRange(obj_index, 0, future_fe_indices.size()));
+ AssertIndexRange(obj_index, future_fe_indices.size());
// check whether the given fe_index is within the range of
// values that we interpret as "not compressed". if not, then
inline bool
DoFLevel::future_fe_index_set(const unsigned int obj_index) const
{
- Assert(obj_index < future_fe_indices.size(),
- ExcIndexRange(obj_index, 0, future_fe_indices.size()));
+ AssertIndexRange(obj_index, future_fe_indices.size());
return (future_fe_indices[obj_index] != invalid_active_fe_index);
}
inline void
DoFLevel::clear_future_fe_index(const unsigned int obj_index)
{
- Assert(obj_index < future_fe_indices.size(),
- ExcIndexRange(obj_index, 0, future_fe_indices.size()));
+ AssertIndexRange(obj_index, future_fe_indices.size());
future_fe_indices[obj_index] = invalid_active_fe_index;
}
inline const FiniteElement<dim, spacedim> &FECollection<dim, spacedim>::
operator[](const unsigned int index) const
{
- Assert(index < finite_elements.size(),
- ExcIndexRange(index, 0, finite_elements.size()));
+ AssertIndexRange(index, finite_elements.size());
return *finite_elements[index];
}
inline const Mapping<dim, spacedim> &MappingCollection<dim, spacedim>::
operator[](const unsigned int index) const
{
- Assert(index < mappings.size(), ExcIndexRange(index, 0, mappings.size()));
+ AssertIndexRange(index, mappings.size());
return *mappings[index];
}
inline const Quadrature<dim> &QCollection<dim>::
operator[](const unsigned int index) const
{
- Assert(index < quadratures.size(),
- ExcIndexRange(index, 0, quadratures.size()));
+ AssertIndexRange(index, quadratures.size());
return *quadratures[index];
}
inline std::pair<unsigned int, BlockIndices::size_type>
BlockIndices::global_to_local(const size_type i) const
{
- Assert(i < total_size(), ExcIndexRangeType<size_type>(i, 0, total_size()));
+ AssertIndexRange(i, total_size());
Assert(n_blocks > 0, ExcLowerRangeType<size_type>(i, size_type(1)));
// start_indices[0] == 0 so we might as well start from the next one
BlockIndices::local_to_global(const unsigned int block,
const size_type index) const
{
- Assert(block < n_blocks, ExcIndexRange(block, 0, n_blocks));
- Assert(index < start_indices[block + 1] - start_indices[block],
- ExcIndexRangeType<size_type>(
- index, 0, start_indices[block + 1] - start_indices[block]));
+ AssertIndexRange(block, n_blocks);
+ AssertIndexRange(index, start_indices[block + 1] - start_indices[block]);
return start_indices[block] + index;
}
inline BlockIndices::size_type
BlockIndices::block_size(const unsigned int block) const
{
- Assert(block < n_blocks, ExcIndexRange(block, 0, n_blocks));
+ AssertIndexRange(block, n_blocks);
return start_indices[block + 1] - start_indices[block];
}
inline BlockIndices::size_type
BlockIndices::block_start(const unsigned int block) const
{
- Assert(block < n_blocks, ExcIndexRange(block, 0, n_blocks));
+ AssertIndexRange(block, n_blocks);
return start_indices[block];
}
#ifdef DEBUG
const unsigned int m = block_matrix.n_block_rows();
const unsigned int n = block_matrix.n_block_cols();
- Assert(i < m, ExcIndexRange(i, 0, m));
- Assert(j < n, ExcIndexRange(j, 0, n));
+ AssertIndexRange(i, m);
+ AssertIndexRange(j, n);
#endif
return BlockType(block_matrix.block(i, j));
return_op.n_block_cols = []() -> unsigned int { return n; };
return_op.block = [ops](unsigned int i, unsigned int j) -> BlockType {
- Assert(i < m, ExcIndexRange(i, 0, m));
- Assert(j < n, ExcIndexRange(j, 0, n));
+ AssertIndexRange(i, m);
+ AssertIndexRange(j, n);
return ops[i][j];
};
const unsigned int m = block_matrix.n_block_rows();
const unsigned int n = block_matrix.n_block_cols();
Assert(m == n, ExcDimensionMismatch(m, n));
- Assert(i < m, ExcIndexRange(i, 0, m));
- Assert(j < n, ExcIndexRange(j, 0, n));
+ AssertIndexRange(i, m);
+ AssertIndexRange(j, n);
#endif
if (i == j)
return BlockType(block_matrix.block(i, j));
number prefix,
bool transpose)
{
- Assert(row < n_block_rows(), ExcIndexRange(row, 0, n_block_rows()));
- Assert(col < n_block_cols(), ExcIndexRange(col, 0, n_block_cols()));
+ AssertIndexRange(row, n_block_rows());
+ AssertIndexRange(col, n_block_cols());
entries.push_back(Entry(matrix, row, col, prefix, transpose));
}
BlockMatrixBase<MatrixType>::block(const unsigned int row,
const unsigned int column)
{
- Assert(row < n_block_rows(), ExcIndexRange(row, 0, n_block_rows()));
- Assert(column < n_block_cols(), ExcIndexRange(column, 0, n_block_cols()));
+ AssertIndexRange(row, n_block_rows());
+ AssertIndexRange(column, n_block_cols());
return *sub_objects[row][column];
}
BlockMatrixBase<MatrixType>::block(const unsigned int row,
const unsigned int column) const
{
- Assert(row < n_block_rows(), ExcIndexRange(row, 0, n_block_rows()));
- Assert(column < n_block_cols(), ExcIndexRange(column, 0, n_block_cols()));
+ AssertIndexRange(row, n_block_rows());
+ AssertIndexRange(column, n_block_cols());
return *sub_objects[row][column];
}
inline typename BlockMatrixBase<MatrixType>::const_iterator
BlockMatrixBase<MatrixType>::begin(const size_type r) const
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
return const_iterator(this, r);
}
inline typename BlockMatrixBase<MatrixType>::const_iterator
BlockMatrixBase<MatrixType>::end(const size_type r) const
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
return const_iterator(this, r + 1);
}
inline typename BlockMatrixBase<MatrixType>::iterator
BlockMatrixBase<MatrixType>::begin(const size_type r)
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
return iterator(this, r);
}
inline typename BlockMatrixBase<MatrixType>::iterator
BlockMatrixBase<MatrixType>::end(const size_type r)
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
return iterator(this, r + 1);
}
BlockSparseMatrixEZ<Number>::block(const unsigned int row,
const unsigned int column)
{
- Assert(row < n_block_rows(), ExcIndexRange(row, 0, n_block_rows()));
- Assert(column < n_block_cols(), ExcIndexRange(column, 0, n_block_cols()));
+ AssertIndexRange(row, n_block_rows());
+ AssertIndexRange(column, n_block_cols());
return blocks[row][column];
}
BlockSparseMatrixEZ<Number>::block(const unsigned int row,
const unsigned int column) const
{
- Assert(row < n_block_rows(), ExcIndexRange(row, 0, n_block_rows()));
- Assert(column < n_block_cols(), ExcIndexRange(column, 0, n_block_cols()));
+ AssertIndexRange(row, n_block_rows());
+ AssertIndexRange(column, n_block_cols());
return blocks[row][column];
}
BlockSparsityPatternBase<SparsityPatternType>::block(const size_type row,
const size_type column)
{
- Assert(row < rows, ExcIndexRange(row, 0, rows));
- Assert(column < columns, ExcIndexRange(column, 0, columns));
+ AssertIndexRange(row, rows);
+ AssertIndexRange(column, columns);
return *sub_objects[row][column];
}
const size_type row,
const size_type column) const
{
- Assert(row < rows, ExcIndexRange(row, 0, rows));
- Assert(column < columns, ExcIndexRange(column, 0, columns));
+ AssertIndexRange(row, rows);
+ AssertIndexRange(column, columns);
return *sub_objects[row][column];
}
const std::pair<size_type, size_type> row_index =
row_indices.global_to_local(row);
- Assert(index < row_length(row), ExcIndexRange(index, 0, row_length(row)));
+ AssertIndexRange(index, row_length(row));
size_type c = 0;
size_type block_columns = 0; // sum of n_cols for all blocks to the left
inline typename BlockVectorBase<VectorType>::BlockType &
BlockVectorBase<VectorType>::block(const unsigned int i)
{
- Assert(i < n_blocks(), ExcIndexRange(i, 0, n_blocks()));
+ AssertIndexRange(i, n_blocks());
return components[i];
}
inline const typename BlockVectorBase<VectorType>::BlockType &
BlockVectorBase<VectorType>::block(const unsigned int i) const
{
- Assert(i < n_blocks(), ExcIndexRange(i, 0, n_blocks()));
+ AssertIndexRange(i, n_blocks());
return components[i];
}
inline typename ChunkSparseMatrix<number>::const_iterator
ChunkSparseMatrix<number>::begin(const unsigned int r) const
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
return const_iterator(this, r);
}
inline typename ChunkSparseMatrix<number>::const_iterator
ChunkSparseMatrix<number>::end(const unsigned int r) const
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
return const_iterator(this, r + 1);
}
inline typename ChunkSparseMatrix<number>::iterator
ChunkSparseMatrix<number>::begin(const unsigned int r)
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
return iterator(this, r);
}
inline typename ChunkSparseMatrix<number>::iterator
ChunkSparseMatrix<number>::end(const unsigned int r)
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
return iterator(this, r + 1);
}
inline ChunkSparsityPattern::iterator
ChunkSparsityPattern::begin(const size_type r) const
{
- Assert(r < n_rows(), ExcIndexRange(r, 0, n_rows()));
+ AssertIndexRange(r, n_rows());
return {this, r};
}
inline ChunkSparsityPattern::iterator
ChunkSparsityPattern::end(const size_type r) const
{
- Assert(r < n_rows(), ExcIndexRange(r, 0, n_rows()));
+ AssertIndexRange(r, n_rows());
return {this, r + 1};
}
inline void
DynamicSparsityPattern::add(const size_type i, const size_type j)
{
- Assert(i < rows, ExcIndexRangeType<size_type>(i, 0, rows));
- Assert(j < cols, ExcIndexRangeType<size_type>(j, 0, cols));
+ AssertIndexRange(i, rows);
+ AssertIndexRange(j, cols);
if (rowset.size() > 0 && !rowset.is_element(i))
return;
ForwardIterator end,
const bool indices_are_sorted)
{
- Assert(row < rows, ExcIndexRangeType<size_type>(row, 0, rows));
+ AssertIndexRange(row, rows);
if (rowset.size() > 0 && !rowset.is_element(row))
return;
inline types::global_dof_index
DynamicSparsityPattern::row_length(const size_type row) const
{
- Assert(row < n_rows(), ExcIndexRangeType<size_type>(row, 0, n_rows()));
+ AssertIndexRange(row, n_rows());
if (!have_entries)
return 0;
DynamicSparsityPattern::column_number(const size_type row,
const size_type index) const
{
- Assert(row < n_rows(), ExcIndexRangeType<size_type>(row, 0, n_rows()));
+ AssertIndexRange(row, n_rows());
Assert(rowset.size() == 0 || rowset.is_element(row), ExcInternalError());
const size_type local_row =
rowset.size() ? rowset.index_within_set(row) : row;
- Assert(index < lines[local_row].entries.size(),
- ExcIndexRangeType<size_type>(index,
- 0,
- lines[local_row].entries.size()));
+ AssertIndexRange(index, lines[local_row].entries.size());
return lines[local_row].entries[index];
}
inline DynamicSparsityPattern::iterator
DynamicSparsityPattern::begin(const size_type r) const
{
- Assert(r < n_rows(), ExcIndexRangeType<size_type>(r, 0, n_rows()));
+ AssertIndexRange(r, n_rows());
if (!have_entries)
return {this};
inline DynamicSparsityPattern::iterator
DynamicSparsityPattern::end(const size_type r) const
{
- Assert(r < n_rows(), ExcIndexRangeType<size_type>(r, 0, n_rows()));
+ AssertIndexRange(r, n_rows());
unsigned int row = r + 1;
if (row == n_rows())
: matrix(matrix)
, index(index)
{
- Assert(index <= matrix->constraints.size(),
- ExcIndexRange(index, 0, matrix->constraints.size()));
+ AssertIndexRange(index, matrix->constraints.size() + 1);
}
b_iterator = matrix->inverse(a_block).begin(r);
b_end = matrix->inverse(a_block).end();
- Assert(a_block < matrix->size(), ExcIndexRange(a_block, 0, matrix->size()));
+ AssertIndexRange(a_block, matrix->size());
}
PreconditionBlockJacobi<MatrixType, inverse_type>::begin(
const size_type r) const
{
- Assert(r < this->A->m(), ExcIndexRange(r, 0, this->A->m()));
+ AssertIndexRange(r, this->A->m());
return const_iterator(this, r);
}
PreconditionBlockJacobi<MatrixType, inverse_type>::end(
const size_type r) const
{
- Assert(r < this->A->m(), ExcIndexRange(r, 0, this->A->m()));
+ AssertIndexRange(r, this->A->m());
return const_iterator(this, r + 1);
}
if (same_diagonal())
return var_inverse_full[0];
- Assert(i < var_inverse_full.size(),
- ExcIndexRange(i, 0, var_inverse_full.size()));
+ AssertIndexRange(i, var_inverse_full.size());
return var_inverse_full[i];
}
if (same_diagonal())
return var_diagonal[0];
- Assert(i < var_diagonal.size(), ExcIndexRange(i, 0, var_diagonal.size()));
+ AssertIndexRange(i, var_diagonal.size());
return var_diagonal[i];
}
if (same_diagonal())
return var_inverse_full[0];
- Assert(i < var_inverse_full.size(),
- ExcIndexRange(i, 0, var_inverse_full.size()));
+ AssertIndexRange(i, var_inverse_full.size());
return var_inverse_full[i];
}
if (same_diagonal())
return var_diagonal[0];
- Assert(i < var_diagonal.size(), ExcIndexRange(i, 0, var_diagonal.size()));
+ AssertIndexRange(i, var_diagonal.size());
return var_diagonal[i];
}
ImplicitQR<VectorType>::apply_givens_rotation(const unsigned int i,
const unsigned int k)
{
- Assert(i < k, ExcIndexRange(i, 0, k));
- Assert(k < this->current_size, ExcIndexRange(k, 0, this->current_size));
+ AssertIndexRange(i, k);
+ AssertIndexRange(k, this->current_size);
const std::array<Number, 3> csr =
dealii::Utilities::LinearAlgebra::givens_rotation<Number>(this->R(i, k),
this->R(k, k));
QR<VectorType>::apply_givens_rotation(const unsigned int i,
const unsigned int k)
{
- Assert(i < k, ExcIndexRange(i, 0, k));
- Assert(k < this->current_size, ExcIndexRange(k, 0, this->current_size));
+ AssertIndexRange(i, k);
+ AssertIndexRange(k, this->current_size);
const std::array<Number, 3> csr =
dealii::Utilities::LinearAlgebra::givens_rotation<Number>(this->R(i, k),
this->R(k, k));
void
QR<VectorType>::remove_column(const unsigned int k)
{
- Assert(k < this->current_size, ExcIndexRange(k, 0, this->current_size));
+ AssertIndexRange(k, this->current_size);
Assert(this->current_size > 0,
ExcMessage("Can not remove a column if QR is empty"));
// apply a sequence of Givens rotations
inline VectorType &TmpVectors<VectorType>::
operator[](const unsigned int i) const
{
- Assert(i < data.size(), ExcIndexRange(i, 0, data.size()));
+ AssertIndexRange(i, data.size());
Assert(data[i] != nullptr, ExcNotInitialized());
return *data[i];
TmpVectors<VectorType>::operator()(const unsigned int i,
const VectorType & temp)
{
- Assert(i < data.size(), ExcIndexRange(i, 0, data.size()));
+ AssertIndexRange(i, data.size());
if (data[i] == nullptr)
{
data[i] = std::move(typename VectorMemory<VectorType>::Pointer(mem));
inline VectorType &TmpVectors<VectorType>::
operator[](const unsigned int i) const
{
- Assert(i < data.size(), ExcIndexRange(i, 0, data.size()));
+ AssertIndexRange(i, data.size());
Assert(data[i] != nullptr, ExcNotInitialized());
return *data[i];
inline typename SparseMatrix<number>::const_iterator
SparseMatrix<number>::begin(const size_type r) const
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
return const_iterator(this, cols->rowstart[r]);
}
inline typename SparseMatrix<number>::const_iterator
SparseMatrix<number>::end(const size_type r) const
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
return const_iterator(this, cols->rowstart[r + 1]);
}
inline typename SparseMatrix<number>::iterator
SparseMatrix<number>::begin(const size_type r)
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
return iterator(this, cols->rowstart[r]);
}
inline typename SparseMatrix<number>::iterator
SparseMatrix<number>::end(const size_type r)
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
return iterator(this, cols->rowstart[r + 1]);
}
inline typename SparseMatrixEZ<number>::Entry *
SparseMatrixEZ<number>::locate(const size_type row, const size_type col)
{
- Assert(row < m(), ExcIndexRange(row, 0, m()));
- Assert(col < n(), ExcIndexRange(col, 0, n()));
+ AssertIndexRange(row, m());
+ AssertIndexRange(col, n());
const RowInfo & r = row_info[row];
const size_type end = r.start + r.length;
inline typename SparseMatrixEZ<number>::Entry *
SparseMatrixEZ<number>::allocate(const size_type row, const size_type col)
{
- Assert(row < m(), ExcIndexRange(row, 0, m()));
- Assert(col < n(), ExcIndexRange(col, 0, n()));
+ AssertIndexRange(row, m());
+ AssertIndexRange(col, n());
RowInfo & r = row_info[row];
const size_type end = r.start + r.length;
{
AssertIsFinite(value);
- Assert(i < m(), ExcIndexRange(i, 0, m()));
- Assert(j < n(), ExcIndexRange(j, 0, n()));
+ AssertIndexRange(i, m());
+ AssertIndexRange(j, n());
if (elide_zero_values && value == 0.)
{
{
AssertIsFinite(value);
- Assert(i < m(), ExcIndexRange(i, 0, m()));
- Assert(j < n(), ExcIndexRange(j, 0, n()));
+ AssertIndexRange(i, m());
+ AssertIndexRange(j, n());
// ignore zero additions
if (std::abs(value) == 0.)
inline typename SparseMatrixEZ<number>::const_iterator
SparseMatrixEZ<number>::begin(const size_type r) const
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
const_iterator result(this, r, 0);
return result;
}
inline typename SparseMatrixEZ<number>::const_iterator
SparseMatrixEZ<number>::end(const size_type r) const
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
const_iterator result(this, r + 1, 0);
return result;
}
inline SparsityPatternBase::iterator
SparsityPatternBase::begin(const size_type r) const
{
- Assert(r < n_rows(), ExcIndexRangeType<size_type>(r, 0, n_rows()));
+ AssertIndexRange(r, n_rows());
return {this, rowstart[r]};
}
inline SparsityPatternBase::iterator
SparsityPatternBase::end(const size_type r) const
{
- Assert(r < n_rows(), ExcIndexRangeType<size_type>(r, 0, n_rows()));
+ AssertIndexRange(r, n_rows());
return {this, rowstart[r + 1]};
}
inline unsigned int
SparsityPatternBase::row_length(const size_type row) const
{
- Assert(row < rows, ExcIndexRangeType<size_type>(row, 0, rows));
+ AssertIndexRange(row, rows);
return rowstart[row + 1] - rowstart[row];
}
SparsityPatternBase::column_number(const size_type row,
const unsigned int index) const
{
- Assert(row < rows, ExcIndexRangeType<size_type>(row, 0, rows));
- Assert(index < row_length(row), ExcIndexRange(index, 0, row_length(row)));
+ AssertIndexRange(row, rows);
+ AssertIndexRange(index, row_length(row));
return colnums[rowstart[row] + index];
}
{
const size_type col =
internal::SparsityPatternTools::get_column_index_from_iterator(*j);
- Assert(col < n_cols, ExcIndexRange(col, 0, n_cols));
+ AssertIndexRange(col, n_cols);
if ((col != row) || !is_square)
*cols++ = col;
inline number
TridiagonalMatrix<number>::operator()(size_type i, size_type j) const
{
- Assert(i < n(), ExcIndexRange(i, 0, n()));
- Assert(j < n(), ExcIndexRange(j, 0, n()));
+ AssertIndexRange(i, n());
+ AssertIndexRange(j, n());
Assert(i <= j + 1, ExcIndexRange(i, j - 1, j + 2));
Assert(j <= i + 1, ExcIndexRange(j, i - 1, i + 2));
inline number &
TridiagonalMatrix<number>::operator()(size_type i, size_type j)
{
- Assert(i < n(), ExcIndexRange(i, 0, n()));
- Assert(j < n(), ExcIndexRange(j, 0, n()));
+ AssertIndexRange(i, n());
+ AssertIndexRange(j, n());
Assert(i <= j + 1, ExcIndexRange(i, j - 1, j + 2));
Assert(j <= i + 1, ExcIndexRange(j, i - 1, i + 2));
inline SparseMatrix::const_iterator
SparseMatrix::begin(const size_type r) const
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
if (in_local_range(r) && (row_length(r) > 0))
return const_iterator(this, r, 0);
else
inline SparseMatrix::const_iterator
SparseMatrix::end(const size_type r) const
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
// place the iterator on the first entry
// past this line, or at the end of the
inline SparseMatrix::iterator
SparseMatrix::begin(const size_type r)
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
if (in_local_range(r) && (row_length(r) > 0))
return iterator(this, r, 0);
else
inline SparseMatrix::iterator
SparseMatrix::end(const size_type r)
{
- Assert(r < m(), ExcIndexRange(r, 0, m()));
+ AssertIndexRange(r, m());
// place the iterator on the first entry
// past this line, or at the end of the
inline SparsityPattern::const_iterator
SparsityPattern::begin(const size_type r) const
{
- Assert(r < n_rows(), ExcIndexRangeType<size_type>(r, 0, n_rows()));
+ AssertIndexRange(r, n_rows());
if (row_length(r) > 0)
return const_iterator(this, r, 0);
else
inline SparsityPattern::const_iterator
SparsityPattern::end(const size_type r) const
{
- Assert(r < n_rows(), ExcIndexRangeType<size_type>(r, 0, n_rows()));
+ AssertIndexRange(r, n_rows());
// place the iterator on the first entry
// past this line, or at the end of the
inline Number
Vector<Number>::operator()(const size_type i) const
{
- Assert(i < size(), ExcIndexRange(i, 0, size()));
+ AssertIndexRange(i, size());
return values[i];
}
inline Number &
Vector<Number>::operator()(const size_type i)
{
- Assert(i < size(), ExcIndexRangeType<size_type>(i, 0, size()));
+ AssertIndexRange(i, size());
return values[i];
}
{
for (size_type i = 0; i < n_indices; ++i)
{
- Assert(indices[i] < size(), ExcIndexRange(indices[i], 0, size()));
+ AssertIndexRange(indices[i], size());
Assert(
numbers::is_finite(values[i]),
ExcMessage(
inline const FEValuesBase<dim, spacedim> &
IntegrationInfo<dim, spacedim>::fe_values(unsigned int i) const
{
- Assert(i < fevalv.size(), ExcIndexRange(i, 0, fevalv.size()));
+ AssertIndexRange(i, fevalv.size());
return *fevalv[i];
}
// For a given boundary id, find which vector component is on the boundary
// and set a zero boundary constraint for those degrees of freedom.
const unsigned int n_components = DoFTools::n_components(dof);
- Assert(first_vector_component + dim <= n_components,
- ExcIndexRange(first_vector_component, 0, n_components - dim + 1));
+ AssertIndexRange(first_vector_component + dim - 1, n_components);
ComponentMask comp_mask(n_components, false);
void
FiniteSizeHistory<T>::remove(const std::size_t ind)
{
- Assert(ind < data.size(), ExcIndexRange(ind, 0, data.size()));
+ AssertIndexRange(ind, data.size());
auto el = std::move(data[ind]);
data.erase(data.begin() + ind);
template <typename T>
T &FiniteSizeHistory<T>::operator[](const std::size_t ind)
{
- Assert(ind < data.size(), ExcIndexRange(ind, 0, data.size()));
+ AssertIndexRange(ind, data.size());
return *data[ind];
}
template <typename T>
const T &FiniteSizeHistory<T>::operator[](const std::size_t ind) const
{
- Assert(ind < data.size(), ExcIndexRange(ind, 0, data.size()));
+ AssertIndexRange(ind, data.size());
return *data[ind];
}
using Number = typename VectorType::value_type;
Assert(v.size() == dof.n_dofs(),
ExcDimensionMismatch(v.size(), dof.n_dofs()));
- Assert(component < dof.get_fe(0).n_components(),
- ExcIndexRange(component, 0, dof.get_fe(0).n_components()));
+ AssertIndexRange(component, dof.get_fe(0).n_components());
FEValues<dim, spacedim> fe(mapping,
dof.get_fe(),
inline std::pair<unsigned int, unsigned int>
indices_from_component<1>(const unsigned int component_n, const bool)
{
- Assert(component_n < 1, ExcIndexRange(component_n, 0, 1));
+ AssertIndexRange(component_n, 1);
return std::make_pair(0u, 0u);
}
switch (dim)
{
case 3:
- Assert(zstep < n_subdivisions + 1,
- ExcIndexRange(zstep, 0, n_subdivisions + 1));
+ AssertIndexRange(zstep, n_subdivisions + 1);
point_no += (n_subdivisions + 1) * (n_subdivisions + 1) * zstep;
DEAL_II_FALLTHROUGH;
case 2:
- Assert(ystep < n_subdivisions + 1,
- ExcIndexRange(ystep, 0, n_subdivisions + 1));
+ AssertIndexRange(ystep, n_subdivisions + 1);
point_no += (n_subdivisions + 1) * ystep;
DEAL_II_FALLTHROUGH;
case 1:
- Assert(xstep < n_subdivisions + 1,
- ExcIndexRange(xstep, 0, n_subdivisions + 1));
+ AssertIndexRange(xstep, n_subdivisions + 1);
point_no += xstep;
DEAL_II_FALLTHROUGH;
case 0:
for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
neighbors[i] = no_neighbor;
- Assert(dim <= spacedim, ExcIndexRange(dim, 0, spacedim));
+ AssertIndexRange(dim, spacedim + 1);
Assert(spacedim <= 3, ExcNotImplemented());
}
projected_point = compute_node(first_patch, 0, 0, 0, n_subdivisions);
- Assert((flags.height_vector < first_patch.data.n_rows()) ||
- first_patch.data.n_rows() == 0,
- ExcIndexRange(flags.height_vector, 0, first_patch.data.n_rows()));
+ if (first_patch.data.n_rows() != 0)
+ {
+ AssertIndexRange(flags.height_vector, first_patch.data.n_rows());
+ }
double x_min = projected_point[0];
double x_max = x_min;
projected_point = compute_node(first_patch, 0, 0, 0, n_subdivisions);
- Assert((flags.height_vector < first_patch.data.n_rows()) ||
- first_patch.data.n_rows() == 0,
- ExcIndexRange(flags.height_vector, 0, first_patch.data.n_rows()));
+ if (first_patch.data.n_rows() != 0)
+ {
+ AssertIndexRange(flags.height_vector, first_patch.data.n_rows());
+ }
point[0] = projected_point[0];
point[1] = projected_point[1];
FlowFunction<dim>::value(const Point<dim> & point,
const unsigned int comp) const
{
- Assert(comp < dim + 1, ExcIndexRange(comp, 0, dim + 1));
+ AssertIndexRange(comp, dim + 1);
const unsigned int n_points = 1;
std::vector<Point<dim>> points(1);
points[0] = point;
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
return std::cos(fourier_coefficients * p);
}
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
return -fourier_coefficients * std::sin(fourier_coefficients * p);
}
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
return (fourier_coefficients * fourier_coefficients) *
(-std::cos(fourier_coefficients * p));
}
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
return std::sin(fourier_coefficients * p);
}
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
return fourier_coefficients * std::cos(fourier_coefficients * p);
}
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
return (fourier_coefficients * fourier_coefficients) *
(-std::sin(fourier_coefficients * p));
}
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
const unsigned int n = weights.size();
double sum = 0;
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
const unsigned int n = weights.size();
Tensor<1, dim> sum;
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
const unsigned int n = weights.size();
double sum = 0;
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
const unsigned int n = weights.size();
double sum = 0;
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
const unsigned int n = weights.size();
Tensor<1, dim> sum;
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
const unsigned int n = weights.size();
double sum = 0;
Monomial<dim>::value(const Point<dim> &p, const unsigned int component) const
{
(void)component;
- Assert(component < this->n_components,
- ExcIndexRange(component, 0, this->n_components));
+ AssertIndexRange(component, this->n_components);
double prod = 1;
for (unsigned int s = 0; s < dim; ++s)
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
Tensor<1, dim> r;
for (unsigned int d = 0; d < dim; ++d)
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
double sum = 0;
for (unsigned int monom = 0; monom < exponents.n_rows(); ++monom)
const unsigned int component) const
{
(void)component;
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(component, 1);
Tensor<1, dim> r;
{
Assert(values.size() == points.size(),
ExcDimensionMismatch(values.size(), points.size()));
- Assert(component < this->n_components,
- ExcIndexRange(component, 0, this->n_components));
+ AssertIndexRange(component, this->n_components);
if (this->selected == CutOffFunctionBase<dim>::no_component ||
const unsigned int component) const
{
Assert(initialized == true, ExcNotInitialized());
- Assert(component < this->n_components,
- ExcIndexRange(component, 0, this->n_components));
+ AssertIndexRange(component, this->n_components);
// initialize the parser if that hasn't happened yet on the current thread
if (fp.get().size() == 0)
if ((this == &other) && (offset == 0))
return;
- Assert(other.ranges.size() == 0 ||
- other.ranges.back().end - 1 < index_space_size,
- ExcIndexRangeType<size_type>(other.ranges.back().end - 1,
- 0,
- index_space_size));
+ if (other.ranges.size() != 0)
+ {
+ AssertIndexRange(other.ranges.back().end - 1, index_space_size);
+ }
compress();
other.compress();
for (const unsigned int destination : destinations)
{
(void)destination;
- Assert(destination < n_procs, ExcIndexRange(destination, 0, n_procs));
+ AssertIndexRange(destination, n_procs);
Assert(destination != myid,
ExcMessage(
"There is no point in communicating with ourselves."));
for (const unsigned int destination : destinations)
{
(void)destination;
- Assert(destination < n_procs, ExcIndexRange(destination, 0, n_procs));
+ AssertIndexRange(destination, n_procs);
Assert(destination != Utilities::MPI::this_mpi_process(mpi_comm),
ExcMessage(
"There is no point in communicating with ourselves."));
const unsigned int support_point,
std::vector<double> &a)
{
- Assert(support_point < n + 1, ExcIndexRange(support_point, 0, n + 1));
+ AssertIndexRange(support_point, n + 1);
unsigned int n_functions = n + 1;
- Assert(support_point < n_functions,
- ExcIndexRange(support_point, 0, n_functions));
+ AssertIndexRange(support_point, n_functions);
double const *x = nullptr;
switch (n)
std::array<unsigned int, 1>
PolynomialSpace<1>::compute_index(const unsigned int i) const
{
- Assert(i < index_map.size(), ExcIndexRange(i, 0, index_map.size()));
+ AssertIndexRange(i, index_map.size());
return {{index_map[i]}};
}
std::array<unsigned int, 2>
PolynomialSpace<2>::compute_index(const unsigned int i) const
{
- Assert(i < index_map.size(), ExcIndexRange(i, 0, index_map.size()));
+ AssertIndexRange(i, index_map.size());
const unsigned int n = index_map[i];
// there should be a better way to
// write this function (not
std::array<unsigned int, 3>
PolynomialSpace<3>::compute_index(const unsigned int i) const
{
- Assert(i < index_map.size(), ExcIndexRange(i, 0, index_map.size()));
+ AssertIndexRange(i, index_map.size());
const unsigned int n = index_map[i];
// there should be a better way to
// write this function (not
QProjector<dim>::project_to_child(const Quadrature<dim> &quadrature,
const unsigned int child_no)
{
- Assert(child_no < GeometryInfo<dim>::max_children_per_cell,
- ExcIndexRange(child_no, 0, GeometryInfo<dim>::max_children_per_cell));
+ AssertIndexRange(child_no, GeometryInfo<dim>::max_children_per_cell);
const unsigned int n_q_points = quadrature.size();
// general one, you should use the
// one with the Point<2> in the
// constructor.
- Assert(vertex_index < 4, ExcIndexRange(vertex_index, 0, 4));
+ AssertIndexRange(vertex_index, 4);
// Start with the gauss quadrature formula on the (u,v) reference
// element.
// quadrilateral. We are planning to do this also for the support
// points of arbitrary FE_Q elements, to allow the use of this
// class in boundary element programs with higher order mappings.
- Assert(vertex_index < 4, ExcIndexRange(vertex_index, 0, 4));
+ AssertIndexRange(vertex_index, 4);
// We create only the first one. All other pieces are rotation of
// this one.
for (unsigned int i = 0; i < n; ++i)
{
- Assert(permutation[i] < n, ExcIndexRange(permutation[i], 0, n));
+ AssertIndexRange(permutation[i], n);
out[permutation[i]] = i;
}
for (unsigned long long int i = 0; i < n; ++i)
{
- Assert(permutation[i] < n, ExcIndexRange(permutation[i], 0, n));
+ AssertIndexRange(permutation[i], n);
out[permutation[i]] = i;
}
for (unsigned int i = 0; i < n; ++i)
{
- Assert(permutation[i] < n, ExcIndexRange(permutation[i], 0, n));
+ AssertIndexRange(permutation[i], n);
out[permutation[i]] = i;
}
Triangulation<dim, spacedim>::coarse_cell_index_to_coarse_cell_id(
const unsigned int coarse_cell_index) const
{
- Assert(coarse_cell_index <
- coarse_cell_index_to_coarse_cell_id_vector.size(),
- ExcIndexRange(coarse_cell_index,
- 0,
- coarse_cell_index_to_coarse_cell_id_vector.size()));
+ AssertIndexRange(coarse_cell_index,
+ coarse_cell_index_to_coarse_cell_id_vector.size());
const auto coarse_cell_id =
coarse_cell_index_to_coarse_cell_id_vector[coarse_cell_index];
{
static const int space_dim = DoFHandlerType::space_dimension;
(void)space_dim;
- Assert(0 <= direction && direction < space_dim,
- ExcIndexRange(direction, 0, space_dim));
+ AssertIndexRange(direction, space_dim);
Assert(b_id1 != b_id2,
ExcMessage("The boundary indicators b_id1 and b_id2 must be "
(void)dim;
(void)space_dim;
- Assert(0 <= direction && direction < space_dim,
- ExcIndexRange(direction, 0, space_dim));
+ AssertIndexRange(direction, space_dim);
Assert(dim == space_dim, ExcNotImplemented());
const unsigned int child,
const RefinementCase<dim> &refinement_case) const
{
- Assert(refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
+ AssertIndexRange(refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
Assert(refinement_case != RefinementCase<dim>::no_refinement,
ExcMessage(
"Restriction matrices are only available for refined cells!"));
- Assert(child <
- GeometryInfo<dim>::n_children(RefinementCase<dim>(refinement_case)),
- ExcIndexRange(child,
- 0,
- GeometryInfo<dim>::n_children(
- RefinementCase<dim>(refinement_case))));
+ AssertIndexRange(
+ child, GeometryInfo<dim>::n_children(RefinementCase<dim>(refinement_case)));
// we use refinement_case-1 here. the -1 takes care of the origin of the
// vector, as for RefinementCase<dim>::no_refinement (=0) there is no data
// available and so the vector indices are shifted
const unsigned int child,
const RefinementCase<dim> &refinement_case) const
{
- Assert(refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
+ AssertIndexRange(refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
Assert(refinement_case != RefinementCase<dim>::no_refinement,
ExcMessage(
"Prolongation matrices are only available for refined cells!"));
- Assert(child <
- GeometryInfo<dim>::n_children(RefinementCase<dim>(refinement_case)),
- ExcIndexRange(child,
- 0,
- GeometryInfo<dim>::n_children(
- RefinementCase<dim>(refinement_case))));
+ AssertIndexRange(
+ child, GeometryInfo<dim>::n_children(RefinementCase<dim>(refinement_case)));
// we use refinement_case-1 here. the -1 takes care
// of the origin of the vector, as for
// RefinementCase::no_refinement (=0) there is no
FiniteElement<dim, spacedim>::component_to_block_index(
const unsigned int index) const
{
- Assert(index < this->n_components(),
- ExcIndexRange(index, 0, this->n_components()));
+ AssertIndexRange(index, this->n_components());
return first_block_of_base(component_to_base_table[index].first.first) +
component_to_base_table[index].second;
const bool face_flip,
const bool face_rotation) const
{
- Assert(face_index < this->dofs_per_face,
- ExcIndexRange(face_index, 0, this->dofs_per_face));
- Assert(face < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(face_index, this->dofs_per_face);
+ AssertIndexRange(face, GeometryInfo<dim>::faces_per_cell);
// TODO: we could presumably solve the 3d case below using the
// adjust_quad_dof_index_for_face_orientation_table field. for the
// in 3d), so we don't need the table, but
// the function should also not have been
// called
- Assert(index < this->dofs_per_quad,
- ExcIndexRange(index, 0, this->dofs_per_quad));
+ AssertIndexRange(index, this->dofs_per_quad);
Assert(adjust_quad_dof_index_for_face_orientation_table.n_elements() ==
8 * this->dofs_per_quad,
ExcInternalError());
if (dim < 3)
return index;
- Assert(index < this->dofs_per_line,
- ExcIndexRange(index, 0, this->dofs_per_line));
+ AssertIndexRange(index, this->dofs_per_line);
Assert(adjust_line_dof_index_for_line_orientation_table.size() ==
this->dofs_per_line,
ExcInternalError());
Point<dim>
FiniteElement<dim, spacedim>::unit_support_point(const unsigned int index) const
{
- Assert(index < this->dofs_per_cell,
- ExcIndexRange(index, 0, this->dofs_per_cell));
+ AssertIndexRange(index, this->dofs_per_cell);
Assert(unit_support_points.size() == this->dofs_per_cell,
ExcFEHasNoSupportPoints());
return unit_support_points[index];
FiniteElement<dim, spacedim>::unit_face_support_point(
const unsigned int index) const
{
- Assert(index < this->dofs_per_face,
- ExcIndexRange(index, 0, this->dofs_per_face));
+ AssertIndexRange(index, this->dofs_per_face);
Assert(unit_face_support_points.size() == this->dofs_per_face,
ExcFEHasNoSupportPoints());
return unit_face_support_points[index];
FiniteElement<dim, spacedim>::base_element(const unsigned int index) const
{
(void)index;
- Assert(index == 0, ExcIndexRange(index, 0, 1));
+ AssertIndexRange(index, 1);
// This function should not be
// called for a system element
Assert(base_to_block_indices.size() == 1, ExcInternalError());
FE_ABF<dim>::has_support_on_face(const unsigned int shape_index,
const unsigned int face_index) const
{
- Assert(shape_index < this->dofs_per_cell,
- ExcIndexRange(shape_index, 0, this->dofs_per_cell));
- Assert(face_index < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_index, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(shape_index, this->dofs_per_cell);
+ AssertIndexRange(face_index, GeometryInfo<dim>::faces_per_cell);
// Return computed values if we
// know them easily. Otherwise, it
{
(void)i;
(void)p;
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
AssertThrow(false,
(typename FiniteElement<dim>::ExcUnitShapeValuesDoNotExist()));
return 0;
(void)i;
(void)p;
(void)component;
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, 1);
AssertThrow(false,
(typename FiniteElement<dim>::ExcUnitShapeValuesDoNotExist()));
return 0;
{
(void)i;
(void)p;
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
AssertThrow(false,
(typename FiniteElement<dim>::ExcUnitShapeValuesDoNotExist()));
return Tensor<1, dim>();
(void)i;
(void)p;
(void)component;
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, 1);
AssertThrow(false,
(typename FiniteElement<dim>::ExcUnitShapeValuesDoNotExist()));
return Tensor<1, dim>();
{
(void)i;
(void)p;
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
AssertThrow(false,
(typename FiniteElement<dim>::ExcUnitShapeValuesDoNotExist()));
return Tensor<2, dim>();
(void)i;
(void)p;
(void)component;
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component == 0, ExcIndexRange(component, 0, 1));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, 1);
AssertThrow(false,
(typename FiniteElement<dim>::ExcUnitShapeValuesDoNotExist()));
return Tensor<2, dim>();
const unsigned int child,
const RefinementCase<dim> &refinement_case) const
{
- Assert(refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
+ AssertIndexRange(refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
Assert(refinement_case != RefinementCase<dim>::no_refinement,
ExcMessage(
"Prolongation matrices are only available for refined cells!"));
- Assert(child < GeometryInfo<dim>::n_children(refinement_case),
- ExcIndexRange(child,
- 0,
- GeometryInfo<dim>::n_children(refinement_case)));
+ AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
// initialization upon first request
if (this->prolongation[refinement_case - 1][child].n() == 0)
const unsigned int child,
const RefinementCase<dim> &refinement_case) const
{
- Assert(refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
+ AssertIndexRange(refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
Assert(refinement_case != RefinementCase<dim>::no_refinement,
ExcMessage(
"Restriction matrices are only available for refined cells!"));
- Assert(child < GeometryInfo<dim>::n_children(refinement_case),
- ExcIndexRange(child,
- 0,
- GeometryInfo<dim>::n_children(refinement_case)));
+ AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
// initialization upon first request
if (this->restriction[refinement_case - 1][child].n() == 0)
FE_DGQ<dim, spacedim>::has_support_on_face(const unsigned int shape_index,
const unsigned int face_index) const
{
- Assert(shape_index < this->dofs_per_cell,
- ExcIndexRange(shape_index, 0, this->dofs_per_cell));
- Assert(face_index < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_index, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(shape_index, this->dofs_per_cell);
+ AssertIndexRange(face_index, GeometryInfo<dim>::faces_per_cell);
unsigned int n = this->degree + 1;
FE_Nedelec<dim>::has_support_on_face(const unsigned int shape_index,
const unsigned int face_index) const
{
- Assert(shape_index < this->dofs_per_cell,
- ExcIndexRange(shape_index, 0, this->dofs_per_cell));
- Assert(face_index < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_index, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(shape_index, this->dofs_per_cell);
+ AssertIndexRange(face_index, GeometryInfo<dim>::faces_per_cell);
const unsigned int deg = this->degree - 1;
switch (dim)
const unsigned int child,
const RefinementCase<dim> &refinement_case) const
{
- Assert(refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
+ AssertIndexRange(refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
Assert(refinement_case != RefinementCase<dim>::no_refinement,
ExcMessage(
"Prolongation matrices are only available for refined cells!"));
- Assert(child < GeometryInfo<dim>::n_children(refinement_case),
- ExcIndexRange(child,
- 0,
- GeometryInfo<dim>::n_children(refinement_case)));
+ AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
// initialization upon first request
if (this->prolongation[refinement_case - 1][child].n() == 0)
const unsigned int child,
const RefinementCase<dim> &refinement_case) const
{
- Assert(refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
+ AssertIndexRange(refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
Assert(refinement_case != RefinementCase<dim>::no_refinement,
ExcMessage(
"Restriction matrices are only available for refined cells!"));
- Assert(child <
- GeometryInfo<dim>::n_children(RefinementCase<dim>(refinement_case)),
- ExcIndexRange(child,
- 0,
- GeometryInfo<dim>::n_children(
- RefinementCase<dim>(refinement_case))));
+ AssertIndexRange(
+ child, GeometryInfo<dim>::n_children(RefinementCase<dim>(refinement_case)));
// initialization upon first request
if (this->restriction[refinement_case - 1][child].n() == 0)
if (single_mapping_kind())
return mapping_kind[0];
- Assert(i < mapping_kind.size(), ExcIndexRange(i, 0, mapping_kind.size()));
+ AssertIndexRange(i, mapping_kind.size());
return mapping_kind[i];
}
const Point<dim> & p,
const unsigned int component) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component < dim, ExcIndexRange(component, 0, dim));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, dim);
std::lock_guard<std::mutex> lock(cache_mutex);
const Point<dim> & p,
const unsigned int component) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component < dim, ExcIndexRange(component, 0, dim));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, dim);
std::lock_guard<std::mutex> lock(cache_mutex);
const Point<dim> & p,
const unsigned int component) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component < dim, ExcIndexRange(component, 0, dim));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, dim);
std::lock_guard<std::mutex> lock(cache_mutex);
const bool face_flip,
const bool face_rotation) const
{
- Assert(face_index < this->dofs_per_face,
- ExcIndexRange(face_index, 0, this->dofs_per_face));
- Assert(face < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(face_index, this->dofs_per_face);
+ AssertIndexRange(face, GeometryInfo<dim>::faces_per_cell);
// TODO: we could presumably solve the 3d case below using the
// adjust_quad_dof_index_for_face_orientation_table field. for the
const unsigned int child,
const RefinementCase<dim> &refinement_case) const
{
- Assert(refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
+ AssertIndexRange(refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
Assert(refinement_case != RefinementCase<dim>::no_refinement,
ExcMessage(
"Prolongation matrices are only available for refined cells!"));
- Assert(child < GeometryInfo<dim>::n_children(refinement_case),
- ExcIndexRange(child,
- 0,
- GeometryInfo<dim>::n_children(refinement_case)));
+ AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
// initialization upon first request
if (this->prolongation[refinement_case - 1][child].n() == 0)
const unsigned int child,
const RefinementCase<dim> &refinement_case) const
{
- Assert(refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
+ AssertIndexRange(refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
Assert(refinement_case != RefinementCase<dim>::no_refinement,
ExcMessage(
"Restriction matrices are only available for refined cells!"));
- Assert(child < GeometryInfo<dim>::n_children(refinement_case),
- ExcIndexRange(child,
- 0,
- GeometryInfo<dim>::n_children(refinement_case)));
+ AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
// initialization upon first request
if (this->restriction[refinement_case - 1][child].n() == 0)
const unsigned int shape_index,
const unsigned int face_index) const
{
- Assert(shape_index < this->dofs_per_cell,
- ExcIndexRange(shape_index, 0, this->dofs_per_cell));
- Assert(face_index < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_index, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(shape_index, this->dofs_per_cell);
+ AssertIndexRange(face_index, GeometryInfo<dim>::faces_per_cell);
// in 1d, things are simple. since there is only one degree of freedom per
// vertex in this class, the first is on vertex 0 (==face 0 in some sense),
const unsigned int child,
const RefinementCase<dim> &refinement_case) const
{
- Assert(refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
+ AssertIndexRange(refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
Assert(refinement_case != RefinementCase<dim>::no_refinement,
ExcMessage(
"Prolongation matrices are only available for refined cells!"));
- Assert(child < GeometryInfo<dim>::n_children(refinement_case),
- ExcIndexRange(child,
- 0,
- GeometryInfo<dim>::n_children(refinement_case)));
+ AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
Assert(this->prolongation[refinement_case - 1][child].n() != 0,
ExcMessage("This prolongation matrix has not been computed yet!"));
const unsigned int child,
const RefinementCase<dim> &refinement_case) const
{
- Assert(refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
+ AssertIndexRange(refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
Assert(refinement_case != RefinementCase<dim>::no_refinement,
ExcMessage(
"Restriction matrices are only available for refined cells!"));
- Assert(child < GeometryInfo<dim>::n_children(refinement_case),
- ExcIndexRange(child,
- 0,
- GeometryInfo<dim>::n_children(refinement_case)));
+ AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
Assert(this->restriction[refinement_case - 1][child].n() != 0,
ExcMessage("This restriction matrix has not been computed yet!"));
std::vector<unsigned int> out(in.size());
for (unsigned int i = 0; i < in.size(); ++i)
{
- Assert(in[i] < out.size(),
- dealii::ExcIndexRange(in[i], 0, out.size()));
+ AssertIndexRange(in[i], out.size());
out[in[i]] = i;
}
return out;
ExcMessage(
"Prolongation matrices are only available for isotropic refinement!"));
- Assert(child < GeometryInfo<dim>::n_children(refinement_case),
- ExcIndexRange(child,
- 0,
- GeometryInfo<dim>::n_children(refinement_case)));
+ AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
return this->prolongation[refinement_case - 1][child];
}
FE_Q_Hierarchical<1>::has_support_on_face(const unsigned int shape_index,
const unsigned int face_index) const
{
- Assert(shape_index < this->dofs_per_cell,
- ExcIndexRange(shape_index, 0, this->dofs_per_cell));
- Assert(face_index < GeometryInfo<1>::faces_per_cell,
- ExcIndexRange(face_index, 0, GeometryInfo<1>::faces_per_cell));
+ AssertIndexRange(shape_index, this->dofs_per_cell);
+ AssertIndexRange(face_index, GeometryInfo<1>::faces_per_cell);
// in 1d, things are simple. since
FE_Q_Hierarchical<dim>::has_support_on_face(const unsigned int shape_index,
const unsigned int face_index) const
{
- Assert(shape_index < this->dofs_per_cell,
- ExcIndexRange(shape_index, 0, this->dofs_per_cell));
- Assert(face_index < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_index, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(shape_index, this->dofs_per_cell);
+ AssertIndexRange(face_index, GeometryInfo<dim>::faces_per_cell);
// first, special-case interior
// shape functions, since they
FE_RaviartThomas<dim>::has_support_on_face(const unsigned int shape_index,
const unsigned int face_index) const
{
- Assert(shape_index < this->dofs_per_cell,
- ExcIndexRange(shape_index, 0, this->dofs_per_cell));
- Assert(face_index < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_index, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(shape_index, this->dofs_per_cell);
+ AssertIndexRange(face_index, GeometryInfo<dim>::faces_per_cell);
// Return computed values if we
// know them easily. Otherwise, it
const unsigned int shape_index,
const unsigned int face_index) const
{
- Assert(shape_index < this->dofs_per_cell,
- ExcIndexRange(shape_index, 0, this->dofs_per_cell));
- Assert(face_index < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_index, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(shape_index, this->dofs_per_cell);
+ AssertIndexRange(face_index, GeometryInfo<dim>::faces_per_cell);
// The first degrees of freedom are
// on the faces and each face has
FESystem<dim, spacedim>::InternalData::get_fe_data(
const unsigned int base_no) const
{
- Assert(base_no < base_fe_datas.size(),
- ExcIndexRange(base_no, 0, base_fe_datas.size()));
+ AssertIndexRange(base_no, base_fe_datas.size());
return *base_fe_datas[base_no];
}
const unsigned int base_no,
std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase> ptr)
{
- Assert(base_no < base_fe_datas.size(),
- ExcIndexRange(base_no, 0, base_fe_datas.size()));
+ AssertIndexRange(base_no, base_fe_datas.size());
base_fe_datas[base_no] = std::move(ptr);
}
FESystem<dim, spacedim>::InternalData::get_fe_output_object(
const unsigned int base_no) const
{
- Assert(base_no < base_fe_output_objects.size(),
- ExcIndexRange(base_no, 0, base_fe_output_objects.size()));
+ AssertIndexRange(base_no, base_fe_output_objects.size());
return base_fe_output_objects[base_no];
}
FESystem<dim, spacedim>::shape_value(const unsigned int i,
const Point<dim> & p) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
Assert(this->is_primitive(i),
(typename FiniteElement<dim, spacedim>::ExcShapeFunctionNotPrimitive(
i)));
const Point<dim> & p,
const unsigned int component) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component < this->n_components(),
- ExcIndexRange(component, 0, this->n_components()));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, this->n_components());
// if this value is supposed to be
// zero, then return right away...
FESystem<dim, spacedim>::shape_grad(const unsigned int i,
const Point<dim> & p) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
Assert(this->is_primitive(i),
(typename FiniteElement<dim, spacedim>::ExcShapeFunctionNotPrimitive(
i)));
const Point<dim> & p,
const unsigned int component) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component < this->n_components(),
- ExcIndexRange(component, 0, this->n_components()));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, this->n_components());
// if this value is supposed to be zero, then return right away...
if (this->nonzero_components[i][component] == false)
FESystem<dim, spacedim>::shape_grad_grad(const unsigned int i,
const Point<dim> & p) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
Assert(this->is_primitive(i),
(typename FiniteElement<dim, spacedim>::ExcShapeFunctionNotPrimitive(
i)));
const Point<dim> & p,
const unsigned int component) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component < this->n_components(),
- ExcIndexRange(component, 0, this->n_components()));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, this->n_components());
// if this value is supposed to be zero, then return right away...
if (this->nonzero_components[i][component] == false)
FESystem<dim, spacedim>::shape_3rd_derivative(const unsigned int i,
const Point<dim> & p) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
Assert(this->is_primitive(i),
(typename FiniteElement<dim, spacedim>::ExcShapeFunctionNotPrimitive(
i)));
const Point<dim> & p,
const unsigned int component) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component < this->n_components(),
- ExcIndexRange(component, 0, this->n_components()));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, this->n_components());
// if this value is supposed to be zero, then return right away...
if (this->nonzero_components[i][component] == false)
FESystem<dim, spacedim>::shape_4th_derivative(const unsigned int i,
const Point<dim> & p) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
+ AssertIndexRange(i, this->dofs_per_cell);
Assert(this->is_primitive(i),
(typename FiniteElement<dim, spacedim>::ExcShapeFunctionNotPrimitive(
i)));
const Point<dim> & p,
const unsigned int component) const
{
- Assert(i < this->dofs_per_cell, ExcIndexRange(i, 0, this->dofs_per_cell));
- Assert(component < this->n_components(),
- ExcIndexRange(component, 0, this->n_components()));
+ AssertIndexRange(i, this->dofs_per_cell);
+ AssertIndexRange(component, this->n_components());
// if this value is supposed to be zero, then return right away...
if (this->nonzero_components[i][component] == false)
const unsigned int child,
const RefinementCase<dim> &refinement_case) const
{
- Assert(refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
+ AssertIndexRange(refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
Assert(refinement_case != RefinementCase<dim>::no_refinement,
ExcMessage(
"Restriction matrices are only available for refined cells!"));
- Assert(child < GeometryInfo<dim>::n_children(refinement_case),
- ExcIndexRange(child,
- 0,
- GeometryInfo<dim>::n_children(refinement_case)));
+ AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
// initialization upon first request
if (this->restriction[refinement_case - 1][child].n() == 0)
const unsigned int child,
const RefinementCase<dim> &refinement_case) const
{
- Assert(refinement_case < RefinementCase<dim>::isotropic_refinement + 1,
- ExcIndexRange(refinement_case,
- 0,
- RefinementCase<dim>::isotropic_refinement + 1));
+ AssertIndexRange(refinement_case,
+ RefinementCase<dim>::isotropic_refinement + 1);
Assert(refinement_case != RefinementCase<dim>::no_refinement,
ExcMessage(
"Restriction matrices are only available for refined cells!"));
- Assert(child < GeometryInfo<dim>::n_children(refinement_case),
- ExcIndexRange(child,
- 0,
- GeometryInfo<dim>::n_children(refinement_case)));
+ AssertIndexRange(child, GeometryInfo<dim>::n_children(refinement_case));
// initialization upon first request, construction completely analogous to
// restriction matrix
const FiniteElement<dim, spacedim> &
FESystem<dim, spacedim>::base_element(const unsigned int index) const
{
- Assert(index < base_elements.size(),
- ExcIndexRange(index, 0, base_elements.size()));
+ AssertIndexRange(index, base_elements.size());
return *base_elements[index].first;
}
Point<dim>
FESystem<dim, spacedim>::unit_support_point(const unsigned int index) const
{
- Assert(index < this->dofs_per_cell,
- ExcIndexRange(index, 0, this->dofs_per_cell));
+ AssertIndexRange(index, this->dofs_per_cell);
Assert((this->unit_support_points.size() == this->dofs_per_cell) ||
(this->unit_support_points.size() == 0),
(typename FiniteElement<dim, spacedim>::ExcFEHasNoSupportPoints()));
Point<dim - 1>
FESystem<dim, spacedim>::unit_face_support_point(const unsigned int index) const
{
- Assert(index < this->dofs_per_face,
- ExcIndexRange(index, 0, this->dofs_per_face));
+ AssertIndexRange(index, this->dofs_per_face);
Assert((this->unit_face_support_points.size() == this->dofs_per_face) ||
(this->unit_face_support_points.size() == 0),
(typename FiniteElement<dim, spacedim>::ExcFEHasNoSupportPoints()));
const unsigned int shape_index,
const unsigned int face_index) const
{
- Assert(shape_index < this->dofs_per_cell,
- ExcIndexRange(shape_index, 0, this->dofs_per_cell));
- Assert(face_index < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_index, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(shape_index, this->dofs_per_cell);
+ AssertIndexRange(face_index, GeometryInfo<dim>::faces_per_cell);
// FE_TraceQ shares the numbering of elemental degrees of freedom with FE_Q
// except for the missing interior ones (quad dofs in 2D and hex dofs in
, shape_function_data(this->fe_values->fe->dofs_per_cell)
{
const FiniteElement<dim, spacedim> &fe = *this->fe_values->fe;
- Assert(component < fe.n_components(),
- ExcIndexRange(component, 0, fe.n_components()));
+ AssertIndexRange(component, fe.n_components());
// TODO: we'd like to use the fields with the same name as these
// variables from FEValuesBase, but they aren't initialized yet
, shape_function_data(this->fe_values->fe->dofs_per_cell)
{
const FiniteElement<dim, spacedim> &fe = *this->fe_values->fe;
- Assert(first_vector_component + spacedim - 1 < fe.n_components(),
- ExcIndexRange(first_vector_component + spacedim - 1,
- 0,
- fe.n_components()));
+ AssertIndexRange(first_vector_component + spacedim - 1, fe.n_components());
// TODO: we'd like to use the fields with the same name as these
// variables from FEValuesBase, but they aren't initialized yet
, shape_function_data(this->fe_values->fe->dofs_per_cell)
{
const FiniteElement<dim, spacedim> &fe = *this->fe_values->fe;
- Assert(first_tensor_component + dim * dim - 1 < fe.n_components(),
- ExcIndexRange(first_tensor_component + dim * dim - 1,
- 0,
- fe.n_components()));
+ AssertIndexRange(first_tensor_component + dim * dim - 1, fe.n_components());
// TODO: we'd like to use the fields with the same name as these
// variables from FEValuesBase, but they aren't initialized yet
// at the time we get here, so re-create it all
cell->get_dof_handler().get_fe(cell->active_fe_index())),
(typename FEValuesBase<dim, spacedim>::ExcFEDontMatch()));
- Assert(face_no < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_no, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(face_no, GeometryInfo<dim>::faces_per_cell);
this->maybe_invalidate_previous_present_cell(cell);
reset_pointer_in_place_if_possible<
const typename Triangulation<dim, spacedim>::cell_iterator &cell,
const unsigned int face_no)
{
- Assert(face_no < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_no, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(face_no, GeometryInfo<dim>::faces_per_cell);
this->maybe_invalidate_previous_present_cell(cell);
reset_pointer_in_place_if_possible<
static_cast<const FiniteElementData<dim> &>(
cell->get_dof_handler().get_fe(cell->active_fe_index())),
(typename FEValuesBase<dim, spacedim>::ExcFEDontMatch()));
- Assert(face_no < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_no, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(face_no, GeometryInfo<dim>::faces_per_cell);
// We would like to check for subface_no < cell->face(face_no)->n_children(),
// but unfortunately the current function is also called for
// faces without children (see tests/fe/mapping.cc). Therefore,
const unsigned int face_no,
const unsigned int subface_no)
{
- Assert(face_no < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(face_no, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(face_no, GeometryInfo<dim>::faces_per_cell);
// We would like to check for subface_no < cell->face(face_no)->n_children(),
// but unfortunately the current function is also called for
// faces without children for periodic faces, which have hanging nodes on
- // the other side (see
- // include/deal.II/matrix_free/mapping_info.templates.h).
- Assert(subface_no < cell->face(face_no)->n_children() ||
- (cell->has_periodic_neighbor(face_no) &&
- subface_no < cell->periodic_neighbor(face_no)
- ->face(cell->periodic_neighbor_face_no(face_no))
- ->n_children()),
- ExcIndexRange(subface_no,
- 0,
- (cell->has_periodic_neighbor(face_no) ?
- cell->periodic_neighbor(face_no)
- ->face(cell->periodic_neighbor_face_no(face_no))
- ->n_children() :
- cell->face(face_no)->n_children())));
+ // the other side (see include/deal.II/matrix_free/mapping_info.templates.h).
+ AssertIndexRange(subface_no,
+ (cell->has_periodic_neighbor(face_no) ?
+ cell->periodic_neighbor(face_no)
+ ->face(cell->periodic_neighbor_face_no(face_no))
+ ->n_children() :
+ cell->face(face_no)->n_children()));
this->maybe_invalidate_previous_present_cell(cell);
reset_pointer_in_place_if_possible<
const unsigned int qpoint,
const unsigned int shape_nr)
{
- Assert(qpoint * n_shape_functions + shape_nr < shape_values.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_values.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr, shape_values.size());
return shape_values[qpoint * n_shape_functions + shape_nr];
}
MappingFEField<dim, spacedim, DoFHandlerType, VectorType>::InternalData::
derivative(const unsigned int qpoint, const unsigned int shape_nr) const
{
- Assert(qpoint * n_shape_functions + shape_nr < shape_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_derivatives.size());
return shape_derivatives[qpoint * n_shape_functions + shape_nr];
}
MappingFEField<dim, spacedim, DoFHandlerType, VectorType>::InternalData::
derivative(const unsigned int qpoint, const unsigned int shape_nr)
{
- Assert(qpoint * n_shape_functions + shape_nr < shape_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_derivatives.size());
return shape_derivatives[qpoint * n_shape_functions + shape_nr];
}
second_derivative(const unsigned int qpoint,
const unsigned int shape_nr) const
{
- Assert(qpoint * n_shape_functions + shape_nr <
- shape_second_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_second_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_second_derivatives.size());
return shape_second_derivatives[qpoint * n_shape_functions + shape_nr];
}
MappingFEField<dim, spacedim, DoFHandlerType, VectorType>::InternalData::
second_derivative(const unsigned int qpoint, const unsigned int shape_nr)
{
- Assert(qpoint * n_shape_functions + shape_nr <
- shape_second_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_second_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_second_derivatives.size());
return shape_second_derivatives[qpoint * n_shape_functions + shape_nr];
}
MappingFEField<dim, spacedim, DoFHandlerType, VectorType>::InternalData::
third_derivative(const unsigned int qpoint, const unsigned int shape_nr) const
{
- Assert(qpoint * n_shape_functions + shape_nr < shape_third_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_third_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_third_derivatives.size());
return shape_third_derivatives[qpoint * n_shape_functions + shape_nr];
}
MappingFEField<dim, spacedim, DoFHandlerType, VectorType>::InternalData::
third_derivative(const unsigned int qpoint, const unsigned int shape_nr)
{
- Assert(qpoint * n_shape_functions + shape_nr < shape_third_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_third_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_third_derivatives.size());
return shape_third_derivatives[qpoint * n_shape_functions + shape_nr];
}
fourth_derivative(const unsigned int qpoint,
const unsigned int shape_nr) const
{
- Assert(qpoint * n_shape_functions + shape_nr <
- shape_fourth_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_fourth_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_fourth_derivatives.size());
return shape_fourth_derivatives[qpoint * n_shape_functions + shape_nr];
}
MappingFEField<dim, spacedim, DoFHandlerType, VectorType>::InternalData::
fourth_derivative(const unsigned int qpoint, const unsigned int shape_nr)
{
- Assert(qpoint * n_shape_functions + shape_nr <
- shape_fourth_derivatives.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_fourth_derivatives.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr,
+ shape_fourth_derivatives.size());
return shape_fourth_derivatives[qpoint * n_shape_functions + shape_nr];
}
const unsigned int qpoint,
const unsigned int shape_nr) const
{
- Assert(qpoint * n_shape_functions + shape_nr < shape_values.size(),
- ExcIndexRange(qpoint * n_shape_functions + shape_nr,
- 0,
- shape_values.size()));
+ AssertIndexRange(qpoint * n_shape_functions + shape_nr, shape_values.size());
return shape_values[qpoint * n_shape_functions + shape_nr];
}
{
Assert((inner_radius > 0) && (inner_radius < outer_radius),
ExcInvalidRadii());
+ AssertIndexRange(n, 5);
- if (n <= 5)
- {
- // These are for the two lower squares
- const double d = outer_radius / std::sqrt(2.0);
- const double a = inner_radius / std::sqrt(2.0);
- // These are for the two upper square
- const double b = a / 2.0;
- const double c = d / 2.0;
- // And so are these
- const double hb = inner_radius * std::sqrt(3.0) / 2.0;
- const double hc = outer_radius * std::sqrt(3.0) / 2.0;
-
- Point<3> vertices[16] = {
- center + Point<3>(0, d, -d),
- center + Point<3>(0, -d, -d),
- center + Point<3>(0, a, -a),
- center + Point<3>(0, -a, -a),
- center + Point<3>(0, a, a),
- center + Point<3>(0, -a, a),
- center + Point<3>(0, d, d),
- center + Point<3>(0, -d, d),
-
- center + Point<3>(hc, c, -c),
- center + Point<3>(hc, -c, -c),
- center + Point<3>(hb, b, -b),
- center + Point<3>(hb, -b, -b),
- center + Point<3>(hb, b, b),
- center + Point<3>(hb, -b, b),
- center + Point<3>(hc, c, c),
- center + Point<3>(hc, -c, c),
- };
+ // These are for the two lower squares
+ const double d = outer_radius / std::sqrt(2.0);
+ const double a = inner_radius / std::sqrt(2.0);
+ // These are for the two upper square
+ const double b = a / 2.0;
+ const double c = d / 2.0;
+ // And so are these
+ const double hb = inner_radius * std::sqrt(3.0) / 2.0;
+ const double hc = outer_radius * std::sqrt(3.0) / 2.0;
- int cell_vertices[5][8] = {{0, 1, 8, 9, 2, 3, 10, 11},
- {0, 2, 8, 10, 6, 4, 14, 12},
- {1, 7, 9, 15, 3, 5, 11, 13},
- {6, 4, 14, 12, 7, 5, 15, 13},
- {8, 10, 9, 11, 14, 12, 15, 13}};
+ Point<3> vertices[16] = {
+ center + Point<3>(0, d, -d),
+ center + Point<3>(0, -d, -d),
+ center + Point<3>(0, a, -a),
+ center + Point<3>(0, -a, -a),
+ center + Point<3>(0, a, a),
+ center + Point<3>(0, -a, a),
+ center + Point<3>(0, d, d),
+ center + Point<3>(0, -d, d),
- std::vector<CellData<3>> cells(5, CellData<3>());
+ center + Point<3>(hc, c, -c),
+ center + Point<3>(hc, -c, -c),
+ center + Point<3>(hb, b, -b),
+ center + Point<3>(hb, -b, -b),
+ center + Point<3>(hb, b, b),
+ center + Point<3>(hb, -b, b),
+ center + Point<3>(hc, c, c),
+ center + Point<3>(hc, -c, c),
+ };
- for (unsigned int i = 0; i < 5; ++i)
- {
- for (unsigned int j = 0; j < 8; ++j)
- cells[i].vertices[j] = cell_vertices[i][j];
- cells[i].material_id = 0;
- }
+ int cell_vertices[5][8] = {{0, 1, 8, 9, 2, 3, 10, 11},
+ {0, 2, 8, 10, 6, 4, 14, 12},
+ {1, 7, 9, 15, 3, 5, 11, 13},
+ {6, 4, 14, 12, 7, 5, 15, 13},
+ {8, 10, 9, 11, 14, 12, 15, 13}};
- tria.create_triangulation(std::vector<Point<3>>(std::begin(vertices),
- std::end(vertices)),
- cells,
- SubCellData()); // no boundary information
- }
- else
+ std::vector<CellData<3>> cells(5, CellData<3>());
+
+ for (unsigned int i = 0; i < 5; ++i)
{
- Assert(false, ExcIndexRange(n, 0, 5));
+ for (unsigned int j = 0; j < 8; ++j)
+ cells[i].vertices[j] = cell_vertices[i][j];
+ cells[i].material_id = 0;
}
+
+ tria.create_triangulation(std::vector<Point<3>>(std::begin(vertices),
+ std::end(vertices)),
+ cells,
+ SubCellData()); // no boundary information
+
if (colorize)
{
// We want to use a standard boundary description where
std::numeric_limits<types::material_id>::max()));
// we use only material_ids in the range from 0 to
// numbers::invalid_material_id-1
- Assert(material_id < numbers::invalid_material_id,
- ExcIndexRange(material_id, 0, numbers::invalid_material_id));
+ AssertIndexRange(material_id, numbers::invalid_material_id);
if (apply_all_indicators_to_manifolds)
cells.back().manifold_id =
std::numeric_limits<types::boundary_id>::max()));
// we use only boundary_ids in the range from 0 to
// numbers::internal_face_boundary_id-1
- Assert(material_id < numbers::internal_face_boundary_id,
- ExcIndexRange(material_id,
- 0,
- numbers::internal_face_boundary_id));
+ AssertIndexRange(material_id, numbers::internal_face_boundary_id);
// Make sure to set both manifold id and boundary id appropriately in
// both cases:
std::numeric_limits<types::boundary_id>::max()));
// we use only boundary_ids in the range from 0 to
// numbers::internal_face_boundary_id-1
- Assert(material_id < numbers::internal_face_boundary_id,
- ExcIndexRange(material_id,
- 0,
- numbers::internal_face_boundary_id));
+ AssertIndexRange(material_id, numbers::internal_face_boundary_id);
// Make sure to set both manifold id and boundary id appropriately in
// both cases:
std::numeric_limits<types::material_id>::max()));
// we use only material_ids in the range from 0 to
// numbers::invalid_material_id-1
- Assert(material_id < numbers::invalid_material_id,
- ExcIndexRange(material_id,
- 0,
- numbers::invalid_material_id));
+ AssertIndexRange(material_id, numbers::invalid_material_id);
cells.back().material_id =
static_cast<types::material_id>(material_id);
std::numeric_limits<types::boundary_id>::max()));
// we use only boundary_ids in the range from 0 to
// numbers::internal_face_boundary_id-1
- Assert(material_id < numbers::internal_face_boundary_id,
- ExcIndexRange(material_id,
- 0,
- numbers::internal_face_boundary_id));
+ AssertIndexRange(material_id,
+ numbers::internal_face_boundary_id);
subcelldata.boundary_lines.back().boundary_id =
static_cast<types::boundary_id>(material_id);
std::numeric_limits<types::boundary_id>::max()));
// we use only boundary_ids in the range from 0 to
// numbers::internal_face_boundary_id-1
- Assert(material_id < numbers::internal_face_boundary_id,
- ExcIndexRange(material_id,
- 0,
- numbers::internal_face_boundary_id));
+ AssertIndexRange(material_id,
+ numbers::internal_face_boundary_id);
subcelldata.boundary_quads.back().boundary_id =
static_cast<types::boundary_id>(material_id);
// make sure that the given vertex is
// an active vertex of the underlying
// triangulation
- Assert(vertex < mesh.get_triangulation().n_vertices(),
- ExcIndexRange(0, mesh.get_triangulation().n_vertices(), vertex));
+ AssertIndexRange(vertex, mesh.get_triangulation().n_vertices());
Assert(mesh.get_triangulation().get_used_vertices()[vertex],
ExcVertexNotUsed(vertex));
// make sure that the given vertex is
// an active vertex of the underlying
// triangulation
- Assert(vertex < mesh.get_triangulation().n_vertices(),
- ExcIndexRange(0, mesh.get_triangulation().n_vertices(), vertex));
+ AssertIndexRange(vertex, mesh.get_triangulation().n_vertices());
Assert(mesh.get_triangulation().get_used_vertices()[vertex],
ExcVertexNotUsed(vertex));
{
static const int space_dim = CellIterator::AccessorType::space_dimension;
(void)space_dim;
- Assert(0 <= direction && direction < space_dim,
- ExcIndexRange(direction, 0, space_dim));
+ AssertIndexRange(direction, space_dim);
#ifdef DEBUG
{
static const int space_dim = MeshType::space_dimension;
(void)dim;
(void)space_dim;
- Assert(0 <= direction && direction < space_dim,
- ExcIndexRange(direction, 0, space_dim));
+ AssertIndexRange(direction, space_dim);
Assert(dim == space_dim, ExcNotImplemented());
static const int space_dim = MeshType::space_dimension;
(void)dim;
(void)space_dim;
- Assert(0 <= direction && direction < space_dim,
- ExcIndexRange(direction, 0, space_dim));
+ AssertIndexRange(direction, space_dim);
// Loop over all cells on the highest level and collect all boundary
// faces belonging to b_id1 and b_id2:
const Tensor<1, spacedim> &offset,
const FullMatrix<double> & matrix)
{
- Assert(0 <= direction && direction < spacedim,
- ExcIndexRange(direction, 0, spacedim));
+ AssertIndexRange(direction, spacedim);
Assert(matrix.m() == matrix.n(), ExcInternalError());
const types::manifold_id m_number,
const Manifold<dim, spacedim> &manifold_object)
{
- Assert(m_number < numbers::flat_manifold_id,
- ExcIndexRange(m_number, 0, numbers::flat_manifold_id));
+ AssertIndexRange(m_number, numbers::flat_manifold_id);
manifold[m_number] = manifold_object.clone();
}
void
Triangulation<dim, spacedim>::reset_manifold(const types::manifold_id m_number)
{
- Assert(m_number < numbers::flat_manifold_id,
- ExcIndexRange(m_number, 0, numbers::flat_manifold_id));
+ AssertIndexRange(m_number, numbers::flat_manifold_id);
// delete the entry located at number.
manifold.erase(m_number);
unsigned int
Triangulation<1, 1>::n_raw_lines(const unsigned int level) const
{
- Assert(level < n_levels(), ExcIndexRange(level, 0, n_levels()));
+ AssertIndexRange(level, n_levels());
return levels[level]->cells.cells.size();
}
unsigned int
Triangulation<1, 2>::n_raw_lines(const unsigned int level) const
{
- Assert(level < n_levels(), ExcIndexRange(level, 0, n_levels()));
+ AssertIndexRange(level, n_levels());
return levels[level]->cells.cells.size();
}
unsigned int
Triangulation<1, 3>::n_raw_lines(const unsigned int level) const
{
- Assert(level < n_levels(), ExcIndexRange(level, 0, n_levels()));
+ AssertIndexRange(level, n_levels());
return levels[level]->cells.cells.size();
}
unsigned int
Triangulation<dim, spacedim>::n_lines(const unsigned int level) const
{
- Assert(level < number_cache.n_lines_level.size(),
- ExcIndexRange(level, 0, number_cache.n_lines_level.size()));
+ AssertIndexRange(level, number_cache.n_lines_level.size());
Assert(dim == 1, ExcFacesHaveNoLevel());
return number_cache.n_lines_level[level];
}
unsigned int
Triangulation<dim, spacedim>::n_active_lines(const unsigned int level) const
{
- Assert(level < number_cache.n_lines_level.size(),
- ExcIndexRange(level, 0, number_cache.n_lines_level.size()));
+ AssertIndexRange(level, number_cache.n_lines_level.size());
Assert(dim == 1, ExcFacesHaveNoLevel());
return number_cache.n_active_lines_level[level];
Triangulation<dim, spacedim>::n_quads(const unsigned int level) const
{
Assert(dim == 2, ExcFacesHaveNoLevel());
- Assert(level < number_cache.n_quads_level.size(),
- ExcIndexRange(level, 0, number_cache.n_quads_level.size()));
+ AssertIndexRange(level, number_cache.n_quads_level.size());
return number_cache.n_quads_level[level];
}
unsigned int
Triangulation<2, 2>::n_raw_quads(const unsigned int level) const
{
- Assert(level < n_levels(), ExcIndexRange(level, 0, n_levels()));
+ AssertIndexRange(level, n_levels());
return levels[level]->cells.cells.size();
}
unsigned int
Triangulation<2, 3>::n_raw_quads(const unsigned int level) const
{
- Assert(level < n_levels(), ExcIndexRange(level, 0, n_levels()));
+ AssertIndexRange(level, n_levels());
return levels[level]->cells.cells.size();
}
unsigned int
Triangulation<dim, spacedim>::n_active_quads(const unsigned int level) const
{
- Assert(level < number_cache.n_quads_level.size(),
- ExcIndexRange(level, 0, number_cache.n_quads_level.size()));
+ AssertIndexRange(level, number_cache.n_quads_level.size());
Assert(dim == 2, ExcFacesHaveNoLevel());
return number_cache.n_active_quads_level[level];
unsigned int
Triangulation<3, 3>::n_hexs(const unsigned int level) const
{
- Assert(level < number_cache.n_hexes_level.size(),
- ExcIndexRange(level, 0, number_cache.n_hexes_level.size()));
+ AssertIndexRange(level, number_cache.n_hexes_level.size());
return number_cache.n_hexes_level[level];
}
unsigned int
Triangulation<3, 3>::n_raw_hexs(const unsigned int level) const
{
- Assert(level < n_levels(), ExcIndexRange(level, 0, n_levels()));
+ AssertIndexRange(level, n_levels());
return levels[level]->cells.cells.size();
}
unsigned int
Triangulation<3, 3>::n_active_hexs(const unsigned int level) const
{
- Assert(level < number_cache.n_hexes_level.size(),
- ExcIndexRange(level, 0, number_cache.n_hexes_level.size()));
+ AssertIndexRange(level, number_cache.n_hexes_level.size());
return number_cache.n_active_hexes_level[level];
}
TriaAccessor<1, 1, 1>::extent_in_direction(const unsigned int axis) const
{
(void)axis;
- Assert(axis == 0, ExcIndexRange(axis, 0, 1));
+ AssertIndexRange(axis, 1);
return this->diameter();
}
TriaAccessor<1, 1, 2>::extent_in_direction(const unsigned int axis) const
{
(void)axis;
- Assert(axis == 0, ExcIndexRange(axis, 0, 1));
+ AssertIndexRange(axis, 1);
return this->diameter();
}
{2, 3}, /// Lines along x-axis, see GeometryInfo
{0, 1}}; /// Lines along y-axis
- Assert(axis < 2, ExcIndexRange(axis, 0, 2));
+ AssertIndexRange(axis, 2);
return std::max(this->line(lines[axis][0])->diameter(),
this->line(lines[axis][1])->diameter());
{2, 3}, /// Lines along x-axis, see GeometryInfo
{0, 1}}; /// Lines along y-axis
- Assert(axis < 2, ExcIndexRange(axis, 0, 2));
+ AssertIndexRange(axis, 2);
return std::max(this->line(lines[axis][0])->diameter(),
this->line(lines[axis][1])->diameter());
{0, 1, 4, 5}, /// Lines along y-axis
{8, 9, 10, 11}}; /// Lines along z-axis
- Assert(axis < 3, ExcIndexRange(axis, 0, 3));
+ AssertIndexRange(axis, 3);
double lengths[4] = {this->line(lines[axis][0])->diameter(),
this->line(lines[axis][1])->diameter(),
const types::material_id mat_id) const
{
Assert(this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- Assert(mat_id < numbers::invalid_material_id,
- ExcIndexRange(mat_id, 0, numbers::invalid_material_id));
+ AssertIndexRange(mat_id, numbers::invalid_material_id);
this->tria->levels[this->present_level]
->cells.boundary_or_material_id[this->present_index]
.material_id = mat_id;
CellAccessor<dim, spacedim>::at_boundary(const unsigned int i) const
{
Assert(this->used(), TriaAccessorExceptions::ExcCellNotUsed());
- Assert(i < GeometryInfo<dim>::faces_per_cell,
- ExcIndexRange(i, 0, GeometryInfo<dim>::faces_per_cell));
+ AssertIndexRange(i, GeometryInfo<dim>::faces_per_cell);
return (neighbor_index(i) == -1);
}
const typename Triangulation<dim, spacedim>::face_iterator
mother_face = this->face(face);
const unsigned int total_children = mother_face->number_of_children();
- Assert(subface < total_children,
- ExcIndexRange(subface, 0, total_children));
+ AssertIndexRange(subface, total_children);
Assert(total_children <= GeometryInfo<3>::max_children_per_face,
ExcInternalError());
FECollection<dim, spacedim>::next_in_hierarchy(
const unsigned int fe_index) const
{
- Assert(fe_index < size(), ExcIndexRange(fe_index, 0, size()));
+ AssertIndexRange(fe_index, size());
const unsigned int new_fe_index = hierarchy_next(*this, fe_index);
- Assert(new_fe_index < size(), ExcIndexRange(new_fe_index, 0, size()));
+ AssertIndexRange(new_fe_index, size());
return new_fe_index;
}
FECollection<dim, spacedim>::previous_in_hierarchy(
const unsigned int fe_index) const
{
- Assert(fe_index < size(), ExcIndexRange(fe_index, 0, size()));
+ AssertIndexRange(fe_index, size());
const unsigned int new_fe_index = hierarchy_prev(*this, fe_index);
- Assert(new_fe_index < size(), ExcIndexRange(new_fe_index, 0, size()));
+ AssertIndexRange(new_fe_index, size());
return new_fe_index;
}
const unsigned int mapping_index,
const unsigned int q_index)
{
- Assert(fe_index < fe_collection->size(),
- ExcIndexRange(fe_index, 0, fe_collection->size()));
- Assert(mapping_index < mapping_collection->size(),
- ExcIndexRange(mapping_index, 0, mapping_collection->size()));
- Assert(q_index < q_collection.size(),
- ExcIndexRange(q_index, 0, q_collection.size()));
+ AssertIndexRange(fe_index, fe_collection->size());
+ AssertIndexRange(mapping_index, mapping_collection->size());
+ AssertIndexRange(q_index, q_collection.size());
// set the triple of indices
real_fe_index = cell->active_fe_index();
// some checks
- Assert(real_q_index < this->q_collection.size(),
- ExcIndexRange(real_q_index, 0, this->q_collection.size()));
- Assert(real_mapping_index < this->mapping_collection->size(),
- ExcIndexRange(real_mapping_index,
- 0,
- this->mapping_collection->size()));
- Assert(real_fe_index < this->fe_collection->size(),
- ExcIndexRange(real_fe_index, 0, this->fe_collection->size()));
+ AssertIndexRange(real_q_index, this->q_collection.size());
+ AssertIndexRange(real_mapping_index, this->mapping_collection->size());
+ AssertIndexRange(real_fe_index, this->fe_collection->size());
// now finally actually get the
// corresponding object and
real_fe_index = 0;
// some checks
- Assert(real_q_index < this->q_collection.size(),
- ExcIndexRange(real_q_index, 0, this->q_collection.size()));
- Assert(real_mapping_index < this->mapping_collection->size(),
- ExcIndexRange(real_mapping_index,
- 0,
- this->mapping_collection->size()));
- Assert(real_fe_index < this->fe_collection->size(),
- ExcIndexRange(real_fe_index, 0, this->fe_collection->size()));
+ AssertIndexRange(real_q_index, this->q_collection.size());
+ AssertIndexRange(real_mapping_index, this->mapping_collection->size());
+ AssertIndexRange(real_fe_index, this->fe_collection->size());
// now finally actually get the
// corresponding object and
real_fe_index = cell->active_fe_index();
// some checks
- Assert(real_q_index < this->q_collection.size(),
- ExcIndexRange(real_q_index, 0, this->q_collection.size()));
- Assert(real_mapping_index < this->mapping_collection->size(),
- ExcIndexRange(real_mapping_index,
- 0,
- this->mapping_collection->size()));
- Assert(real_fe_index < this->fe_collection->size(),
- ExcIndexRange(real_fe_index, 0, this->fe_collection->size()));
+ AssertIndexRange(real_q_index, this->q_collection.size());
+ AssertIndexRange(real_mapping_index, this->mapping_collection->size());
+ AssertIndexRange(real_fe_index, this->fe_collection->size());
// now finally actually get the
// corresponding object and
real_fe_index = 0;
// some checks
- Assert(real_q_index < this->q_collection.size(),
- ExcIndexRange(real_q_index, 0, this->q_collection.size()));
- Assert(real_mapping_index < this->mapping_collection->size(),
- ExcIndexRange(real_mapping_index,
- 0,
- this->mapping_collection->size()));
- Assert(real_fe_index < this->fe_collection->size(),
- ExcIndexRange(real_fe_index, 0, this->fe_collection->size()));
+ AssertIndexRange(real_q_index, this->q_collection.size());
+ AssertIndexRange(real_mapping_index, this->mapping_collection->size());
+ AssertIndexRange(real_fe_index, this->fe_collection->size());
// now finally actually get the
// corresponding object and
real_fe_index = cell->active_fe_index();
// some checks
- Assert(real_q_index < this->q_collection.size(),
- ExcIndexRange(real_q_index, 0, this->q_collection.size()));
- Assert(real_mapping_index < this->mapping_collection->size(),
- ExcIndexRange(real_mapping_index,
- 0,
- this->mapping_collection->size()));
- Assert(real_fe_index < this->fe_collection->size(),
- ExcIndexRange(real_fe_index, 0, this->fe_collection->size()));
+ AssertIndexRange(real_q_index, this->q_collection.size());
+ AssertIndexRange(real_mapping_index, this->mapping_collection->size());
+ AssertIndexRange(real_fe_index, this->fe_collection->size());
// now finally actually get the
// corresponding object and
real_fe_index = 0;
// some checks
- Assert(real_q_index < this->q_collection.size(),
- ExcIndexRange(real_q_index, 0, this->q_collection.size()));
- Assert(real_mapping_index < this->mapping_collection->size(),
- ExcIndexRange(real_mapping_index,
- 0,
- this->mapping_collection->size()));
- Assert(real_fe_index < this->fe_collection->size(),
- ExcIndexRange(real_fe_index, 0, this->fe_collection->size()));
+ AssertIndexRange(real_q_index, this->q_collection.size());
+ AssertIndexRange(real_mapping_index, this->mapping_collection->size());
+ AssertIndexRange(real_fe_index, this->fe_collection->size());
// now finally actually get the
// corresponding object and
bool
ChunkSparsityPattern::exists(const size_type i, const size_type j) const
{
- Assert(i < rows, ExcIndexRange(i, 0, rows));
- Assert(j < cols, ExcIndexRange(j, 0, cols));
+ AssertIndexRange(i, rows);
+ AssertIndexRange(j, cols);
return sparsity_pattern.exists(i / chunk_size, j / chunk_size);
}
ChunkSparsityPattern::size_type
ChunkSparsityPattern::row_length(const size_type i) const
{
- Assert(i < rows, ExcIndexRange(i, 0, rows));
+ AssertIndexRange(i, rows);
// find out if we did padding and if this row is affected by it
if (n_cols() % chunk_size == 0)
bool
DynamicSparsityPattern::exists(const size_type i, const size_type j) const
{
- Assert(i < rows, ExcIndexRange(i, 0, rows));
- Assert(j < cols, ExcIndexRange(j, 0, cols));
+ AssertIndexRange(i, rows);
+ AssertIndexRange(j, cols);
Assert(
rowset.size() == 0 || rowset.is_element(i),
ExcMessage(
const DynamicSparsityPattern::size_type row,
const DynamicSparsityPattern::size_type col) const
{
- Assert(row < n_rows(),
- ExcIndexRangeType<DynamicSparsityPattern::size_type>(row,
- 0,
- n_rows()));
- Assert(col < n_cols(),
- ExcIndexRangeType<DynamicSparsityPattern::size_type>(row,
- 0,
- n_cols()));
+ AssertIndexRange(row, n_rows());
+ AssertIndexRange(col, n_cols());
Assert(rowset.size() == 0 || rowset.is_element(row), ExcInternalError());
const DynamicSparsityPattern::size_type local_row =
Vector::create_vector(const size_type n, const size_type local_size)
{
(void)n;
- Assert(local_size <= n, ExcIndexRange(local_size, 0, n));
+ AssertIndexRange(local_size, n + 1);
ghosted = false;
const PetscErrorCode ierr =
const IndexSet &ghostnodes)
{
(void)n;
- Assert(local_size <= n, ExcIndexRange(local_size, 0, n));
+ AssertIndexRange(local_size, n + 1);
ghosted = true;
ghost_indices = ghostnodes;
{
VectorReference::operator PetscScalar() const
{
- Assert(index < vector.size(), ExcIndexRange(index, 0, vector.size()));
+ AssertIndexRange(index, vector.size());
// The vector may have ghost entries. In that case, we first need to
// figure out which elements we own locally, then get a pointer to the
SparsityPattern::operator()(const size_type i, const size_type j) const
{
Assert((rowstart != nullptr) && (colnums != nullptr), ExcEmptyObject());
- Assert(i < rows, ExcIndexRange(i, 0, rows));
- Assert(j < cols, ExcIndexRange(j, 0, cols));
+ AssertIndexRange(i, rows);
+ AssertIndexRange(j, cols);
Assert(compressed, ExcNotCompressed());
// let's see whether there is something in this line
SparsityPatternBase::add(const size_type i, const size_type j)
{
Assert((rowstart != nullptr) && (colnums != nullptr), ExcEmptyObject());
- Assert(i < rows, ExcIndexRange(i, 0, rows));
- Assert(j < cols, ExcIndexRange(j, 0, cols));
+ AssertIndexRange(i, rows);
+ AssertIndexRange(j, cols);
Assert(compressed == false, ExcMatrixIsCompressed());
for (std::size_t k = rowstart[i]; k < rowstart[i + 1]; k++)
SparsityPatternBase::exists(const size_type i, const size_type j) const
{
Assert((rowstart != nullptr) && (colnums != nullptr), ExcEmptyObject());
- Assert(i < rows, ExcIndexRange(i, 0, rows));
- Assert(j < cols, ExcIndexRange(j, 0, cols));
+ AssertIndexRange(i, rows);
+ AssertIndexRange(j, cols);
for (size_type k = rowstart[i]; k < rowstart[i + 1]; ++k)
{
SparsityPatternBase::row_position(const size_type i, const size_type j) const
{
Assert((rowstart != nullptr) && (colnums != nullptr), ExcEmptyObject());
- Assert(i < rows, ExcIndexRange(i, 0, rows));
- Assert(j < cols, ExcIndexRange(j, 0, cols));
+ AssertIndexRange(i, rows);
+ AssertIndexRange(j, cols);
for (size_type k = rowstart[i]; k < rowstart[i + 1]; ++k)
{
SparsityPatternBase::matrix_position(const std::size_t global_index) const
{
Assert(compressed == true, ExcNotCompressed());
- Assert(global_index < n_nonzero_elements(),
- ExcIndexRange(global_index, 0, n_nonzero_elements()));
+ AssertIndexRange(global_index, n_nonzero_elements());
// first find the row in which the entry is located. for this note that the
// rowstart array indexes the global indices at which each row starts. since
TridiagonalMatrix<number>::eigenvalue(const size_type i) const
{
Assert(state == LAPACKSupport::eigenvalues, ExcState(state));
- Assert(i < n(), ExcIndexRange(i, 0, n()));
+ AssertIndexRange(i, n());
return diagonal[i];
}
{
VectorReference::operator TrilinosScalar() const
{
- Assert(index < vector.size(), ExcIndexRange(index, 0, vector.size()));
+ AssertIndexRange(index, vector.size());
// Trilinos allows for vectors to be referenced by the [] or ()
// operators but only () checks index bounds. We check these bounds by
std::vector<std::vector<types::global_dof_index>> &ndofs)
{
const unsigned int n_blocks = mg_dof.get_fe().n_blocks();
- Assert(selected_block < n_blocks,
- ExcIndexRange(selected_block, 0, n_blocks));
+ AssertIndexRange(selected_block, n_blocks);
std::vector<bool> selected(n_blocks, false);
selected[selected_block] = true;
for (unsigned int i = 0; i < target_component.size(); ++i)
{
- Assert(i < target_component.size(),
- ExcIndexRange(i, 0, target_component.size()));
+ AssertIndexRange(i, target_component.size());
}
}
// Do the same for the multilevel
for (unsigned int i = 0; i < mg_target_component.size(); ++i)
{
- Assert(i < mg_target_component.size(),
- ExcIndexRange(i, 0, mg_target_component.size()));
+ AssertIndexRange(i, mg_target_component.size());
}
}
ExcVectorLengthVsNActiveCells(
derivative_norm.size(),
dof_handler.get_triangulation().n_active_cells()));
- Assert(component < dof_handler.get_fe(0).n_components(),
- ExcIndexRange(component, 0, dof_handler.get_fe(0).n_components()));
+ AssertIndexRange(component, dof_handler.get_fe(0).n_components());
using Iterators = std::tuple<
TriaActiveIterator<
DEAL:: 0 1 2 0 1 2 3
DEAL:: 2 0 1
-DEAL::ExcIndexRange(length, 0, v.size() - start + 1)
+DEAL::dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type<void( typename std::common_type<decltype(length), decltype(v.size() - start + 1)>::type)>:: type>((length), 0, (v.size() - start + 1))
-DEAL::ExcIndexRange (block_index, 0, block_mask.size())
+DEAL::dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type<void( typename std::common_type<decltype(block_index), decltype(block_mask.size())>::type)>:: type>((block_index), 0, (block_mask.size()))
DEAL::OK
-DEAL::ExcIndexRange (scalar.component, 0, fe_values_views_cache.scalars.size())
-DEAL::ExcIndexRange (scalar.component, 0, fe_values_views_cache.scalars.size())
-DEAL::ExcIndexRange (scalar.component, 0, fe_values_views_cache.scalars.size())
+DEAL::dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type<void( typename std::common_type<decltype(scalar.component), decltype(fe_values_views_cache.scalars.size())>::type)>:: type>((scalar.component), 0, (fe_values_views_cache.scalars.size()))
+DEAL::dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type<void( typename std::common_type<decltype(scalar.component), decltype(fe_values_views_cache.scalars.size())>::type)>:: type>((scalar.component), 0, (fe_values_views_cache.scalars.size()))
+DEAL::dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type<void( typename std::common_type<decltype(scalar.component), decltype(fe_values_views_cache.scalars.size())>::type)>:: type>((scalar.component), 0, (fe_values_views_cache.scalars.size()))
-DEAL::ExcIndexRange (vector.first_vector_component, 0, fe_values_views_cache.vectors.size())
-DEAL::ExcIndexRange (vector.first_vector_component, 0, fe_values_views_cache.vectors.size())
-DEAL::ExcIndexRange (vector.first_vector_component, 0, fe_values_views_cache.vectors.size())
+DEAL::dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type<void( typename std::common_type<decltype(vector.first_vector_component), decltype(fe_values_views_cache.vectors.size())>::type)>:: type>((vector.first_vector_component), 0, (fe_values_views_cache.vectors.size()))
+DEAL::dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type<void( typename std::common_type<decltype(vector.first_vector_component), decltype(fe_values_views_cache.vectors.size())>::type)>:: type>((vector.first_vector_component), 0, (fe_values_views_cache.vectors.size()))
+DEAL::dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type<void( typename std::common_type<decltype(vector.first_vector_component), decltype(fe_values_views_cache.vectors.size())>::type)>:: type>((vector.first_vector_component), 0, (fe_values_views_cache.vectors.size()))
-DEAL::ExcIndexRange (tensor.first_tensor_component, 0, fe_values_views_cache.second_order_tensors.size())
-DEAL::ExcIndexRange (tensor.first_tensor_component, 0, fe_values_views_cache.second_order_tensors.size())
-DEAL::ExcIndexRange (tensor.first_tensor_component, 0, fe_values_views_cache.second_order_tensors.size())
+DEAL::dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type<void( typename std::common_type<decltype(tensor.first_tensor_component), decltype(fe_values_views_cache.second_order_tensors.size())>::type)>:: type>((tensor.first_tensor_component), 0, (fe_values_views_cache.second_order_tensors.size()))
+DEAL::dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type<void( typename std::common_type<decltype(tensor.first_tensor_component), decltype(fe_values_views_cache.second_order_tensors.size())>::type)>:: type>((tensor.first_tensor_component), 0, (fe_values_views_cache.second_order_tensors.size()))
+DEAL::dealii::ExcIndexRangeType<typename ::dealii::internal::argument_type<void( typename std::common_type<decltype(tensor.first_tensor_component), decltype(fe_values_views_cache.second_order_tensors.size())>::type)>:: type>((tensor.first_tensor_component), 0, (fe_values_views_cache.second_order_tensors.size()))