Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
dof_objects.cc
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2006 - 2018 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.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #include <deal.II/base/exceptions.h>
17 #include <deal.II/base/memory_consumption.h>
18 
19 #include <deal.II/dofs/dof_handler.h>
20 #include <deal.II/dofs/dof_objects.h>
21 
22 #include <deal.II/fe/fe.h>
23 
24 DEAL_II_NAMESPACE_OPEN
25 
26 namespace internal
27 {
28  namespace DoFHandlerImplementation
29  {
30  template <int dim>
31  std::size_t
33  {
35  }
36 
37 
38 
39  template <int dim>
40  template <int dh_dim, int spacedim>
41  void
43  const ::DoFHandler<dh_dim, spacedim> &dof_handler,
44  const unsigned int obj_index,
45  const unsigned int fe_index,
46  const unsigned int local_index,
47  const types::global_dof_index global_index)
48  {
49  (void)fe_index;
50  Assert(
52  ExcMessage(
53  "Only the default FE index is allowed for non-hp DoFHandler objects"));
54  Assert(
55  local_index < dof_handler.get_fe().template n_dofs_per_object<dim>(),
56  ExcIndexRange(local_index,
57  0,
58  dof_handler.get_fe().template n_dofs_per_object<dim>()));
59  Assert(obj_index *
60  dof_handler.get_fe().template n_dofs_per_object<dim>() +
61  local_index <
62  dofs.size(),
64 
65  dofs[obj_index * dof_handler.get_fe().template n_dofs_per_object<dim>() +
66  local_index] = global_index;
67  }
68  } // namespace DoFHandlerImplementation
69 } // namespace internal
70 
71 
72 // explicit instantiations
73 namespace internal
74 {
75  namespace DoFHandlerImplementation
76  {
77 #include "dof_objects.inst"
78  }
79 } // namespace internal
80 
81 DEAL_II_NAMESPACE_CLOSE
void set_dof_index(const ::DoFHandler< dh_dim, spacedim > &dof_handler, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index)
Definition: dof_objects.cc:42
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define Assert(cond, exc)
Definition: exceptions.h:1407
unsigned int global_dof_index
Definition: types.h:89
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
static ::ExceptionBase & ExcInternalError()