Reference documentation for deal.II version GIT relicensing-29-g1d56f85c36 2024-02-28 12:40:02+00:00
\(\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// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 1999 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_solution_transfer_h
16#define dealii_solution_transfer_h
17
18
19/*---------------------------- solutiontransfer.h ----------------------*/
20
21
22#include <deal.II/base/config.h>
23
26
28
29#include <deal.II/lac/vector.h>
30
31#include <vector>
32
34
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
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:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
static ::ExceptionBase & ExcNotPrepared()
static ::ExceptionBase & ExcAlreadyPrepForCoarseAndRef()
static ::ExceptionBase & ExcAlreadyPrepForRef()
#define DeclExceptionMsg(Exception, defaulttext)
Definition exceptions.h:494
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