Reference documentation for deal.II version GIT f9a1fd2718 2022-08-19 02:45: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\}}\)
matrix_creator.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2021 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_matrix_creator_h
17 #define dealii_matrix_creator_h
18 
19 
20 #include <deal.II/base/config.h>
21 
23 #include <deal.II/base/function.h>
24 
26 
27 #include <map>
28 
29 #ifdef DEAL_II_WITH_PETSC
30 # include <petscsys.h>
31 #endif
32 
34 
35 
36 // forward declarations
37 #ifndef DOXYGEN
38 template <int dim>
39 class Quadrature;
40 
41 
42 template <typename number>
43 class Vector;
44 template <typename number>
45 class SparseMatrix;
46 
47 template <int dim, int spacedim>
48 class Mapping;
49 template <int dim, int spacedim>
50 class DoFHandler;
51 
52 namespace hp
53 {
54  template <int>
55  class QCollection;
56  template <int, int>
57  class MappingCollection;
58 } // namespace hp
59 
60 #endif
61 
62 
195 namespace MatrixCreator
196 {
216  template <int dim, int spacedim, typename SparseMatrixType>
217  void
219  const Mapping<dim, spacedim> & mapping,
220  const DoFHandler<dim, spacedim> &dof,
221  const Quadrature<dim> & q,
222  SparseMatrixType & matrix,
224  nullptr,
227 
232  template <int dim, int spacedim, typename SparseMatrixType>
233  void
235  const DoFHandler<dim, spacedim> &dof,
236  const Quadrature<dim> & q,
237  SparseMatrixType & matrix,
239  nullptr,
242 
262  template <int dim, int spacedim, typename SparseMatrixType>
263  void
265  const Mapping<dim, spacedim> & mapping,
266  const DoFHandler<dim, spacedim> & dof,
267  const Quadrature<dim> & q,
268  SparseMatrixType & matrix,
272  nullptr,
275 
280  template <int dim, int spacedim, typename SparseMatrixType>
281  void
283  const DoFHandler<dim, spacedim> & dof,
284  const Quadrature<dim> & q,
285  SparseMatrixType & matrix,
289  nullptr,
292 
296  template <int dim, int spacedim, typename SparseMatrixType>
297  void
300  const DoFHandler<dim, spacedim> & dof,
301  const hp::QCollection<dim> & q,
302  SparseMatrixType & matrix,
304  nullptr,
307 
311  template <int dim, int spacedim, typename SparseMatrixType>
312  void
314  const DoFHandler<dim, spacedim> &dof,
315  const hp::QCollection<dim> & q,
316  SparseMatrixType & matrix,
318  nullptr,
321 
325  template <int dim, int spacedim, typename SparseMatrixType>
326  void
328  const hp::MappingCollection<dim, spacedim> & mapping,
329  const DoFHandler<dim, spacedim> & dof,
330  const hp::QCollection<dim> & q,
331  SparseMatrixType & matrix,
335  nullptr,
338 
342  template <int dim, int spacedim, typename SparseMatrixType>
343  void
345  const DoFHandler<dim, spacedim> & dof,
346  const hp::QCollection<dim> & q,
347  SparseMatrixType & matrix,
351  nullptr,
354 
355 
381  template <int dim, int spacedim, typename number>
382  void
384  const Mapping<dim, spacedim> & mapping,
385  const DoFHandler<dim, spacedim> &dof,
386  const Quadrature<dim - 1> & q,
388  const std::map<types::boundary_id, const Function<spacedim, number> *>
389  & boundary_functions,
390  Vector<number> & rhs_vector,
391  std::vector<types::global_dof_index> & dof_to_boundary_mapping,
392  const Function<spacedim, number> *const weight = 0,
393  std::vector<unsigned int> component_mapping = {});
394 
395 
400  template <int dim, int spacedim, typename number>
401  void
403  const DoFHandler<dim, spacedim> &dof,
404  const Quadrature<dim - 1> & q,
406  const std::map<types::boundary_id, const Function<spacedim, number> *>
407  & boundary_functions,
408  Vector<number> & rhs_vector,
409  std::vector<types::global_dof_index> & dof_to_boundary_mapping,
410  const Function<spacedim, number> *const a = nullptr,
411  std::vector<unsigned int> component_mapping = {});
412 
416  template <int dim, int spacedim, typename number>
417  void
420  const DoFHandler<dim, spacedim> & dof,
421  const hp::QCollection<dim - 1> & q,
423  const std::map<types::boundary_id, const Function<spacedim, number> *>
424  & boundary_functions,
425  Vector<number> & rhs_vector,
426  std::vector<types::global_dof_index> & dof_to_boundary_mapping,
427  const Function<spacedim, number> *const a = nullptr,
428  std::vector<unsigned int> component_mapping = {});
429 
433  template <int dim, int spacedim, typename number>
434  void
436  const DoFHandler<dim, spacedim> &dof,
437  const hp::QCollection<dim - 1> & q,
439  const std::map<types::boundary_id, const Function<spacedim, number> *>
440  & boundary_functions,
441  Vector<number> & rhs_vector,
442  std::vector<types::global_dof_index> & dof_to_boundary_mapping,
443  const Function<spacedim, number> *const a = nullptr,
444  std::vector<unsigned int> component_mapping = {});
445 
465  template <int dim, int spacedim, typename SparseMatrixType>
466  void
468  const Mapping<dim, spacedim> & mapping,
469  const DoFHandler<dim, spacedim> &dof,
470  const Quadrature<dim> & q,
471  SparseMatrixType & matrix,
473  nullptr,
476 
481  template <int dim, int spacedim, typename SparseMatrixType>
482  void
484  const DoFHandler<dim, spacedim> &dof,
485  const Quadrature<dim> & q,
486  SparseMatrixType & matrix,
488  nullptr,
491 
510  template <int dim, int spacedim, typename SparseMatrixType>
511  void
513  const Mapping<dim, spacedim> & mapping,
514  const DoFHandler<dim, spacedim> & dof,
515  const Quadrature<dim> & q,
516  SparseMatrixType & matrix,
520  nullptr,
523 
528  template <int dim, int spacedim, typename SparseMatrixType>
529  void
531  const DoFHandler<dim, spacedim> & dof,
532  const Quadrature<dim> & q,
533  SparseMatrixType & matrix,
537  nullptr,
540 
544  template <int dim, int spacedim, typename SparseMatrixType>
545  void
548  const DoFHandler<dim, spacedim> & dof,
549  const hp::QCollection<dim> & q,
550  SparseMatrixType & matrix,
552  nullptr,
555 
559  template <int dim, int spacedim, typename SparseMatrixType>
560  void
562  const DoFHandler<dim, spacedim> &dof,
563  const hp::QCollection<dim> & q,
564  SparseMatrixType & matrix,
566  nullptr,
569 
573  template <int dim, int spacedim, typename SparseMatrixType>
574  void
576  const hp::MappingCollection<dim, spacedim> & mapping,
577  const DoFHandler<dim, spacedim> & dof,
578  const hp::QCollection<dim> & q,
579  SparseMatrixType & matrix,
583  nullptr,
586 
590  template <int dim, int spacedim, typename SparseMatrixType>
591  void
593  const DoFHandler<dim, spacedim> & dof,
594  const hp::QCollection<dim> & q,
595  SparseMatrixType & matrix,
599  nullptr,
602 
607  "You are providing either a right hand side function or a "
608  "coefficient with a number of vector components that is "
609  "inconsistent with the rest of the arguments. If you do "
610  "provide a coefficient or right hand side function, then "
611  "it either needs to have as many components as the finite "
612  "element in use, or only a single vector component. In "
613  "the latter case, the same value will be taken for "
614  "each vector component of the finite element.");
615 } // namespace MatrixCreator
616 
617 
619 
620 #endif
Abstract base class for mapping classes.
Definition: mapping.h:311
Definition: vector.h:110
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
static ::ExceptionBase & ExcComponentMismatch()
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:487
@ matrix
Contents is actually a matrix.
void create_boundary_mass_matrix(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof, const Quadrature< dim - 1 > &q, SparseMatrix< number > &matrix, const std::map< types::boundary_id, const Function< spacedim, number > * > &boundary_functions, Vector< number > &rhs_vector, std::vector< types::global_dof_index > &dof_to_boundary_mapping, const Function< spacedim, number > *const weight=0, std::vector< unsigned int > component_mapping={})
void create_mass_matrix(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof, const Quadrature< dim > &q, SparseMatrixType &matrix, const Function< spacedim, typename SparseMatrixType::value_type > *const a=nullptr, const AffineConstraints< typename SparseMatrixType::value_type > &constraints=AffineConstraints< typename SparseMatrixType::value_type >())
void create_laplace_matrix(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof, const Quadrature< dim > &q, SparseMatrixType &matrix, const Function< spacedim, typename SparseMatrixType::value_type > *const a=nullptr, const AffineConstraints< typename SparseMatrixType::value_type > &constraints=AffineConstraints< typename SparseMatrixType::value_type >())
Definition: hp.h:118
unsigned int boundary_id
Definition: types.h:129