Reference documentation for deal.II version Git 5a2787e538 2021-09-21 14:55:10 -0600
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
solution_transfer.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2020 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 #ifndef dealii_solution_transfer_h
17 # define dealii_solution_transfer_h
18 
19 
20 /*---------------------------- solutiontransfer.h ----------------------*/
21 
22 
23 # include <deal.II/base/config.h>
24 
25 # include <deal.II/base/exceptions.h>
27 
29 
30 # include <deal.II/lac/vector.h>
31 
32 # include <vector>
33 
35 
335 template <int dim, typename VectorType = Vector<double>, int spacedim = dim>
337 {
338 public:
343 
348 
353  void
354  clear();
355 
361  void
363 
371  void
372  prepare_for_coarsening_and_refinement(const std::vector<VectorType> &all_in);
373 
378  void
380 
392  void
393  refine_interpolate(const VectorType &in, VectorType &out) const;
394 
414  void
415  interpolate(const std::vector<VectorType> &all_in,
416  std::vector<VectorType> & all_out) const;
417 
427  void
428  interpolate(const VectorType &in, VectorType &out) const;
429 
434  std::size_t
435  memory_consumption() const;
436 
441  "You are attempting an operation for which this object is "
442  "not prepared. This may be because you either did not call "
443  "one of the prepare_*() functions at all, or because you "
444  "called the wrong one for the operation you are currently "
445  "attempting.");
446 
452  "You are attempting to call one of the prepare_*() functions "
453  "of this object to prepare it for an operation for which it "
454  "is already prepared. Specifically, the object was "
455  "previously prepared for pure refinement.");
456 
462  "You are attempting to call one of the prepare_*() functions "
463  "of this object to prepare it for an operation for which it "
464  "is already prepared. Specifically, the object was "
465  "previously prepared for both coarsening and refinement.");
466 
467 private:
474 
479 
486  {
499  };
500 
505 
506 
512  std::vector<std::vector<types::global_dof_index>> indices_on_cell;
513 
526  {
528  : indices_ptr(nullptr)
529  , dof_values_ptr(nullptr)
530  , active_fe_index(0)
531  {}
532  Pointerstruct(std::vector<types::global_dof_index> *indices_ptr_in,
533  const unsigned int active_fe_index_in = 0)
534  : indices_ptr(indices_ptr_in)
535  , dof_values_ptr(nullptr)
536  , active_fe_index(active_fe_index_in)
537  {}
539  std::vector<Vector<typename VectorType::value_type>> *dof_values_ptr_in,
540  const unsigned int active_fe_index_in = 0)
541  : indices_ptr(nullptr)
542  , dof_values_ptr(dof_values_ptr_in)
543  , active_fe_index(active_fe_index_in)
544  {}
545  std::size_t
546  memory_consumption() const;
547 
548  std::vector<types::global_dof_index> * indices_ptr;
549  std::vector<Vector<typename VectorType::value_type>> *dof_values_ptr;
550  unsigned int active_fe_index;
551  };
552 
559  std::map<std::pair<unsigned int, unsigned int>, Pointerstruct> cell_map;
560 
565  std::vector<std::vector<Vector<typename VectorType::value_type>>>
567 };
568 
569 namespace Legacy
570 {
575  template <int dim,
576  typename VectorType = Vector<double>,
577  typename DoFHandlerType = DoFHandler<dim>>
580 } // namespace Legacy
581 
582 
584 
585 #endif // dealii_solutiontransfer_h
586 /*---------------------------- solutiontransfer.h ---------------------------*/
::SolutionTransfer< dim, VectorType, DoFHandlerType::space_dimension > SolutionTransfer
void prepare_for_pure_refinement()
PreparationState prepared_for
void interpolate(const std::vector< VectorType > &all_in, std::vector< VectorType > &all_out) const
static ::ExceptionBase & ExcNotPrepared()
std::map< std::pair< unsigned int, unsigned int >, Pointerstruct > cell_map
SolutionTransfer(const DoFHandler< dim, spacedim > &dof)
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:487
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:401
Pointerstruct(std::vector< types::global_dof_index > *indices_ptr_in, const unsigned int active_fe_index_in=0)
Pointerstruct(std::vector< Vector< typename VectorType::value_type >> *dof_values_ptr_in, const unsigned int active_fe_index_in=0)
std::vector< std::vector< types::global_dof_index > > indices_on_cell
std::vector< Vector< typename VectorType::value_type > > * dof_values_ptr
std::size_t memory_consumption() const
void refine_interpolate(const VectorType &in, VectorType &out) const
std::vector< types::global_dof_index > * indices_ptr
SmartPointer< const DoFHandler< dim, spacedim >, SolutionTransfer< dim, VectorType, spacedim > > dof_handler
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:400
static ::ExceptionBase & ExcAlreadyPrepForRef()
std::size_t memory_consumption() const
std::vector< std::vector< Vector< typename VectorType::value_type > > > dof_values_on_cell
void prepare_for_coarsening_and_refinement(const std::vector< VectorType > &all_in)
types::global_dof_index n_dofs_old
#define DEAL_II_DEPRECATED
Definition: config.h:160
static ::ExceptionBase & ExcAlreadyPrepForCoarseAndRef()