Reference documentation for deal.II version 9.5.0
\(\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\}}\)
Loading...
Searching...
No Matches
solution_transfer.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 1999 - 2022 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
27
29
30#include <deal.II/lac/vector.h>
31
32#include <vector>
33
35
335template <int dim, typename VectorType = Vector<double>, int spacedim = dim>
337{
338public:
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
379 prepare_for_coarsening_and_refinement(const VectorType &in);
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
467private:
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
571
572#endif
void refine_interpolate(const VectorType &in, VectorType &out) const
void interpolate(const std::vector< VectorType > &all_in, std::vector< VectorType > &all_out) const
std::vector< std::vector< types::global_dof_index > > indices_on_cell
types::global_dof_index n_dofs_old
SmartPointer< const DoFHandler< dim, spacedim >, SolutionTransfer< dim, VectorType, spacedim > > dof_handler
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)
PreparationState prepared_for
std::map< std::pair< unsigned int, unsigned int >, Pointerstruct > cell_map
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
static ::ExceptionBase & ExcNotPrepared()
static ::ExceptionBase & ExcAlreadyPrepForCoarseAndRef()
static ::ExceptionBase & ExcAlreadyPrepForRef()
#define DeclExceptionMsg(Exception, defaulttext)
Definition exceptions.h:488
std::vector< types::global_dof_index > * indices_ptr
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< Vector< typename VectorType::value_type > > * dof_values_ptr