Reference documentation for deal.II version 8.5.1
dof_accessor.cc
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2016 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #include <deal.II/dofs/dof_accessor.h>
17 #include <deal.II/dofs/dof_handler.h>
18 #include <deal.II/dofs/dof_levels.h>
19 #include <deal.II/hp/dof_handler.h>
20 #include <deal.II/grid/tria_boundary.h>
21 #include <deal.II/grid/tria_iterator.h>
22 #include <deal.II/grid/tria_iterator.templates.h>
23 #include <deal.II/fe/fe.h>
24 
25 #include <vector>
26 
27 DEAL_II_NAMESPACE_OPEN
28 
29 /*------------------------- Static variables: DoFAccessor -----------------------*/
30 
31 template <int structdim, typename DoFHandlerType, bool level_dof_access>
33 
34 template <int structdim, typename DoFHandlerType, bool level_dof_access>
36 
37 
38 
39 /*------------------------- Functions: DoFCellAccessor -----------------------*/
40 
41 
42 
43 
44 template <typename DoFHandlerType, bool lda>
45 void
47 {
48  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
49  ExcMessage ("DoFHandler not initialized"));
50 
51  Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject());
52 
53  internal::DoFCellAccessor::Implementation::
54  update_cell_dof_indices_cache (*this);
55 }
56 
57 
58 
59 template <typename DoFHandlerType, bool lda>
60 void
61 DoFCellAccessor<DoFHandlerType,lda>::set_dof_indices (const std::vector<types::global_dof_index> &local_dof_indices)
62 {
63  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
64  ExcMessage ("DoFHandler not initialized"));
65 
66  Assert (this->dof_handler != 0, typename BaseClass::ExcInvalidObject());
67 
68  internal::DoFCellAccessor::Implementation::
69  set_dof_indices (*this, local_dof_indices);
70 }
71 
72 
73 
74 
75 template <typename DoFHandlerType, bool lda>
78  const unsigned int subface) const
79 {
82  return TriaIterator<DoFCellAccessor<DoFHandlerType,lda> > (*q, this->dof_handler);
83 }
84 
85 
86 
87 template <typename DoFHandlerType, bool lda>
90  const unsigned int subface) const
91 {
94  return TriaIterator<DoFCellAccessor<DoFHandlerType,lda> > (*q, this->dof_handler);
95 }
96 
97 
98 
99 template <typename DoFHandlerType, bool lda>
100 inline
103 {
106  return TriaIterator<DoFCellAccessor<DoFHandlerType,lda> > (*q, this->dof_handler);
107 }
108 
109 
110 
111 template <typename DoFHandlerType, bool lda>
112 inline
115 {
118  return TriaIterator<DoFCellAccessor<DoFHandlerType,lda> > (*q, this->dof_handler);
119 }
120 
121 
122 
123 
124 // --------------------------------------------------------------------------
125 // explicit instantiations
126 #include "dof_accessor.inst"
127 
128 DEAL_II_NAMESPACE_CLOSE
TriaIterator< CellAccessor< dim, spacedim > > neighbor_or_periodic_neighbor(const unsigned int i) const
TriaIterator< DoFCellAccessor< DoFHandlerType, level_dof_access > > periodic_neighbor(const unsigned int i) const
TriaIterator< CellAccessor< dim, spacedim > > neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
void update_cell_dof_indices_cache() const
Definition: dof_accessor.cc:46
static ::ExceptionBase & ExcMessage(std::string arg1)
#define Assert(cond, exc)
Definition: exceptions.h:313
TriaIterator< DoFCellAccessor< DoFHandlerType, level_dof_access > > neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
Definition: dof_accessor.cc:77
void set_dof_indices(const std::vector< types::global_dof_index > &dof_indices)
Definition: dof_accessor.cc:61
TriaIterator< DoFCellAccessor< DoFHandlerType, level_dof_access > > neighbor_or_periodic_neighbor(const unsigned int i) const
TriaIterator< CellAccessor< dim, spacedim > > periodic_neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
TriaIterator< CellAccessor< dim, spacedim > > periodic_neighbor(const unsigned int i) const
TriaIterator< DoFCellAccessor< DoFHandlerType, level_dof_access > > periodic_neighbor_child_on_subface(const unsigned int face_no, const unsigned int subface_no) const
Definition: dof_accessor.cc:89