23#include <deal.II/grid/tria_iterator.templates.h>
43template <
typename Number>
47 <<
"Called set_dof_values_by_interpolation(), but"
48 <<
" the element to be set, value " << std::setprecision(16)
49 <<
arg1 <<
", does not match with the non-zero value "
50 << std::setprecision(16) <<
arg2 <<
" already set before.");
60 template <
typename Number>
61 std::enable_if_t<!std::is_unsigned<Number>::value,
68 template <
typename Number>
69 std::enable_if_t<std::is_unsigned<Number>::value, Number>
78 template <
typename VectorType>
80 std::is_same<VectorType,
82 std::is_same<VectorType,
87 std::is_same<VectorType,
89 typename VectorType::value_type>>
::value ||
90 std::is_same<VectorType,
92 typename VectorType::value_type>>
::value;
100 decltype(std::declval<T const>().set_ghost_state(std::declval<bool>()));
102 template <
typename T>
108 std::enable_if_t<has_set_ghost_state<VectorType>, VectorType> * =
nullptr>
112 vector.set_ghost_state(ghosted);
117 std::enable_if_t<!has_set_ghost_state<VectorType>, VectorType> * =
nullptr>
151 for (
unsigned int i = 0; i < cell.get_fe().n_dofs_per_cell(); ++i)
160 number>::real_type>::epsilon(),
189 (cell.get_dof_handler().has_hp_capabilities() ==
false &&
194 if (cell.is_active() && !cell.is_artificial())
196 if ((cell.get_dof_handler().has_hp_capabilities() ==
false) ||
200 (fe_index == cell.active_fe_index()) ||
207 cell.get_dof_handler().get_fe(fe_index).n_dofs_per_cell(),
208 ExcMessage(
"Incorrect size of local_values vector."));
211 cell.get_fe().n_dofs_per_cell(),
212 cell.get_dof_handler().get_fe(fe_index).n_dofs_per_cell());
214 cell.get_fe().get_interpolation_matrix(
231 Assert((cell.get_dof_handler().has_hp_capabilities() ==
false) ||
234 "You cannot call this function on non-active cells "
235 "of DoFHandler objects unless you provide an explicit "
236 "finite element index because they do not have naturally "
237 "associated finite element spaces associated: degrees "
238 "of freedom are only distributed on active cells for which "
239 "the active FE index has been set."));
242 cell.get_dof_handler().get_fe(fe_index);
243 const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
247 ExcVectorDoesNotMatch()));
248 Assert(values.size() == cell.get_dof_handler().n_dofs(),
250 ExcVectorDoesNotMatch()));
254 for (
unsigned int child = 0; child < cell.n_children(); ++child)
257 fe.get_prolongation_matrix(child, cell.refinement_case())
260 *cell.child(child), tmp, values, fe_index,
processor);
269template <
int dim,
int spacedim,
bool lda>
270template <
class OutputVector,
typename number>
278 internal::process_by_interpolation<dim, spacedim, lda, OutputVector, number>(
291template <
int dim,
int spacedim,
bool lda>
292template <
class OutputVector,
typename number>
300 internal::process_by_interpolation<dim, spacedim, lda, OutputVector, number>(
308 std::vector<types::global_dof_index> dof_indices(
309 cell.get_fe().n_dofs_per_cell());
310 cell.get_dof_indices(dof_indices);
320#include "dof_accessor_set.inst"
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
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
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
#define DeclException2(Exception2, type1, type2, outsequence)
static ::ExceptionBase & ExcNonMatchingElementsSetDofValuesByInterpolation(Number arg1, Number arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
constexpr bool has_set_ghost_state
decltype(std::declval< T const >().set_ghost_state(std::declval< bool >())) set_ghost_state_t
constexpr bool is_dealii_vector
void set_ghost_state(VectorType &vector, const bool ghosted)
void set_dof_values(const DoFCellAccessor< dim, spacedim, lda > &cell, const Vector< number > &local_values, OutputVector &values, const bool perform_check)
std::enable_if_t<!std::is_unsigned< Number >::value, typename numbers::NumberTraits< Number >::real_type > get_abs(const Number a)
void process_by_interpolation(const DoFCellAccessor< dim, spacedim, lda > &cell, const Vector< number > &local_values, OutputVector &values, const types::fe_index fe_index_, const std::function< void(const DoFCellAccessor< dim, spacedim, lda > &cell, const Vector< number > &local_values, OutputVector &values)> &processor)
const types::fe_index invalid_fe_index
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)