13#ifndef dealii_dof_accessor_h
14#define dealii_dof_accessor_h
31#include <boost/container/small_vector.hpp>
42template <
typename number>
44template <
typename number>
46template <
typename number>
49template <
typename Accessor>
102 template <
int structdim,
int dim,
int spacedim>
118 template <
int dim,
int spacedim>
209template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
230 using BaseClass = typename ::internal::DoFAccessorImplementation::
231 Inheritance<structdim, dimension, space_dimension>::BaseClass;
300 template <
int structdim2,
int dim2,
int spacedim2>
307 template <
int structdim2,
int dim2,
int spacedim2,
bool level_dof_access2>
314 template <
bool level_dof_access2>
351 template <
bool level_dof_access2>
387 typename ::internal::DoFHandlerImplementation::
388 Iterators<dim, spacedim, level_dof_access>::line_iterator
389 line(
const unsigned int i)
const;
396 typename ::internal::DoFHandlerImplementation::
397 Iterators<dim, spacedim, level_dof_access>::quad_iterator
398 quad(
const unsigned int i)
const;
447 std::vector<types::global_dof_index> &dof_indices,
459 std::vector<types::global_dof_index> &dof_indices,
468 const std::vector<types::global_dof_index> &dof_indices,
494 const unsigned int vertex,
495 const unsigned int i,
506 const unsigned int vertex,
507 const unsigned int i,
587 std::set<types::fe_index>
620 "This accessor object has not been "
621 "associated with any DoFHandler object.");
675 template <
int structdim2,
int dim2,
int spacedim2,
bool level_dof_access2>
683 template <
int structdim2,
int dim2,
int spacedim2,
bool level_dof_access2>
715 const unsigned int i,
721 const unsigned int i,
727 const unsigned int vertex,
728 const unsigned int i,
736 template <
int,
int,
int,
bool>
744 friend struct ::internal::DoFHandlerImplementation::Policy::
746 friend struct ::internal::DoFHandlerImplementation::Implementation;
747 friend struct ::internal::hp::DoFHandlerImplementation::Implementation;
748 friend struct ::internal::DoFCellAccessorImplementation::Implementation;
749 friend struct ::internal::DoFAccessorImplementation::Implementation;
761template <
int spacedim,
bool level_dof_access>
846 template <
int structdim2,
int dim2,
int spacedim2>
853 template <
int structdim2,
int dim2,
int spacedim2,
bool level_dof_access2>
905 template <
bool level_dof_access2>
929 child(const
unsigned int c) const;
937 typename ::
internal::DoFHandlerImplementation::
938 Iterators<1, spacedim, level_dof_access>::line_iterator
939 line(const
unsigned int i) const;
947 typename ::
internal::DoFHandlerImplementation::
948 Iterators<1, spacedim, level_dof_access>::quad_iterator
949 quad(const
unsigned int i) const;
996 std::vector<
types::global_dof_index> &dof_indices,
997 const
types::fe_index fe_index =
numbers::invalid_fe_index) const;
1008 std::vector<
types::global_dof_index> &dof_indices,
1009 const
types::fe_index fe_index =
numbers::invalid_fe_index) const;
1029 types::global_dof_index
1031 const
unsigned int vertex,
1032 const
unsigned int i,
1033 const
types::fe_index fe_index =
numbers::invalid_fe_index) const;
1052 types::global_dof_index
1054 const
types::fe_index fe_index =
numbers::invalid_fe_index) const;
1116 "This accessor object has not been "
1117 "associated with any DoFHandler object.");
1160 template <
int structdim2,
int dim2,
int spacedim2,
bool level_dof_access2>
1163 const
DoFAccessor<structdim2, dim2, spacedim2, level_dof_access2> &) const;
1168 template <
int structdim2,
int dim2,
int spacedim2,
bool level_dof_access2>
1171 const
DoFAccessor<structdim2, dim2, spacedim2, level_dof_access2> &) const;
1199 const
unsigned int i,
1201 const
types::fe_index fe_index =
numbers::invalid_fe_index) const;
1213 friend struct ::
internal::DoFHandlerImplementation::Policy::
1245template <
int structdim,
int dim,
int spacedim = dim>
1263 const int level = -1,
1264 const int index = -1,
1280 template <
typename OtherAccessor>
1300 const unsigned int i,
1321template <
int dimension_,
int space_dimension_,
bool level_dof_access>
1331 static const unsigned int dim = dimension_;
1392 template <
int structdim2,
int dim2,
int spacedim2>
1399 template <
int structdim2,
int dim2,
int spacedim2,
bool level_dof_access2>
1502 boost::container::small_vector<
1532 const unsigned int subface_no)
const;
1542 const unsigned int subface_no)
const;
1572 template <
class InputVector,
typename number>
1593 template <
typename Number,
typename ForwardIterator>
1596 ForwardIterator local_values_begin,
1597 ForwardIterator local_values_end)
const;
1619 template <
class InputVector,
typename ForwardIterator>
1623 const InputVector &values,
1624 ForwardIterator local_values_begin,
1625 ForwardIterator local_values_end)
const;
1651 template <
class OutputVector,
typename number>
1654 OutputVector &values)
const;
1687 template <
typename Number>
1698 template <
typename Number>
1766 template <
class OutputVector,
typename number>
1770 OutputVector &values,
1772 const bool perform_check =
false)
const;
1783 template <
class OutputVector,
typename number>
1787 OutputVector &values,
1804 template <
typename number,
typename OutputVector>
1807 OutputVector &global_destination)
const;
1823 template <
typename ForwardIterator,
typename OutputVector>
1826 ForwardIterator local_source_end,
1827 OutputVector &global_destination)
const;
1842 template <
typename ForwardIterator,
typename OutputVector>
1846 ForwardIterator local_source_begin,
1847 ForwardIterator local_source_end,
1848 OutputVector &global_destination)
const;
1856 template <
typename number,
typename OutputMatrix>
1859 OutputMatrix &global_destination)
const;
1865 template <
typename number,
typename OutputMatrix,
typename OutputVector>
1869 OutputMatrix &global_matrix,
1870 OutputVector &global_vector)
const;
1898 std::vector<types::global_dof_index> &dof_indices)
const;
2125 friend struct ::internal::DoFCellAccessorImplementation::Implementation;
2129template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
2133 return level_dof_access;
2138template <
int structdim,
int dim,
int spacedim>
2139template <
typename OtherAccessor>
2141 const OtherAccessor &)
2144 ExcMessage(
"You are attempting an illegal conversion between "
2145 "iterator/accessor types. The constructor you call "
2146 "only exists to make certain template constructs "
2147 "easier to write as dimension independent code but "
2148 "the conversion is not valid in the current context."));
2156template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
2164template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
2170 : ::
internal::DoFAccessorImplementation::
2171 Inheritance<structdim, dim, spacedim>::
BaseClass(tria, level, index)
2175 tria ==
nullptr || &
dof_handler->get_triangulation() == tria,
2177 "You can't create a DoF accessor in which the DoFHandler object "
2178 "uses a different triangulation than the one you pass as argument."));
2183template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
2184template <
int structdim2,
int dim2,
int spacedim2>
2193template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
2194template <
int structdim2,
int dim2,
int spacedim2,
bool level_dof_access2>
2202 "You are trying to assign iterators that are incompatible. "
2203 "The reason for incompatibility is that they refer to objects of "
2204 "different dimensionality (e.g., assigning a line iterator "
2205 "to a quad iterator)."));
2210template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
2211template <
bool level_dof_access2>
2220template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
2231template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
2241template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
2247 BaseClass::copy_from(da);
2252template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
2253template <
bool level_dof_access2>
2258 BaseClass::copy_from(a);
2264template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
2265template <
int structdim2,
int dim2,
int spacedim2,
bool level_dof_access2>
2272 return (BaseClass::operator==(a));
2277template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
2278template <
int structdim2,
int dim2,
int spacedim2,
bool level_dof_access2>
2285 return (BaseClass::operator!=(a));
2290template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
2293 const unsigned int i)
const
2295 Assert(
static_cast<unsigned int>(this->level()) <
2310 namespace DoFAccessorImplementation
2316 template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
2330 "It is not possible to specify a FE index if no hp support is used!"));
2350 "You need to specify a FE index if hp support is used!"));
2371 boost::container::small_vector<::types::global_dof_index, 100>;
2386 typename GlobalIndexType,
2387 typename DoFPProcessor>
2390 const unsigned int obj_level,
2391 const unsigned int obj_index,
2393 const unsigned int local_index,
2394 const std::integral_constant<int, structdim> &,
2395 GlobalIndexType &global_index,
2396 const DoFPProcessor &process)
2408 [obj_level][structdim]
2417 if (structdim == dim)
2421 [obj_level][structdim]
2449 "You are requesting an active FE index that is not assigned "
2450 "to any of the cells connected to this entity."));
2465 [obj_level][structdim]
2474 [obj_level][structdim]
2476 [obj_level][structdim]
2494 template <
int dim,
int spacedim,
int structdim>
2495 static std::pair<unsigned int, unsigned int>
2497 const unsigned int obj_level,
2498 const unsigned int obj_index,
2500 const std::integral_constant<int, structdim> &)
2506 if (structdim == dim)
2508 const unsigned int ptr_0 =
2510 const unsigned int length =
2511 dof_handler.
get_fe(fe_index).template n_dofs_per_object<dim>(0);
2513 return {ptr_0, length};
2522 const unsigned int ptr_0 =
2524 const unsigned int length =
2525 dof_handler.
object_dof_ptr[obj_level][structdim][obj_index + 1] -
2528 return {ptr_0, length};
2540 const auto fe_index_local_ptr =
2547 Assert(fe_index_local_ptr !=
2551 "You tried to call a function accessing DoF indices, but "
2552 "they appear not be available (yet) or inconsistent. "
2553 "Did you call distribute_dofs() first? Alternatively, if "
2554 "you are using different elements on different cells (i.e., "
2555 "you are using the hp capabilities of deal.II), did you "
2556 "change the active_fe_index of a cell since you last "
2557 "called distribute_dofs()?"));
2562 fe_index_local_ptr);
2568 const unsigned int ptr_0 =
2573 const unsigned int ptr_1 =
2577 fe_index_local + 1];
2579 return {ptr_0, ptr_1 - ptr_0};
2582 template <
int dim,
int spacedim,
int structdim,
bool level_dof_access>
2583 static std::pair<unsigned int, unsigned int>
2585 const ::DoFAccessor<structdim, dim, spacedim, level_dof_access>
2593 std::integral_constant<int, structdim>());
2596 template <
int dim,
int spacedim,
int structdim>
2597 static std::pair<unsigned int, unsigned int>
2619 typename DoFProcessor,
2620 typename DoFMapping>
2623 const unsigned int obj_level,
2624 const unsigned int obj_index,
2627 const std::integral_constant<int, structdim> &dd,
2629 const DoFProcessor &process)
2636 if (range.second == 0)
2639 std::vector<types::global_dof_index> &object_dof_indices =
2644 object_dof_indices.data() + range.first;
2647 for (
unsigned int i = 0; i < range.second; ++i)
2650 stored_indices[(structdim == 0 || structdim == dim) ? i :
2653 if (dof_indices_ptr !=
nullptr)
2670 template <
int dim,
int spacedim,
int structdim>
2673 const unsigned int obj_level,
2674 const unsigned int obj_index,
2676 const unsigned int local_index,
2677 const std::integral_constant<int, structdim> &dd,
2687 [](
auto &ptr,
const auto &
value) { ptr =
value; });
2701 template <
int dim,
int spacedim,
int structdim>
2704 const unsigned int obj_level,
2705 const unsigned int obj_index,
2707 const unsigned int local_index,
2708 const std::integral_constant<int, structdim> &dd)
2718 [](
const auto &ptr,
auto &
value) {
value = ptr; });
2719 return global_index;
2723 template <
int dim,
int spacedim>
2727 const unsigned int vertex_index,
2728 const unsigned int i)
2732 "DoFHandler in hp-mode does not implement multilevel DoFs."));
2749 template <
int dim,
int spacedim,
int structdim>
2752 const unsigned int obj_level,
2753 const unsigned int obj_index,
2754 const std::integral_constant<int, structdim> &)
2765 if (structdim == dim)
2788 template <
int dim,
int spacedim,
int structdim>
2791 const unsigned int obj_level,
2792 const unsigned int obj_index,
2793 const unsigned int local_index,
2794 const std::integral_constant<int, structdim> &)
2799 Assert(((structdim == dim) &&
2809 if (structdim == dim)
2840 template <
int dim,
int spacedim,
int structdim>
2841 static std::set<types::fe_index>
2843 const unsigned int obj_level,
2844 const unsigned int obj_index,
2845 const std::integral_constant<int, structdim> &t)
2854 if (structdim == dim)
2858 std::set<types::fe_index> active_fe_indices;
2859 for (
unsigned int i = 0;
2862 active_fe_indices.insert(
2864 return active_fe_indices;
2869 template <
int dim,
int spacedim,
int structdim>
2872 const unsigned int obj_level,
2873 const unsigned int obj_index,
2875 const std::integral_constant<int, structdim> &)
2884 if (structdim == dim)
2901 template <
typename InputVector,
typename ForwardIterator>
2906 ForwardIterator local_values_begin)
2908 values.extract_subvector_to(cache, cache_end, local_values_begin);
2913#ifdef DEAL_II_WITH_TRILINOS
2914 static std::vector<unsigned int>
2919 std::vector<unsigned int> idx(v_end - v_begin);
2920 std::iota(idx.begin(), idx.end(), 0u);
2923 std::sort(idx.begin(),
2925 [&v_begin](
unsigned int i1,
unsigned int i2) {
2926 return *(v_begin + i1) < *(v_begin + i2);
2934# ifdef DEAL_II_TRILINOS_WITH_TPETRA
2935 template <
typename ForwardIterator,
typename Number,
typename MemorySpace>
2942 ForwardIterator local_values_begin)
2944 std::vector<unsigned int> sorted_indices_pos =
2946 const unsigned int cache_size = cache_end - cache_begin;
2947 std::vector<types::global_dof_index> cache_indices(cache_size);
2948 for (
unsigned int i = 0; i < cache_size; ++i)
2949 cache_indices[i] = *(cache_begin + sorted_indices_pos[i]);
2951 IndexSet index_set(cache_indices.back() + 1);
2952 index_set.
add_indices(cache_indices.begin(), cache_indices.end());
2958 for (
unsigned int i = 0; i < cache_size; ++i, ++local_values_begin)
2959 *local_values_begin = read_write_vector[sorted_indices_pos[i]];
2964# ifdef DEAL_II_TRILINOS_WITH_EPETRA
2965 template <
typename ForwardIterator>
2970 ForwardIterator local_values_begin)
2972 std::vector<unsigned int> sorted_indices_pos =
2974 const unsigned int cache_size = cache_end - cache_begin;
2975 std::vector<types::global_dof_index> cache_indices(cache_size);
2976 for (
unsigned int i = 0; i < cache_size; ++i)
2977 cache_indices[i] = *(cache_begin + sorted_indices_pos[i]);
2979 IndexSet index_set(cache_indices.back() + 1);
2980 index_set.
add_indices(cache_indices.begin(), cache_indices.end());
2986 for (
unsigned int i = 0; i < cache_size; ++i, ++local_values_begin)
2987 *local_values_begin = read_write_vector[sorted_indices_pos[i]];
2996 template <
int dim,
int spacedim,
bool level_dof_access,
int structdim>
2999 const ::DoFAccessor<structdim, dim, spacedim, level_dof_access>
3002 const bool count_level_dofs)
3007 if (count_level_dofs)
3009 const auto &fe = accessor.get_fe(fe_index_);
3012 dofs_per_vertex = fe.n_dofs_per_vertex(),
3013 dofs_per_line = fe.n_dofs_per_line(),
3014 dofs_per_quad = fe.n_dofs_per_quad(0 ),
3015 dofs_per_hex = fe.n_dofs_per_hex();
3017 unsigned int index = 0;
3020 index += dofs_per_vertex * accessor.n_vertices();
3023 if (structdim == 2 || structdim == 3)
3024 index += dofs_per_line * accessor.n_lines();
3028 index += dofs_per_quad * accessor.n_faces();
3031 const unsigned int interior_dofs =
3032 structdim == 1 ? dofs_per_line :
3033 (structdim == 2 ? dofs_per_quad : dofs_per_hex);
3035 index += interior_dofs;
3041 const auto fe_index =
3043 accessor, fe_index_);
3045 unsigned int index = 0;
3048 for (
const auto vertex : accessor.vertex_indices())
3051 accessor.vertex_index(vertex),
3053 std::integral_constant<int, 0>())
3057 if (structdim == 2 || structdim == 3)
3058 for (
const auto line : accessor.line_indices())
3064 for (
const auto face : accessor.face_indices())
3081 template <
typename ArrayType>
3085 return array.size();
3094 template <
typename ArrayType>
3116 bool level_dof_access,
3118 typename DoFIndicesType,
3119 typename DoFOperation,
3120 typename DoFProcessor>
3123 const ::DoFAccessor<structdim, dim, spacedim, level_dof_access>
3125 const DoFIndicesType &const_dof_indices,
3127 const DoFOperation &dof_operation,
3128 const DoFProcessor &dof_processor,
3129 const bool count_level_dofs)
3133 accessor, fe_index_);
3138 (void)count_level_dofs;
3140 const auto &fe = accessor.get_fe(fe_index);
3154 if (fe.n_dofs_per_vertex() > 0)
3155 for (
const auto vertex : accessor.vertex_indices())
3156 dof_operation.process_vertex_dofs(*accessor.dof_handler,
3157 accessor.vertex_index(vertex),
3164 if (structdim > 1 && fe.n_dofs_per_line() > 0)
3166 const auto line_indices = internal::TriaAccessorImplementation::
3167 Implementation::get_line_indices_of_cell(accessor);
3168 const auto line_orientations =
3169 internal::TriaAccessorImplementation::Implementation::
3170 get_line_orientations_of_cell(accessor);
3172 for (
const auto line : accessor.line_indices())
3174 const auto line_orientation = line_orientations[line];
3176 dof_operation.process_dofs(
3177 accessor.get_dof_handler(),
3181 [](
const auto d) { return d; },
3182 std::integral_constant<int, 1>(),
3187 Assert(line_orientation ==
3190 dof_operation.process_dofs(
3191 accessor.get_dof_handler(),
3195 [&fe, line_orientation](
const auto d) {
3196 return fe.adjust_line_dof_index_for_line_orientation(
3197 d, line_orientation);
3199 std::integral_constant<int, 1>(),
3209 if (structdim == 3 && fe.max_dofs_per_quad() > 0)
3210 for (
const auto face_no : accessor.face_indices())
3212 const auto combined_orientation =
3213 accessor.combined_face_orientation(face_no);
3214 const unsigned int quad_index = accessor.quad_index(face_no);
3215 if (combined_orientation ==
3217 dof_operation.process_dofs(
3218 accessor.get_dof_handler(),
3222 [](
const auto d) { return d; },
3223 std::integral_constant<int, 2>(),
3227 dof_operation.process_dofs(
3228 accessor.get_dof_handler(),
3233 return fe.adjust_quad_dof_index_for_face_orientation(
3234 d, face_no, combined_orientation);
3236 std::integral_constant<int, 2>(),
3245 if (((dim == 3 && structdim == 2) ?
3246 fe.max_dofs_per_quad() :
3247 fe.template n_dofs_per_object<structdim>()) > 0)
3248 dof_operation.process_dofs(
3249 accessor.get_dof_handler(),
3253 [&](
const auto d) { return d; },
3254 std::integral_constant<int, structdim>(),
3258 if (dof_indices_ptr !=
nullptr)
3271 for (; dof_indices_ptr < end_dof_indices; ++dof_indices_ptr)
3272 dof_processor(invalid_index, dof_indices_ptr);
3281 template <
int dim,
int spacedim>
3287 template <
typename DoFProcessor>
3290 const unsigned int vertex_index,
3293 const DoFProcessor &dof_processor)
const
3304 std::integral_constant<int, 0>(),
3312 template <
int structdim,
typename DoFMapping,
typename DoFProcessor>
3315 const unsigned int obj_level,
3316 const unsigned int obj_index,
3319 const std::integral_constant<int, structdim>,
3321 const DoFProcessor &dof_processor)
const
3329 std::integral_constant<
int,
std::min(structdim, dim)>(),
3341 template <
int dim,
int spacedim>
3354 template <
typename DoFProcessor>
3357 const unsigned int vertex_index,
3360 const DoFProcessor &dof_processor)
const
3362 const unsigned int n_indices =
3363 dof_handler.
get_fe(0).template n_dofs_per_object<0>();
3368 for (
unsigned int d = 0; d < n_indices; ++d, ++dof_indices_ptr)
3369 dof_processor(stored_indices[d], dof_indices_ptr);
3375 template <
int structdim,
typename DoFMapping,
typename DoFProcessor>
3379 const unsigned int obj_index,
3382 const std::integral_constant<int, structdim>,
3384 const DoFProcessor &dof_processor)
const
3386 const unsigned int n_indices =
3387 dof_handler.
get_fe(0).template n_dofs_per_object<structdim>();
3395 std::integral_constant<
int,
std::min(structdim, dim)>());
3396 for (
unsigned int d = 0; d < n_indices; ++d, ++dof_indices_ptr)
3397 dof_processor(stored_indices[structdim < dim ?
mapping(d) : d],
3407 template <
int dim,
int spacedim,
bool level_dof_access,
int structdim>
3410 const ::DoFAccessor<structdim, dim, spacedim, level_dof_access>
3412 std::vector<types::global_dof_index> &dof_indices,
3420 [](
auto stored_index,
auto dof_ptr) { *dof_ptr = stored_index; },
3426 template <
int dim,
int spacedim,
bool level_dof_access,
int structdim>
3429 const ::DoFAccessor<structdim, dim, spacedim, level_dof_access>
3431 const std::vector<types::global_dof_index> &dof_indices,
3442 "This function is intended to be used for DoFCellAccessor, i.e., "
3443 "dimension == structdim."));
3450 [](
auto &stored_index,
auto dof_ptr) { stored_index = *dof_ptr; },
3456 template <
int dim,
int spacedim,
bool level_dof_access,
int structdim>
3459 const ::DoFAccessor<structdim, dim, spacedim, level_dof_access>
3462 std::vector<types::global_dof_index> &dof_indices,
3466 ExcMessage(
"MG DoF indices cannot be queried in hp case"));
3472 [](
auto stored_index,
auto dof_ptr) { *dof_ptr = stored_index; },
3478 template <
int dim,
int spacedim,
bool level_dof_access,
int structdim>
3481 const ::DoFAccessor<structdim, dim, spacedim, level_dof_access>
3484 const std::vector<types::global_dof_index> &dof_indices,
3488 ExcMessage(
"MG DoF indices cannot be queried in hp case"));
3496 ExcMessage(
"This function is intended to be used for "
3497 "DoFCellAccessor, i.e., dimension == structdim."));
3504 [](
auto &stored_index,
auto dof_ptr) { stored_index = *dof_ptr; },
3510 template <
int dim,
int spacedim>
3518 const unsigned int obj_index,
3520 const unsigned int local_index,
3521 const std::integral_constant<int, dim>)
3526 return mg_level->dof_object.access_dof_index(
3535 template <
int dim,
int spacedim, std::enable_if_t<(dim > 1),
int> = 0>
3543 const unsigned int obj_index,
3545 const unsigned int local_index,
3546 const std::integral_constant<int, 1>)
3548 return mg_faces->lines.access_dof_index(
3557 template <
int spacedim>
3565 const unsigned int obj_index,
3567 const unsigned int local_index,
3568 const std::integral_constant<int, 2>)
3572 return mg_faces->quads.access_dof_index(
3582 template <
int dim,
int spacedim,
bool level_dof_access>
3585 const ::DoFCellAccessor<dim, spacedim, level_dof_access> &accessor,
3587 const unsigned int fe_index);
3593template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
3596 const unsigned int i,
3599 const auto fe_index =
3604 return ::internal::DoFAccessorImplementation::Implementation::
3610 std::integral_constant<int, structdim>());
3614template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
3618 const unsigned int i)
const
3623 this->dof_handler->mg_faces,
3627 std::integral_constant<int, structdim>());
3631template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
3634 const unsigned int i,
3638 const auto fe_index =
3649 std::integral_constant<int, structdim>(),
3655template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
3659 const unsigned int i,
3665 this->dof_handler->mg_faces,
3669 std::integral_constant<int, structdim>()) = index;
3674template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
3680 return ::internal::DoFAccessorImplementation::Implementation::
3684 std::integral_constant<int, structdim>());
3689template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
3692 const unsigned int n)
const
3695 return ::internal::DoFAccessorImplementation::Implementation::
3700 std::integral_constant<int, structdim>());
3705template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
3706inline std::set<types::fe_index>
3710 std::set<types::fe_index> active_fe_indices;
3713 return active_fe_indices;
3718template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
3724 return ::internal::DoFAccessorImplementation::Implementation::
3729 std::integral_constant<int, structdim>());
3734template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
3737 const unsigned int vertex,
3738 const unsigned int i,
3742 (((this->
dof_handler->hp_capability_enabled ==
false) &&
3756 return ::internal::DoFAccessorImplementation::Implementation::
3759 this->vertex_index(vertex),
3762 std::integral_constant<int, 0>());
3766template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
3770 const unsigned int vertex,
3771 const unsigned int i,
3774 const auto fe_index =
3780 ExcMessage(
"Multigrid DoF indices can only be accessed after "
3781 "DoFHandler::distribute_mg_dofs() has been called!"));
3787 "DoFHandler in hp-mode does not implement multilevel DoFs."));
3789 return this->
dof_handler->mg_vertex_dofs[this->vertex_index(vertex)]
3790 .access_index(level, i, this->
dof_handler->get_fe().n_dofs_per_vertex());
3795template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
3799 const unsigned int vertex,
3800 const unsigned int i,
3804 const auto fe_index =
3814 "DoFHandler in hp-mode does not implement multilevel DoFs."));
3816 this->
dof_handler->mg_vertex_dofs[this->vertex_index(vertex)].access_index(
3817 level, i, this->
dof_handler->get_fe().n_dofs_per_vertex()) = index;
3822template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
3828 ExcMessage(
"This function can only be called for active FE indices"));
3835template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
3836inline typename ::internal::DoFHandlerImplementation::
3837 Iterators<dim, spacedim, level_dof_access>::line_iterator
3839 const unsigned int i)
const
3847 ExcMessage(
"You can only ask for line zero if the "
3848 "current object is a line itself."));
3849 return typename ::internal::DoFHandlerImplementation::
3850 Iterators<dim, spacedim, level_dof_access>::cell_iterator(
3851 &this->get_triangulation(),
3862 return typename ::internal::DoFHandlerImplementation::
3863 Iterators<dim, spacedim, level_dof_access>::line_iterator(
3866 this->line_index(i),
3871template <
int structdim,
int dim,
int spacedim,
bool level_dof_access>
3872inline typename ::internal::DoFHandlerImplementation::
3873 Iterators<dim, spacedim, level_dof_access>::quad_iterator
3875 const unsigned int i)
const
3885 ExcMessage(
"You can only ask for quad zero if the "
3886 "current object is a quad itself."));
3887 return typename ::internal::DoFHandlerImplementation::
3888 Iterators<dim, spacedim>::cell_iterator(&this->get_triangulation(),
3899 return typename ::internal::DoFHandlerImplementation::
3900 Iterators<dim, spacedim, level_dof_access>::quad_iterator(
3903 this->quad_index(i),
3911template <
int spacedim,
bool level_dof_access>
3919template <
int spacedim,
bool level_dof_access>
3931template <
int spacedim,
bool level_dof_access>
3956 "This constructor can not be called for face iterators in 1d, "
3957 "except to default-construct iterator objects."));
3962template <
int spacedim,
bool level_dof_access>
3963template <
int structdim2,
int dim2,
int spacedim2>
3972template <
int spacedim,
bool level_dof_access>
3973template <
int structdim2,
int dim2,
int spacedim2,
bool level_dof_access2>
3982template <
int spacedim,
bool level_dof_access>
3993template <
int spacedim,
bool level_dof_access>
3996 const unsigned int ,
4005template <
int spacedim,
bool level_dof_access>
4014template <
int spacedim,
bool level_dof_access>
4017 std::vector<types::global_dof_index> &dof_indices,
4020 const auto fe_index =
4024 for (
unsigned int i = 0; i < dof_indices.size(); ++i)
4031 std::integral_constant<int, 0>());
4036template <
int spacedim,
bool level_dof_access>
4040 std::vector<types::global_dof_index> &dof_indices,
4043 const auto fe_index =
4049 for (
unsigned int i = 0; i < dof_indices.size(); ++i)
4057template <
int spacedim,
bool level_dof_access>
4060 const unsigned int vertex,
4061 const unsigned int i,
4064 const auto fe_index =
4070 return ::internal::DoFAccessorImplementation::Implementation::
4076 std::integral_constant<int, 0>());
4081template <
int spacedim,
bool level_dof_access>
4084 const unsigned int i,
4087 const auto fe_index =
4091 return ::internal::DoFAccessorImplementation::Implementation::
4097 std::integral_constant<int, 0>());
4102template <
int spacedim,
bool level_dof_access>
4111template <
int spacedim,
bool level_dof_access>
4114 const unsigned int )
const
4121template <
int spacedim,
bool level_dof_access>
4132template <
int spacedim,
bool level_dof_access>
4143template <
int spacedim,
bool level_dof_access>
4154template <
int spacedim,
bool level_dof_access>
4155template <
bool level_dof_access2>
4166template <
int spacedim,
bool level_dof_access>
4169 const unsigned int )
const
4176template <
int spacedim,
bool level_dof_access>
4177inline typename ::internal::DoFHandlerImplementation::
4178 Iterators<1, spacedim, level_dof_access>::line_iterator
4180 const unsigned int )
const
4183 return typename ::internal::DoFHandlerImplementation::
4184 Iterators<1, spacedim, level_dof_access>::line_iterator();
4189template <
int spacedim,
bool level_dof_access>
4190inline typename ::internal::DoFHandlerImplementation::
4191 Iterators<1, spacedim, level_dof_access>::quad_iterator
4193 const unsigned int )
const
4196 return typename ::internal::DoFHandlerImplementation::
4197 Iterators<1, spacedim, level_dof_access>::quad_iterator();
4202template <
int spacedim,
bool level_dof_access>
4203template <
int structdim2,
int dim2,
int spacedim2,
bool level_dof_access2>
4210 return (BaseClass::operator==(a));
4215template <
int spacedim,
bool level_dof_access>
4216template <
int structdim2,
int dim2,
int spacedim2,
bool level_dof_access2>
4223 return (BaseClass::operator!=(a));
4245 template <
int dim,
int spacedim,
bool level_dof_access>
4254 (
typename std::decay_t<
decltype(accessor)>::ExcInvalidObject()));
4255 Assert(
static_cast<unsigned int>(accessor.level()) <
4269 template <
int dim,
int spacedim,
bool level_dof_access>
4282 (
typename std::decay_t<
decltype(accessor)>::ExcInvalidObject()));
4283 Assert(
static_cast<unsigned int>(accessor.level()) <
4287 ExcMessage(
"Invalid finite element index."));
4291 [accessor.present_index] = i;
4300 template <
int dim,
int spacedim,
bool level_dof_access>
4309 (
typename std::decay_t<
decltype(accessor)>::ExcInvalidObject()));
4310 Assert(
static_cast<unsigned int>(accessor.level()) <
4317 [accessor.present_index];
4321 [accessor.present_index];
4329 template <
int dim,
int spacedim,
bool level_dof_access>
4342 (
typename std::decay_t<
decltype(accessor)>::ExcInvalidObject()));
4343 Assert(
static_cast<unsigned int>(accessor.level()) <
4347 ExcMessage(
"Invalid finite element index."));
4351 [accessor.present_index] = i;
4360 template <
int dim,
int spacedim,
bool level_dof_access>
4369 (
typename std::decay_t<
decltype(accessor)>::ExcInvalidObject()));
4370 Assert(
static_cast<unsigned int>(accessor.level()) <
4376 [accessor.present_index] !=
4386 template <
int dim,
int spacedim,
bool level_dof_access>
4395 (
typename std::decay_t<
decltype(accessor)>::ExcInvalidObject()));
4396 Assert(
static_cast<unsigned int>(accessor.level()) <
4402 [accessor.present_index] =
4411template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4417 :
DoFAccessor<dimension_, dimension_, space_dimension_, level_dof_access>(
4426template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4427template <
int structdim2,
int dim2,
int spacedim2>
4436template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4437template <
int structdim2,
int dim2,
int spacedim2,
bool level_dof_access2>
4446template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4450 const unsigned int i)
const
4454 this->neighbor_level(i),
4455 this->neighbor_index(i),
4468template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4472 const unsigned int i)
const
4475 q(this->tria, this->level() + 1, this->child_index(i), this->
dof_handler);
4487template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4488inline boost::container::small_vector<
4494 boost::container::small_vector<
4500 for (
unsigned int i = 0; i < this->n_children(); ++i)
4508template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4514 q(this->tria, this->level() - 1, this->parent_index(), this->
dof_handler);
4523 namespace DoFCellAccessorImplementation
4525 template <
int dim,
int spacedim,
bool level_dof_access>
4529 const ::DoFCellAccessor<dim, spacedim, level_dof_access> &cell,
4530 const unsigned int i,
4531 const std::integral_constant<int, 1>)
4534 &cell.get_triangulation(),
4535 ((i == 0) && cell.at_boundary(0) ?
4537 ((i == 1) && cell.at_boundary(1) ?
4540 cell.vertex_index(i),
4541 &cell.get_dof_handler());
4542 return ::TriaIterator<
4547 template <
int dim,
int spacedim,
bool level_dof_access>
4551 const ::DoFCellAccessor<dim, spacedim, level_dof_access> &cell,
4552 const unsigned int i,
4553 const std::integral_constant<int, 2>)
4555 return cell.
line(i);
4559 template <
int dim,
int spacedim,
bool level_dof_access>
4563 const ::DoFCellAccessor<dim, spacedim, level_dof_access> &cell,
4564 const unsigned int i,
4565 const std::integral_constant<int, 3>)
4567 return cell.
quad(i);
4574template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4577 level_dof_access>::face_iterator
4579 const unsigned int i)
const
4583 return ::internal::DoFCellAccessorImplementation::get_face(
4584 *
this, i, std::integral_constant<int, dimension_>());
4589template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4590inline boost::container::small_vector<
4597 boost::container::small_vector<
4603 for (
const unsigned int i : this->face_indices())
4606 *
this, i, std::integral_constant<int, dimension_>());
4613template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4617 std::vector<types::global_dof_index> &dof_indices)
const
4619 if (level_dof_access)
4627template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4628template <
class InputVector,
typename number>
4631 const InputVector &values,
4639template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4640template <
typename Number,
typename ForwardIterator>
4644 ForwardIterator local_values_begin,
4645 ForwardIterator local_values_end)
const
4647 (void)local_values_end;
4648 Assert(this->is_artificial() ==
false,
4649 ExcMessage(
"Can't ask for DoF indices on artificial cells."));
4653 Assert(
static_cast<unsigned int>(local_values_end - local_values_begin) ==
4654 this->
get_fe().n_dofs_per_cell(),
4656 Assert(values.size() == this->get_dof_handler().n_dofs(),
4660 dof_indices(this->
get_fe().n_dofs_per_cell());
4664 boost::container::small_vector<Number, 100> values_temp(local_values_end -
4665 local_values_begin);
4670 using view_type = std::remove_reference_t<
decltype(*local_values_begin)>;
4672 local_values_end - local_values_begin);
4673 std::copy(values_temp.begin(), values_temp.end(), values_view2.
begin());
4678template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4679template <
class InputVector,
typename ForwardIterator>
4683 const InputVector &values,
4684 ForwardIterator local_values_begin,
4685 ForwardIterator local_values_end)
const
4687 Assert(this->is_artificial() ==
false,
4688 ExcMessage(
"Can't ask for DoF indices on artificial cells."));
4691 Assert(
static_cast<unsigned int>(local_values_end - local_values_begin) ==
4692 this->
get_fe().n_dofs_per_cell(),
4694 Assert(values.size() == this->get_dof_handler().n_dofs(),
4699 dof_indices(this->
get_fe().n_dofs_per_cell());
4711template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4712template <
class OutputVector,
typename number>
4716 OutputVector &values)
const
4718 Assert(this->is_artificial() ==
false,
4719 ExcMessage(
"Can't ask for DoF indices on artificial cells."));
4722 Assert(
static_cast<unsigned int>(local_values.
size()) ==
4723 this->get_fe().n_dofs_per_cell(),
4725 Assert(values.size() == this->get_dof_handler().n_dofs(),
4731 dof_indices(this->
get_fe().n_dofs_per_cell());
4735 for (
unsigned int i = 0; i < this->
get_fe().n_dofs_per_cell(); ++i)
4743template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4751 "For DoFHandler objects in hp-mode, finite elements are only "
4752 "associated with active cells. Consequently, you can not ask "
4753 "for the active finite element on cells with children."));
4757 Assert(this->reference_cell() == fe.reference_cell(),
4759 "The reference-cell type used on this cell (" +
4760 this->reference_cell().to_string() +
4761 ") does not match the reference-cell type of the finite element "
4762 "associated with this cell (" +
4763 fe.reference_cell().to_string() +
4765 "Did you accidentally use simplex elements on hypercube meshes "
4766 "(or the other way around), or are you using a mixed mesh and "
4767 "assigned a simplex element to a hypercube cell (or the other "
4768 "way around) via the active_fe_index?"));
4775template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4783 "You can not ask for the active FE index on a cell that has "
4784 "children because no degrees of freedom are assigned "
4785 "to this cell and, consequently, no finite element "
4786 "is associated with it."));
4788 (this->is_locally_owned() || this->is_ghost()),
4789 ExcMessage(
"You can only query active FE index information on cells "
4790 "that are either locally owned or (after distributing "
4791 "degrees of freedom) are ghost cells."));
4793 return ::internal::DoFCellAccessorImplementation::Implementation::
4794 active_fe_index(*
this);
4799template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4806 ExcMessage(
"You can not set the active FE index on a cell that has "
4807 "children because no degrees of freedom will be assigned "
4811 this->is_locally_owned(),
4812 ExcMessage(
"You can only set active FE index information on cells "
4813 "that are locally owned. On ghost cells, this information "
4814 "will automatically be propagated from the owning process "
4815 "of that cell, and there is no information at all on "
4816 "artificial cells."));
4824template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4833 "For DoFHandler objects in hp-mode, finite elements are only "
4834 "associated with active cells. Consequently, you can not ask "
4835 "for the future finite element on cells with children."));
4842template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4848 (this->has_children() ==
false),
4850 "You can not ask for the future FE index on a cell that has "
4851 "children because no degrees of freedom are assigned "
4852 "to this cell and, consequently, no finite element "
4853 "is associated with it."));
4855 (this->is_locally_owned()),
4856 ExcMessage(
"You can only query future FE index information on cells "
4857 "that are locally owned."));
4859 return ::internal::DoFCellAccessorImplementation::Implementation::
4860 future_fe_index(*
this);
4865template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4871 (this->has_children() ==
false),
4872 ExcMessage(
"You can not set the future FE index on a cell that has "
4873 "children because no degrees of freedom will be assigned "
4877 this->is_locally_owned(),
4878 ExcMessage(
"You can only set future FE index information on cells "
4879 "that are locally owned."));
4887template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4893 (this->has_children() ==
false),
4895 "You can not ask for the future FE index on a cell that has "
4896 "children because no degrees of freedom are assigned "
4897 "to this cell and, consequently, no finite element "
4898 "is associated with it."));
4900 (this->is_locally_owned()),
4901 ExcMessage(
"You can only query future FE index information on cells "
4902 "that are locally owned."));
4904 return ::internal::DoFCellAccessorImplementation::Implementation::
4905 future_fe_index_set(*
this);
4910template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4916 (this->has_children() ==
false),
4918 "You can not ask for the future FE index on a cell that has "
4919 "children because no degrees of freedom are assigned "
4920 "to this cell and, consequently, no finite element "
4921 "is associated with it."));
4923 (this->is_locally_owned()),
4924 ExcMessage(
"You can only query future FE index information on cells "
4925 "that are locally owned."));
4933template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4934template <
typename number,
typename OutputVector>
4938 OutputVector &global_destination)
const
4942 global_destination);
4947template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4948template <
typename ForwardIterator,
typename OutputVector>
4952 ForwardIterator local_source_end,
4953 OutputVector &global_destination)
const
4957 Assert(
static_cast<unsigned int>(local_source_end - local_source_begin) ==
4958 this->
get_fe().n_dofs_per_cell(),
4966 internal::ArrayViewHelper::is_contiguous(local_source_begin,
4969 "This function can not be called with iterator types that do not point to contiguous memory."));
4971 const unsigned int n_dofs = local_source_end - local_source_begin;
4974 dof_indices(n_dofs);
4979 global_destination.add(n_dofs, dof_indices.data(), &(*local_source_begin));
4984template <
int dimension_,
int space_dimension_,
bool level_dof_access>
4985template <
typename ForwardIterator,
typename OutputVector>
4990 ForwardIterator local_source_begin,
4991 ForwardIterator local_source_end,
4992 OutputVector &global_destination)
const
4996 Assert(local_source_end - local_source_begin ==
4997 this->
get_fe().n_dofs_per_cell(),
5005 dof_indices(this->
get_fe().n_dofs_per_cell());
5013 global_destination);
5018template <
int dimension_,
int space_dimension_,
bool level_dof_access>
5019template <
typename number,
typename OutputMatrix>
5023 OutputMatrix &global_destination)
const
5027 Assert(local_source.
m() == this->get_fe().n_dofs_per_cell(),
5029 Assert(local_source.
n() == this->get_fe().n_dofs_per_cell(),
5038 const unsigned int n_dofs = local_source.
m();
5041 dof_indices(n_dofs);
5046 for (
unsigned int i = 0; i < n_dofs; ++i)
5047 global_destination.add(dof_indices[i],
5050 &local_source(i, 0));
5055template <
int dimension_,
int space_dimension_,
bool level_dof_access>
5056template <
typename number,
typename OutputMatrix,
typename OutputVector>
5061 OutputMatrix &global_matrix,
5062 OutputVector &global_vector)
const
5066 Assert(local_matrix.
m() == this->get_fe().n_dofs_per_cell(),
5068 Assert(local_matrix.
n() == this->get_fe().n_dofs_per_cell(),
5074 Assert(local_vector.
size() == this->get_fe().n_dofs_per_cell(),
5081 const unsigned int n_dofs = this->
get_fe().n_dofs_per_cell();
5083 dof_indices(n_dofs);
5088 for (
unsigned int i = 0; i < n_dofs; ++i)
5090 global_matrix.add(dof_indices[i],
5093 &local_matrix(i, 0));
5094 global_vector(dof_indices[i]) += local_vector(i);
ArrayView< std::remove_reference_t< typename std::iterator_traits< Iterator >::reference >, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
void get_dof_values(const VectorType &global_vector, ForwardIteratorInd local_indices_begin, ForwardIteratorVec local_vector_begin, ForwardIteratorVec local_vector_end) const
void distribute_local_to_global(const InVector &local_vector, const std::vector< size_type > &local_dof_indices, OutVector &global_vector) const
friend struct ::internal::DoFHandlerImplementation::Policy::Implementation
void get_mg_dof_indices(const int level, std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index=numbers::invalid_fe_index) const
DoFAccessor< 0, 1, spacedim, level_dof_access > & operator=(const DoFAccessor< 0, 1, spacedim, level_dof_access > &da)=delete
void get_dof_indices(std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index=numbers::invalid_fe_index) const
typename::internal::DoFHandlerImplementation::Iterators< 1, spacedim, level_dof_access >::line_iterator line(const unsigned int i) const
DoFAccessor< 0, 1, spacedim, level_dof_access > & operator=(DoFAccessor< 0, 1, spacedim, level_dof_access > &&) noexcept=default
types::global_dof_index vertex_dof_index(const unsigned int vertex, const unsigned int i, const types::fe_index fe_index=numbers::invalid_fe_index) const
TriaAccessor< 0, 1, spacedim > BaseClass
DoFAccessor(DoFAccessor< 0, 1, spacedim, level_dof_access > &&)=default
const DoFHandler< 1, spacedim > & get_dof_handler() const
DoFHandler< 1, spacedim > * dof_handler
types::global_dof_index dof_index(const unsigned int i, const types::fe_index fe_index=numbers::invalid_fe_index) const
typename::internal::DoFHandlerImplementation::Iterators< 1, spacedim, level_dof_access >::quad_iterator quad(const unsigned int i) const
DoFAccessor(const DoFAccessor< 0, 1, spacedim, level_dof_access > &)=default
types::fe_index nth_active_fe_index(const unsigned int n) const
const FiniteElement< 1, spacedim > & get_fe(const types::fe_index fe_index) const
friend class TriaRawIterator
void set_dof_index(const unsigned int i, const types::global_dof_index index, const types::fe_index fe_index=numbers::invalid_fe_index) const
static constexpr unsigned int space_dimension
void set_dof_handler(DoFHandler< 1, spacedim > *dh)
unsigned int n_active_fe_indices() const
DoFHandler< 1, spacedim > AccessorData
TriaIterator< DoFAccessor< 0, 1, spacedim, level_dof_access > > child(const unsigned int c) const
bool fe_index_is_active(const types::fe_index fe_index) const
void copy_from(const DoFAccessor< 0, 1, spacedim, level_dof_access2 > &a)
static constexpr unsigned int dimension
typename::internal::DoFHandlerImplementation::Iterators< dim, spacedim, level_dof_access >::line_iterator line(const unsigned int i) const
const DoFHandler< dim, spacedim > & get_dof_handler() const
void set_mg_dof_index(const int level, const unsigned int i, const types::global_dof_index index) const
static constexpr unsigned int space_dimension
DoFAccessor< structdim, dim, spacedim, level_dof_access > & operator=(const DoFAccessor< structdim, dim, spacedim, level_dof_access > &da)=delete
types::fe_index nth_active_fe_index(const unsigned int n) const
DoFAccessor(DoFAccessor< structdim, dim, spacedim, level_dof_access > &&)
DoFAccessor(const DoFAccessor< structdim, dim, spacedim, level_dof_access2 > &)
static constexpr unsigned int dimension
TriaIterator< DoFAccessor< structdim, dim, spacedim, level_dof_access > > child(const unsigned int c) const
void set_mg_vertex_dof_index(const int level, const unsigned int vertex, const unsigned int i, const types::global_dof_index index, const types::fe_index fe_index=numbers::invalid_fe_index) const
void set_dof_handler(DoFHandler< dim, spacedim > *dh)
DoFAccessor(const DoFAccessor< structdim2, dim2, spacedim2, level_dof_access2 > &)
DoFAccessor< structdim, dim, spacedim, level_dof_access > & operator=(DoFAccessor< structdim, dim, spacedim, level_dof_access > &&)
std::set< types::fe_index > get_active_fe_indices() const
DoFAccessor(const DoFAccessor< structdim, dim, spacedim, level_dof_access > &)=default
void set_mg_dof_indices(const int level, const std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index=numbers::invalid_fe_index)
void get_mg_dof_indices(const int level, std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index=numbers::invalid_fe_index) const
types::global_dof_index mg_vertex_dof_index(const int level, const unsigned int vertex, const unsigned int i, const types::fe_index fe_index=numbers::invalid_fe_index) const
DoFAccessor(const Triangulation< dim, spacedim > *tria, const int level, const int index, const DoFHandler< dim, spacedim > *dof_handler)
bool operator!=(const DoFAccessor< structdim2, dim2, spacedim2, level_dof_access2 > &) const
void copy_from(const TriaAccessorBase< structdim, dim, spacedim > &da)
types::global_dof_index dof_index(const unsigned int i, const types::fe_index fe_index=numbers::invalid_fe_index) const
typename::internal::DoFHandlerImplementation::Iterators< dim, spacedim, level_dof_access >::quad_iterator quad(const unsigned int i) const
friend class TriaRawIterator
DoFHandler< dimension, space_dimension > AccessorData
void copy_from(const DoFAccessor< structdim, dim, spacedim, level_dof_access2 > &a)
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index fe_index) const
typename ::internal::DoFAccessorImplementation:: Inheritance< structdim, dimension, space_dimension >::BaseClass BaseClass
void get_dof_indices(std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index=numbers::invalid_fe_index) const
bool operator==(const DoFAccessor< structdim2, dim2, spacedim2, level_dof_access2 > &) const
types::global_dof_index mg_dof_index(const int level, const unsigned int i) const
void set_dof_index(const unsigned int i, const types::global_dof_index index, const types::fe_index fe_index=numbers::invalid_fe_index) const
unsigned int n_active_fe_indices() const
static bool is_level_cell()
types::global_dof_index vertex_dof_index(const unsigned int vertex, const unsigned int i, const types::fe_index fe_index=numbers::invalid_fe_index) const
DoFHandler< dim, spacedim > * dof_handler
DoFAccessor(const InvalidAccessor< structdim2, dim2, spacedim2 > &)
bool fe_index_is_active(const types::fe_index fe_index) const
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > periodic_neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
boost::container::small_vector< TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > >, GeometryInfo< dimension_ >::max_children_per_cell > child_iterators() const
DoFCellAccessor(DoFCellAccessor< dimension_, space_dimension_, level_dof_access > &&)=default
DoFHandler< dimension_, space_dimension_ > AccessorData
void get_active_or_mg_dof_indices(std::vector< types::global_dof_index > &dof_indices) const
void get_dof_values(const InputVector &values, Vector< number > &local_values) const
boost::container::small_vector< face_iterator, GeometryInfo< dimension_ >::faces_per_cell > face_iterators() const
types::fe_index future_fe_index() const
DoFCellAccessor< dimension_, space_dimension_, level_dof_access > & operator=(const DoFCellAccessor< dimension_, space_dimension_, level_dof_access > &da)=delete
const FiniteElement< dimension_, space_dimension_ > & get_fe() const
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > child(const unsigned int i) const
DoFCellAccessor(const Triangulation< dimension_, space_dimension_ > *tria, const int level, const int index, const AccessorData *local_data)
void set_future_fe_index(const types::fe_index i) const
void distribute_local_to_global(const Vector< number > &local_source, OutputVector &global_destination) const
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > neighbor_or_periodic_neighbor(const unsigned int i) const
const FiniteElement< dimension_, space_dimension_ > & get_future_fe() const
void get_dof_values(const AffineConstraints< typename InputVector::value_type > &constraints, const InputVector &values, ForwardIterator local_values_begin, ForwardIterator local_values_end) const
void distribute_local_to_global(const FullMatrix< number > &local_source, OutputMatrix &global_destination) const
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > neighbor(const unsigned int i) const
static const unsigned int dim
void set_active_fe_index(const types::fe_index i) const
void distribute_local_to_global_by_interpolation(const Vector< number > &local_values, OutputVector &values, const types::fe_index fe_index=numbers::invalid_fe_index) const
DoFCellAccessor(const DoFAccessor< structdim2, dim2, spacedim2, level_dof_access2 > &)
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > periodic_neighbor(const unsigned int i) const
DoFCellAccessor(const InvalidAccessor< structdim2, dim2, spacedim2 > &)
static const unsigned int spacedim
void get_interpolated_dof_values(const ReadVector< Number > &values, Vector< Number > &interpolated_values, const types::fe_index fe_index=numbers::invalid_fe_index) const
face_iterator face(const unsigned int i) const
void clear_future_fe_index() const
void distribute_local_to_global(const FullMatrix< number > &local_matrix, const Vector< number > &local_vector, OutputMatrix &global_matrix, OutputVector &global_vector) const
void set_dof_indices(const std::vector< types::global_dof_index > &dof_indices)
void distribute_local_to_global(const AffineConstraints< typename OutputVector::value_type > &constraints, ForwardIterator local_source_begin, ForwardIterator local_source_end, OutputVector &global_destination) const
void set_dof_values(const Vector< number > &local_values, OutputVector &values) const
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
void set_dof_values_by_interpolation(const Vector< number > &local_values, OutputVector &values, const types::fe_index fe_index=numbers::invalid_fe_index, const bool perform_check=false) const
void set_mg_dof_indices(const std::vector< types::global_dof_index > &dof_indices)
DoFCellAccessor(const DoFCellAccessor< dimension_, space_dimension_, level_dof_access > &)=default
void get_mg_dof_indices(std::vector< types::global_dof_index > &dof_indices) const
void distribute_local_to_global(ForwardIterator local_source_begin, ForwardIterator local_source_end, OutputVector &global_destination) const
void get_dof_values(const ReadVector< Number > &values, ForwardIterator local_values_begin, ForwardIterator local_values_end) const
~DoFCellAccessor()=default
DoFHandler< dimension_, space_dimension_ > Container
bool future_fe_index_set() const
DoFCellAccessor< dimension_, space_dimension_, level_dof_access > & operator=(DoFCellAccessor< dimension_, space_dimension_, level_dof_access > &&)=default
TriaIterator< DoFAccessor< dimension_ - 1, dimension_, space_dimension_, level_dof_access > > face_iterator
void get_dof_indices(std::vector< types::global_dof_index > &dof_indices) const
types::fe_index active_fe_index() const
void get_interpolated_dof_values(const ReadVector< Number > &values, ArrayView< Number > interpolated_values, const types::fe_index fe_index=numbers::invalid_fe_index) const
DoFAccessor< dimension_, dimension_, space_dimension_, level_dof_access > BaseClass
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > parent() const
std::vector< std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel< dim > > > mg_levels
static const types::fe_index default_fe_index
std::vector< std::vector< types::fe_index > > hp_cell_future_fe_indices
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
std::vector< std::vector< types::fe_index > > hp_cell_active_fe_indices
std::vector< MGVertexDoFs > mg_vertex_dofs
std::vector< std::array< std::vector< types::global_dof_index >, dim+1 > > object_dof_indices
std::vector< std::array< std::vector< offset_type >, dim+1 > > object_dof_ptr
std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces< dim > > mg_faces
bool hp_capability_enabled
bool has_hp_capabilities() const
std::array< std::vector< offset_type >, dim+1 > hp_object_fe_ptr
std::array< std::vector< types::fe_index >, dim+1 > hp_object_fe_indices
typename InvalidAccessor< structdim, dim, spacedim >::AccessorData AccessorData
DoFInvalidAccessor(const void *parent=nullptr, const int level=-1, const int index=-1, const AccessorData *local_data=nullptr)
unsigned int n_dofs_per_vertex() const
void add_indices(const ForwardIterator &begin, const ForwardIterator &end)
InvalidAccessor(const void *parent=nullptr, const int level=-1, const int index=-1, const AccessorData *local_data=nullptr)
void import_elements(const ::Vector< Number > &vec, VectorOperation::values operation, const std::shared_ptr< const Utilities::MPI::CommunicationPatternBase > &communication_pattern={})
friend class TriaIterator
TriaAccessorBase(const Triangulation< dim, spacedim > *parent=nullptr, const int level=-1, const int index=-1, const AccessorData *=nullptr)
unsigned int global_vertex_index
TriaAccessor(const Triangulation< 1, spacedim > *tria, const VertexKind vertex_kind, const unsigned int vertex_index)
unsigned int vertex_index(const unsigned int i=0) const
void copy_from(const TriaAccessor &)
Point< spacedim > & vertex(const unsigned int i=0) const
const Triangulation< 1, spacedim > * tria
TriaIterator< TriaAccessor< structdim, dim, spacedim > > child(const unsigned int i) const
IteratorState::IteratorStates state() const
virtual size_type size() const override
#define DEAL_II_ALWAYS_INLINE
#define DEAL_II_NAMESPACE_OPEN
constexpr bool running_in_debug_mode()
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_ASSERT_UNREACHABLE()
#define DEAL_II_NOT_IMPLEMENTED()
static ::ExceptionBase & ExcVectorNotEmpty()
#define DeclException0(Exception0)
static ::ExceptionBase & ExcVectorDoesNotMatch()
static ::ExceptionBase & ExcInvalidObject()
static ::ExceptionBase & ExcVectorNotEmpty()
static ::ExceptionBase & ExcMatrixDoesNotMatch()
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
static ::ExceptionBase & ExcNotImplementedWithHP()
static ::ExceptionBase & ExcCantCompareIterators()
static ::ExceptionBase & ExcNotActive()
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcMatrixDoesNotMatch()
#define AssertIndexRange(index, range)
#define DeclExceptionMsg(Exception, defaulttext)
static ::ExceptionBase & ExcInvalidObject()
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcNotActive()
static ::ExceptionBase & ExcCantCompareIterators()
static ::ExceptionBase & ExcVectorDoesNotMatch()
static ::ExceptionBase & ExcMessage(std::string arg1)
const bool IsBlockVector< VectorType >::value
MappingQ< dim, spacedim > StaticMappingQ1< dim, spacedim >::mapping
@ past_the_end
Iterator reached end of container.
types::fe_index get_fe_index_or_default(const DoFAccessor< structdim, dim, spacedim, level_dof_access > &cell, const types::fe_index fe_index)
void get_cell_dof_indices(const ::DoFCellAccessor< dim, spacedim, level_dof_access > &accessor, Implementation::dof_index_vector_type &dof_indices, const unsigned int fe_index)
TriaIterator< ::DoFAccessor< dim - 1, dim, spacedim, level_dof_access > > get_face(const ::DoFCellAccessor< dim, spacedim, level_dof_access > &cell, const unsigned int i, const std::integral_constant< int, 1 >)
constexpr types::global_dof_index invalid_dof_index
constexpr types::geometric_orientation reverse_line_orientation
constexpr types::geometric_orientation default_geometric_orientation
constexpr types::fe_index invalid_fe_index
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
unsigned short int fe_index
unsigned int global_dof_index
static constexpr unsigned int faces_per_cell
static constexpr unsigned int max_children_per_cell
void process_vertex_dofs(DoFHandler< dim, spacedim > &dof_handler, const unsigned int vertex_index, const types::fe_index fe_index, types::global_dof_index *&dof_indices_ptr, const DoFProcessor &dof_processor) const
void process_dofs(const DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_level, const unsigned int obj_index, const types::fe_index fe_index, const DoFMapping &mapping, const std::integral_constant< int, structdim >, types::global_dof_index *&dof_indices_ptr, const DoFProcessor &dof_processor) const
void process_dofs(const DoFHandler< dim, spacedim > &dof_handler, const unsigned int, const unsigned int obj_index, const types::fe_index fe_index, const DoFMapping &mapping, const std::integral_constant< int, structdim >, types::global_dof_index *&dof_indices_ptr, const DoFProcessor &dof_processor) const
MGDoFIndexProcessor(const unsigned int level)
void process_vertex_dofs(DoFHandler< dim, spacedim > &dof_handler, const unsigned int vertex_index, const types::fe_index, types::global_dof_index *&dof_indices_ptr, const DoFProcessor &dof_processor) const
static types::global_dof_index * get_array_ptr(const std::tuple<> &)
static void process_dof_indices(const ::DoFAccessor< structdim, dim, spacedim, level_dof_access > &accessor, const DoFIndicesType &const_dof_indices, const types::fe_index fe_index_, const DoFOperation &dof_operation, const DoFProcessor &dof_processor, const bool count_level_dofs)
static void get_dof_indices(const ::DoFAccessor< structdim, dim, spacedim, level_dof_access > &accessor, std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index)
static void extract_subvector_to(const LinearAlgebra::TpetraWrappers::Vector< Number, MemorySpace > &values, const types::global_dof_index *cache_begin, const types::global_dof_index *cache_end, ForwardIterator local_values_begin)
static std::set< types::fe_index > get_active_fe_indices(const DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_level, const unsigned int obj_index, const std::integral_constant< int, structdim > &t)
static types::global_dof_index * get_array_ptr(const ArrayType &array)
static unsigned int get_array_length(const std::tuple<> &)
boost::container::small_vector<::types::global_dof_index, 100 > dof_index_vector_type
static unsigned int n_active_fe_indices(const DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_level, const unsigned int obj_index, const std::integral_constant< int, structdim > &)
static void set_dof_index(const DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_level, const unsigned int obj_index, const types::fe_index fe_index, const unsigned int local_index, const std::integral_constant< int, structdim > &dd, const types::global_dof_index global_index)
static void extract_subvector_to(const LinearAlgebra::EpetraWrappers::Vector &values, const types::global_dof_index *cache_begin, const types::global_dof_index *cache_end, ForwardIterator local_values_begin)
static void get_mg_dof_indices(const ::DoFAccessor< structdim, dim, spacedim, level_dof_access > &accessor, const int level, std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index)
static bool fe_index_is_active(const DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_level, const unsigned int obj_index, const types::fe_index fe_index, const std::integral_constant< int, structdim > &)
static types::global_dof_index & get_mg_dof_index(const DoFHandler< dim, spacedim > &dof_handler, const std::unique_ptr< internal::DoFHandlerImplementation::DoFLevel< dim > > &, const std::unique_ptr< internal::DoFHandlerImplementation::DoFFaces< dim > > &mg_faces, const unsigned int obj_index, const types::fe_index fe_index, const unsigned int local_index, const std::integral_constant< int, 1 >)
static types::global_dof_index & get_mg_dof_index(const DoFHandler< dim, spacedim > &dof_handler, const std::unique_ptr< internal::DoFHandlerImplementation::DoFLevel< dim > > &mg_level, const std::unique_ptr< internal::DoFHandlerImplementation::DoFFaces< dim > > &, const unsigned int obj_index, const types::fe_index fe_index, const unsigned int local_index, const std::integral_constant< int, dim >)
static std::pair< unsigned int, unsigned int > process_object_range(const ::DoFAccessor< structdim, dim, spacedim, level_dof_access > accessor, const types::fe_index fe_index)
static types::global_dof_index & mg_vertex_dof_index(DoFHandler< dim, spacedim > &dof_handler, const int level, const unsigned int vertex_index, const unsigned int i)
static void set_mg_dof_indices(const ::DoFAccessor< structdim, dim, spacedim, level_dof_access > &accessor, const int level, const std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index)
static void set_dof_indices(const ::DoFAccessor< structdim, dim, spacedim, level_dof_access > &accessor, const std::vector< types::global_dof_index > &dof_indices, const types::fe_index fe_index)
static void process_dof_index(const DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_level, const unsigned int obj_index, const types::fe_index fe_index, const unsigned int local_index, const std::integral_constant< int, structdim > &, GlobalIndexType &global_index, const DoFPProcessor &process)
static types::global_dof_index & get_mg_dof_index(const DoFHandler< 3, spacedim > &dof_handler, const std::unique_ptr< internal::DoFHandlerImplementation::DoFLevel< 3 > > &, const std::unique_ptr< internal::DoFHandlerImplementation::DoFFaces< 3 > > &mg_faces, const unsigned int obj_index, const types::fe_index fe_index, const unsigned int local_index, const std::integral_constant< int, 2 >)
static std::pair< unsigned int, unsigned int > process_object_range(const DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_level, const unsigned int obj_index, const types::fe_index fe_index, const std::integral_constant< int, structdim > &)
static void extract_subvector_to(const InputVector &values, const types::global_dof_index *cache, const types::global_dof_index *cache_end, ForwardIterator local_values_begin)
static std::vector< unsigned int > sort_indices(const types::global_dof_index *v_begin, const types::global_dof_index *v_end)
static types::fe_index nth_active_fe_index(const DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_level, const unsigned int obj_index, const unsigned int local_index, const std::integral_constant< int, structdim > &)
static void process_object(const DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_level, const unsigned int obj_index, const types::fe_index fe_index, const DoFMapping &mapping, const std::integral_constant< int, structdim > &dd, types::global_dof_index *&dof_indices_ptr, const DoFProcessor &process)
static types::global_dof_index get_dof_index(const DoFHandler< dim, spacedim > &dof_handler, const unsigned int obj_level, const unsigned int obj_index, const types::fe_index fe_index, const unsigned int local_index, const std::integral_constant< int, structdim > &dd)
static unsigned int n_dof_indices(const ::DoFAccessor< structdim, dim, spacedim, level_dof_access > &accessor, const types::fe_index fe_index_, const bool count_level_dofs)
static std::pair< unsigned int, unsigned int > process_object_range(::DoFInvalidAccessor< structdim, dim, spacedim >, const unsigned int)
static unsigned int get_array_length(const ArrayType &array)
::CellAccessor< dim, spacedim > BaseClass
::TriaAccessor< structdim, dim, spacedim > BaseClass
static types::fe_index future_fe_index(const DoFCellAccessor< dim, spacedim, level_dof_access > &accessor)
static void clear_future_fe_index(const DoFCellAccessor< dim, spacedim, level_dof_access > &accessor)
static bool future_fe_index_set(const DoFCellAccessor< dim, spacedim, level_dof_access > &accessor)
static void set_active_fe_index(const DoFCellAccessor< dim, spacedim, level_dof_access > &accessor, const types::fe_index i)
static void set_future_fe_index(const DoFCellAccessor< dim, spacedim, level_dof_access > &accessor, const types::fe_index i)
static types::fe_index active_fe_index(const DoFCellAccessor< dim, spacedim, level_dof_access > &accessor)
static void set(typename VectorType::value_type value, const types::global_dof_index i, VectorType &V)