40template <
typename Number>
44 <<
"Called set_dof_values_by_interpolation(), but"
45 <<
" the element to be set, value " << std::setprecision(16)
46 << arg1 <<
", does not match with the non-zero value "
47 << std::setprecision(16) << arg2 <<
" already set before.");
57 template <
typename Number>
58 std::enable_if_t<!std::is_unsigned_v<Number>,
65 template <
typename Number>
66 std::enable_if_t<std::is_unsigned_v<Number>, Number>
75 template <
typename VectorType>
77 std::is_same_v<VectorType,
79 std::is_same_v<VectorType,
81 std::is_same_v<VectorType,
83 typename VectorType::value_type>> ||
84 std::is_same_v<VectorType,
86 typename VectorType::value_type>>;
94 decltype(std::declval<const T>().set_ghost_state(std::declval<bool>()));
98 is_supported_operation<set_ghost_state_t, T>;
102 std::enable_if_t<has_set_ghost_state<VectorType>, VectorType> * =
nullptr>
106 vector.set_ghost_state(ghosted);
111 std::enable_if_t<!has_set_ghost_state<VectorType>, VectorType> * =
nullptr>
131 OutputVector &values,
132 const bool perform_check)
137 if (perform_check && is_dealii_vector<OutputVector>)
139 const bool old_ghost_state = values.has_ghost_elements();
145 for (
unsigned int i = 0; i < cell.
get_fe().n_dofs_per_cell(); ++i)
149 Assert(local_values_old[i] == number() ||
150 get_abs(local_values_old[i] - local_values[i]) <=
151 get_abs(local_values_old[i] + local_values[i]) *
154 number>::real_type>::epsilon(),
155 ExcNonMatchingElementsSetDofValuesByInterpolation<number>(
156 local_values[i], local_values_old[i]));
176 OutputVector &values,
180 OutputVector &values)> &processor)
188 if (cell.is_active() && !cell.is_artificial())
197 processor(cell, local_values, values);
202 ExcMessage(
"Incorrect size of local_values vector."));
205 cell.
get_fe().n_dofs_per_cell(),
208 cell.
get_fe().get_interpolation_matrix(
215 if ((tmp.
size() > 0) && (local_values.
size() > 0))
216 interpolation.
vmult(tmp, local_values);
219 processor(cell, tmp, values);
228 "You cannot call this function on non-active cells "
229 "of DoFHandler objects unless you provide an explicit "
230 "finite element index because they do not have naturally "
231 "associated finite element spaces associated: degrees "
232 "of freedom are only distributed on active cells for which "
233 "the active FE index has been set."));
241 ExcVectorDoesNotMatch()));
244 ExcVectorDoesNotMatch()));
248 for (
unsigned int child = 0; child < cell.n_children(); ++child)
252 .
vmult(tmp, local_values);
254 *cell.
child(child), tmp, values, fe_index, processor);
263template <
int dim,
int spacedim,
bool lda>
264template <
class OutputVector,
typename number>
268 OutputVector &values,
270 const bool perform_check)
const
272 internal::process_by_interpolation<dim, spacedim, lda, OutputVector, number>(
279 OutputVector &values) {
285template <
int dim,
int spacedim,
bool lda>
286template <
class OutputVector,
typename number>
291 OutputVector &values,
294 internal::process_by_interpolation<dim, spacedim, lda, OutputVector, number>(
301 OutputVector &values) {
302 std::vector<types::global_dof_index> dof_indices(
303 cell.
get_fe().n_dofs_per_cell());
314#include "dof_accessor_set.inst"
void distribute_local_to_global(const InVector &local_vector, const std::vector< size_type > &local_dof_indices, OutVector &global_vector) const
const DoFHandler< dim, spacedim > & get_dof_handler() const
void get_dof_values(const InputVector &values, Vector< number > &local_values) const
const FiniteElement< dimension_, space_dimension_ > & get_fe() const
TriaIterator< DoFCellAccessor< dimension_, space_dimension_, level_dof_access > > child(const unsigned int 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
void set_dof_values(const Vector< number > &local_values, OutputVector &values) 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 get_dof_indices(std::vector< types::global_dof_index > &dof_indices) const
types::fe_index active_fe_index() const
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
bool has_hp_capabilities() const
types::global_dof_index n_dofs() const
unsigned int n_dofs_per_cell() const
virtual const FullMatrix< double > & get_prolongation_matrix(const unsigned int child, const RefinementCase< dim > &refinement_case=RefinementCase< dim >::isotropic_refinement) const
void vmult(Vector< number2 > &w, const Vector< number2 > &v, const bool adding=false) const
virtual size_type size() const override
#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)
decltype(std::declval< const T >().set_ghost_state(std::declval< bool >())) set_ghost_state_t
constexpr bool has_set_ghost_state
constexpr bool is_dealii_vector
std::enable_if_t<!std::is_unsigned_v< Number >, typename numbers::NumberTraits< Number >::real_type > get_abs(const Number a)
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)
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 > &)
unsigned short int fe_index