// ------------------------------------------------------------------------ // // SPDX-License-Identifier: LGPL-2.1-or-later // Copyright (C) 2010 - 2024 by the deal.II authors // // This file is part of the deal.II library. // // Part of the source code is dual licensed under Apache-2.0 WITH // LLVM-exception OR LGPL-2.1-or-later. Detailed license information // governing the source code and code contributions can be found in // LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II. // // ------------------------------------------------------------------------ #ifndef dealii_integrators_local_integrators_h #define dealii_integrators_local_integrators_h // This file only provides definition and documentation of the // namespace LocalIntegrators. There is no necessity to include it // anywhere in a C++ code. Only doxygen will make use of it. #include DEAL_II_NAMESPACE_OPEN /** * @brief Library of integrals over cells and faces * * @note The contents of this namespace are deprecated and will be removed in * one of the next releases. * * This namespace contains application specific local integrals for bilinear * forms, forms and error estimates. It is a collection of functions organized * into namespaces devoted to certain applications. For instance, the * namespace Laplace contains functions for computing cell matrices and cell * residuals for the Laplacian operator, as well as functions for the weak * boundary conditions by Nitsche or the interior penalty discontinuous * Galerkin method. The namespace Maxwell does the same for curl-curl type * problems. * * The namespace L2 contains functions for mass matrices and * L2-inner products. * *

Notational conventions

* * In most cases, the action of a function in this namespace can be described * by a single integral. We distinguish between integrals over cells Z * and over faces F. If an integral is denoted as * @f[ * \int_Z u \otimes v \,dx, * @f] * it will yield the following results, depending on the type of operation * * * We will use regular cursive symbols $u$ for scalars and bold symbols * $\mathbf u$ for vectors. Test functions are always v and trial * functions are always u. Parameters are Greek and the face normal * vectors are $\mathbf n = \mathbf n_1 = -\mathbf n_2$. * *

Signature of functions

* * Functions in this namespace follow a generic signature. In the simplest * case, you have two related functions * @code * template * void * cell_matrix ( * FullMatrix& M, * const FEValuesBase& fe, * const double factor = 1.); * * template * void * cell_residual ( * BlockVector* v, * const FEValuesBase& fe, * const std::vector >& input, * const double factor = 1.); * @endcode * * There is typically a pair of functions for the same operator, the function * cell_residual implementing the mapping of the operator from the * finite element space into its dual, and the function cell_matrix * generating the bilinear form corresponding to the Frechet derivative of * cell_residual. * * The first argument of these functions is the return type, which is *
    *
  • FullMatrix<double> for matrices *
  • BlockVector<double> for vectors *
* * The next argument is the FEValuesBase object representing the finite * element for integration. If the integrated operator maps from one finite * element space into the dual of another (for instance an off-diagonal matrix * in a block system), then first the FEValuesBase for the trial space and * after this the one for the test space are specified. * * This list is followed by the set of required data in the order *
    *
  1. Data vectors from finite element functions *
  2. Data vectors from other objects *
  3. Additional data *
  4. A factor which is multiplied with the whole result *
* *

Usage

* * The local integrators can be used wherever a local integration loop would * have been implemented instead. The following example is from the * implementation of a Stokes solver, using * MeshWorker::Assembler::LocalBlocksToGlobalBlocks. The matrices are *
    *
  • 0: The vector Laplacian for the velocity (here with a vector valued * element) *
  • 1: The divergence matrix *
  • 2: The pressure @ref GlossMassMatrix "mass matrix" used in the preconditioner *
* * With these matrices, the function called by MeshWorker::loop() could be * written like * @code * using namespace dealii::LocalIntegrators; * * template * void MatrixIntegrator::cell(MeshWorker::DoFInfo &dinfo, * MeshWorker::IntegrationInfo &info) * { * Laplace::cell_matrix (dinfo.matrix(0,false).matrix, * info.fe_values(0)); * Divergence::cell_matrix (dinfo.matrix(1,false).matrix, * info.fe_values(0), * info.fe_values(1)); * L2::cell_matrix (dinfo.matrix(2,false).matrix, * info.fe_values(1)); * } * @endcode * See step-39 for a worked out example of this code. * * @ingroup Integrators */ namespace LocalIntegrators {} DEAL_II_NAMESPACE_CLOSE #endif