deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+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: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 1998 - 2025 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_matrix_creator_h
14#define dealii_matrix_creator_h
15
16
17#include <deal.II/base/config.h>
18
21
23
24#include <map>
25
26#ifdef DEAL_II_WITH_PETSC
27# include <petscsys.h>
28#endif
29
31
32
33// forward declarations
34#ifndef DOXYGEN
35template <int dim>
36class Quadrature;
37
38
39template <typename number>
40class Vector;
41template <typename number>
42class SparseMatrix;
43
44template <int dim, int spacedim>
45class Mapping;
46template <int dim, int spacedim>
48class DoFHandler;
49
50namespace hp
51{
52 template <int>
53 class QCollection;
54 template <int, int>
55 class MappingCollection;
56} // namespace hp
57
58#endif
59
60
194{
214 template <int dim, int spacedim, typename MatrixType>
215 void
217 const Mapping<dim, spacedim> &mapping,
218 const DoFHandler<dim, spacedim> &dof,
219 const Quadrature<dim> &q,
220 MatrixType &matrix,
222 nullptr,
225
230 template <int dim, int spacedim, typename MatrixType>
231 void
233 const DoFHandler<dim, spacedim> &dof,
234 const Quadrature<dim> &q,
235 MatrixType &matrix,
237 nullptr,
240
260 template <int dim, int spacedim, typename MatrixType>
261 void
263 const Mapping<dim, spacedim> &mapping,
264 const DoFHandler<dim, spacedim> &dof,
265 const Quadrature<dim> &q,
266 MatrixType &matrix,
270 nullptr,
273
278 template <int dim, int spacedim, typename MatrixType>
279 void
281 const DoFHandler<dim, spacedim> &dof,
282 const Quadrature<dim> &q,
283 MatrixType &matrix,
287 nullptr,
290
294 template <int dim, int spacedim, typename MatrixType>
295 void
298 const DoFHandler<dim, spacedim> &dof,
299 const hp::QCollection<dim> &q,
300 MatrixType &matrix,
302 nullptr,
305
309 template <int dim, int spacedim, typename MatrixType>
310 void
312 const DoFHandler<dim, spacedim> &dof,
313 const hp::QCollection<dim> &q,
314 MatrixType &matrix,
316 nullptr,
319
323 template <int dim, int spacedim, typename MatrixType>
324 void
327 const DoFHandler<dim, spacedim> &dof,
328 const hp::QCollection<dim> &q,
329 MatrixType &matrix,
333 nullptr,
336
340 template <int dim, int spacedim, typename MatrixType>
341 void
343 const DoFHandler<dim, spacedim> &dof,
344 const hp::QCollection<dim> &q,
345 MatrixType &matrix,
349 nullptr,
352
353
400 template <int dim, int spacedim, typename number>
401 void
403 const Mapping<dim, spacedim> &mapping,
404 const DoFHandler<dim, spacedim> &dof,
405 const Quadrature<dim - 1> &q,
406 SparseMatrix<number> &matrix,
407 const std::map<types::boundary_id, const Function<spacedim, number> *>
408 &boundary_functions,
409 Vector<number> &rhs_vector,
410 std::vector<types::global_dof_index> &dof_to_boundary_mapping,
411 const Function<spacedim, number> *const weight = 0,
412 std::vector<unsigned int> component_mapping = {});
413
414
419 template <int dim, int spacedim, typename number>
420 void
422 const DoFHandler<dim, spacedim> &dof,
423 const Quadrature<dim - 1> &q,
424 SparseMatrix<number> &matrix,
425 const std::map<types::boundary_id, const Function<spacedim, number> *>
426 &boundary_functions,
427 Vector<number> &rhs_vector,
428 std::vector<types::global_dof_index> &dof_to_boundary_mapping,
429 const Function<spacedim, number> *const a = nullptr,
430 std::vector<unsigned int> component_mapping = {});
431
435 template <int dim, int spacedim, typename number>
436 void
439 const DoFHandler<dim, spacedim> &dof,
441 SparseMatrix<number> &matrix,
442 const std::map<types::boundary_id, const Function<spacedim, number> *>
443 &boundary_functions,
444 Vector<number> &rhs_vector,
445 std::vector<types::global_dof_index> &dof_to_boundary_mapping,
446 const Function<spacedim, number> *const a = nullptr,
447 std::vector<unsigned int> component_mapping = {});
448
452 template <int dim, int spacedim, typename number>
453 void
455 const DoFHandler<dim, spacedim> &dof,
457 SparseMatrix<number> &matrix,
458 const std::map<types::boundary_id, const Function<spacedim, number> *>
459 &boundary_functions,
460 Vector<number> &rhs_vector,
461 std::vector<types::global_dof_index> &dof_to_boundary_mapping,
462 const Function<spacedim, number> *const a = nullptr,
463 std::vector<unsigned int> component_mapping = {});
464
484 template <int dim, int spacedim, typename MatrixType>
485 void
487 const Mapping<dim, spacedim> &mapping,
488 const DoFHandler<dim, spacedim> &dof,
489 const Quadrature<dim> &q,
490 MatrixType &matrix,
492 nullptr,
495
500 template <int dim, int spacedim, typename MatrixType>
501 void
503 const DoFHandler<dim, spacedim> &dof,
504 const Quadrature<dim> &q,
505 MatrixType &matrix,
507 nullptr,
510
529 template <int dim, int spacedim, typename MatrixType>
530 void
532 const Mapping<dim, spacedim> &mapping,
533 const DoFHandler<dim, spacedim> &dof,
534 const Quadrature<dim> &q,
535 MatrixType &matrix,
539 nullptr,
542
547 template <int dim, int spacedim, typename MatrixType>
548 void
550 const DoFHandler<dim, spacedim> &dof,
551 const Quadrature<dim> &q,
552 MatrixType &matrix,
556 nullptr,
559
563 template <int dim, int spacedim, typename MatrixType>
564 void
567 const DoFHandler<dim, spacedim> &dof,
568 const hp::QCollection<dim> &q,
569 MatrixType &matrix,
571 nullptr,
574
578 template <int dim, int spacedim, typename MatrixType>
579 void
581 const DoFHandler<dim, spacedim> &dof,
582 const hp::QCollection<dim> &q,
583 MatrixType &matrix,
585 nullptr,
588
592 template <int dim, int spacedim, typename MatrixType>
593 void
596 const DoFHandler<dim, spacedim> &dof,
597 const hp::QCollection<dim> &q,
598 MatrixType &matrix,
602 nullptr,
605
609 template <int dim, int spacedim, typename MatrixType>
610 void
612 const DoFHandler<dim, spacedim> &dof,
613 const hp::QCollection<dim> &q,
614 MatrixType &matrix,
618 nullptr,
621
626 "You are providing either a right hand side function or a "
627 "coefficient with a number of vector components that is "
628 "inconsistent with the rest of the arguments. If you do "
629 "provide a coefficient or right hand side function, then "
630 "it either needs to have as many components as the finite "
631 "element in use, or only a single vector component. In "
632 "the latter case, the same value will be taken for "
633 "each vector component of the finite element.");
634} // namespace MatrixCreator
635
636
638
639#endif
Abstract base class for mapping classes.
Definition mapping.h:318
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_CXX20_REQUIRES(condition)
Definition config.h:249
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define DeclExceptionMsg(Exception, defaulttext)
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, MatrixType &matrix, const Function< spacedim, typename MatrixType::value_type > *const a=nullptr, const AffineConstraints< typename MatrixType::value_type > &constraints=AffineConstraints< typename MatrixType::value_type >())
void create_laplace_matrix(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof, const Quadrature< dim > &q, MatrixType &matrix, const Function< spacedim, typename MatrixType::value_type > *const a=nullptr, const AffineConstraints< typename MatrixType::value_type > &constraints=AffineConstraints< typename MatrixType::value_type >())
Definition hp.h:115