Reference documentation for deal.II version GIT acb749f4f5 2024-02-21 16:10: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// 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
336template <int dim, typename VectorType = Vector<double>, int spacedim = dim>
338{
339public:
344
349
354 void
355 clear();
356
362 void
364
372 void
373 prepare_for_coarsening_and_refinement(const std::vector<VectorType> &all_in);
374
379 void
380 prepare_for_coarsening_and_refinement(const VectorType &in);
381
393 void
394 refine_interpolate(const VectorType &in, VectorType &out) const;
395
415 void
416 interpolate(const std::vector<VectorType> &all_in,
417 std::vector<VectorType> &all_out) const;
418
428 void
429 interpolate(const VectorType &in, VectorType &out) const;
430
435 std::size_t
436 memory_consumption() const;
437
442 "You are attempting an operation for which this object is "
443 "not prepared. This may be because you either did not call "
444 "one of the prepare_*() functions at all, or because you "
445 "called the wrong one for the operation you are currently "
446 "attempting.");
447
453 "You are attempting to call one of the prepare_*() functions "
454 "of this object to prepare it for an operation for which it "
455 "is already prepared. Specifically, the object was "
456 "previously prepared for pure refinement.");
457
463 "You are attempting to call one of the prepare_*() functions "
464 "of this object to prepare it for an operation for which it "
465 "is already prepared. Specifically, the object was "
466 "previously prepared for both coarsening and refinement.");
467
468private:
475
480
501
506
507
513 std::vector<std::vector<types::global_dof_index>> indices_on_cell;
514
527 {
529 : indices_ptr(nullptr)
530 , dof_values_ptr(nullptr)
531 , active_fe_index(0)
532 {}
533 Pointerstruct(std::vector<types::global_dof_index> *indices_ptr_in,
534 const unsigned int active_fe_index_in = 0)
535 : indices_ptr(indices_ptr_in)
536 , dof_values_ptr(nullptr)
537 , active_fe_index(active_fe_index_in)
538 {}
540 std::vector<Vector<typename VectorType::value_type>> *dof_values_ptr_in,
541 const unsigned int active_fe_index_in = 0)
542 : indices_ptr(nullptr)
543 , dof_values_ptr(dof_values_ptr_in)
544 , active_fe_index(active_fe_index_in)
545 {}
546 std::size_t
547 memory_consumption() const;
548
549 std::vector<types::global_dof_index> *indices_ptr;
550 std::vector<Vector<typename VectorType::value_type>> *dof_values_ptr;
551 unsigned int active_fe_index;
552 };
553
560 std::map<std::pair<unsigned int, unsigned int>, Pointerstruct> cell_map;
561
566 std::vector<std::vector<Vector<typename VectorType::value_type>>>
568};
569
570
572
573#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:503
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504
static ::ExceptionBase & ExcNotPrepared()
static ::ExceptionBase & ExcAlreadyPrepForCoarseAndRef()
static ::ExceptionBase & ExcAlreadyPrepForRef()
#define DeclExceptionMsg(Exception, defaulttext)
Definition exceptions.h:495
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