Reference documentation for deal.II version 9.6.0
\(\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 - 2024 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 MatrixType>
217 void
219 const Mapping<dim, spacedim> &mapping,
220 const DoFHandler<dim, spacedim> &dof,
221 const Quadrature<dim> &q,
222 MatrixType &matrix,
224 nullptr,
227
232 template <int dim, int spacedim, typename MatrixType>
233 void
235 const DoFHandler<dim, spacedim> &dof,
236 const Quadrature<dim> &q,
237 MatrixType &matrix,
239 nullptr,
242
262 template <int dim, int spacedim, typename MatrixType>
263 void
265 const Mapping<dim, spacedim> &mapping,
266 const DoFHandler<dim, spacedim> &dof,
267 const Quadrature<dim> &q,
268 MatrixType &matrix,
272 nullptr,
275
280 template <int dim, int spacedim, typename MatrixType>
281 void
283 const DoFHandler<dim, spacedim> &dof,
284 const Quadrature<dim> &q,
285 MatrixType &matrix,
289 nullptr,
292
296 template <int dim, int spacedim, typename MatrixType>
297 void
300 const DoFHandler<dim, spacedim> &dof,
301 const hp::QCollection<dim> &q,
302 MatrixType &matrix,
304 nullptr,
307
311 template <int dim, int spacedim, typename MatrixType>
312 void
314 const DoFHandler<dim, spacedim> &dof,
315 const hp::QCollection<dim> &q,
316 MatrixType &matrix,
318 nullptr,
321
325 template <int dim, int spacedim, typename MatrixType>
326 void
329 const DoFHandler<dim, spacedim> &dof,
330 const hp::QCollection<dim> &q,
331 MatrixType &matrix,
335 nullptr,
338
342 template <int dim, int spacedim, typename MatrixType>
343 void
345 const DoFHandler<dim, spacedim> &dof,
346 const hp::QCollection<dim> &q,
347 MatrixType &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 MatrixType>
466 void
468 const Mapping<dim, spacedim> &mapping,
469 const DoFHandler<dim, spacedim> &dof,
470 const Quadrature<dim> &q,
471 MatrixType &matrix,
473 nullptr,
476
481 template <int dim, int spacedim, typename MatrixType>
482 void
484 const DoFHandler<dim, spacedim> &dof,
485 const Quadrature<dim> &q,
486 MatrixType &matrix,
488 nullptr,
491
510 template <int dim, int spacedim, typename MatrixType>
511 void
513 const Mapping<dim, spacedim> &mapping,
514 const DoFHandler<dim, spacedim> &dof,
515 const Quadrature<dim> &q,
516 MatrixType &matrix,
520 nullptr,
523
528 template <int dim, int spacedim, typename MatrixType>
529 void
531 const DoFHandler<dim, spacedim> &dof,
532 const Quadrature<dim> &q,
533 MatrixType &matrix,
537 nullptr,
540
544 template <int dim, int spacedim, typename MatrixType>
545 void
548 const DoFHandler<dim, spacedim> &dof,
549 const hp::QCollection<dim> &q,
550 MatrixType &matrix,
552 nullptr,
555
559 template <int dim, int spacedim, typename MatrixType>
560 void
562 const DoFHandler<dim, spacedim> &dof,
563 const hp::QCollection<dim> &q,
564 MatrixType &matrix,
566 nullptr,
569
573 template <int dim, int spacedim, typename MatrixType>
574 void
577 const DoFHandler<dim, spacedim> &dof,
578 const hp::QCollection<dim> &q,
579 MatrixType &matrix,
583 nullptr,
586
590 template <int dim, int spacedim, typename MatrixType>
591 void
593 const DoFHandler<dim, spacedim> &dof,
594 const hp::QCollection<dim> &q,
595 MatrixType &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:318
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:503
#define DEAL_II_CXX20_REQUIRES(condition)
Definition config.h:177
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504
#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, 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:117