Reference documentation for deal.II version GIT relicensing-31-gf283a0fc39 2024-02-29 06:50: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
matrix_creator.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 1998 - 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_matrix_creator_h
16#define dealii_matrix_creator_h
17
18
19#include <deal.II/base/config.h>
20
23
25
26#include <map>
27
28#ifdef DEAL_II_WITH_PETSC
29# include <petscsys.h>
30#endif
31
33
34
35// forward declarations
36#ifndef DOXYGEN
37template <int dim>
38class Quadrature;
39
40
41template <typename number>
42class Vector;
43template <typename number>
44class SparseMatrix;
45
46template <int dim, int spacedim>
47class Mapping;
48template <int dim, int spacedim>
50class DoFHandler;
51
52namespace hp
53{
54 template <int>
55 class QCollection;
56 template <int, int>
57 class MappingCollection;
58} // namespace hp
59
60#endif
61
62
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
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,
387 SparseMatrix<number> &matrix,
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,
405 SparseMatrix<number> &matrix,
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,
422 SparseMatrix<number> &matrix,
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,
438 SparseMatrix<number> &matrix,
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
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:316
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_CXX20_REQUIRES(condition)
Definition config.h:177
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
#define DeclExceptionMsg(Exception, defaulttext)
Definition exceptions.h:494
static ::ExceptionBase & ExcComponentMismatch()
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:117