<commit_before>//---------------------------------------------------------------------------
//    $Id$
//
//    Copyright (C) 2006, 2007, 2008, 2009, 2010 by the deal.II authors
//
//    This file is subject to QPL and may not be  distributed
//    without copyright and license information. Please refer
//    to the file deal.II/doc/license.html for the  text  and
//    further information on this license.
//
//---------------------------------------------------------------------------

#ifndef __deal2__mesh_worker_h
#define __deal2__mesh_worker_h

#include <base/config.h>
#include <base/std_cxx1x/function.h>
#include <base/geometry_info.h>
#include <base/named_data.h>
#include <lac/block_indices.h>
#include <multigrid/mg_level_object.h>
#include <numerics/mesh_worker_vector_selector.h>
#include <numerics/mesh_worker_info.h>
#include <numerics/mesh_worker_assembler.h>


DEAL_II_NAMESPACE_OPEN

template<int,int> class DoFHandler;
template<int,int> class MGDoFHandler;

/**
 * A collection of functions and classes for the mesh loops that are
 * an ubiquitous part of each finite element program.
 *
 * The workhorse of this namespace is the loop() function, which implements a
 * completely generic loop over all mesh cells.
 *
 * The loop() depends on certain objects handed to it as
 * arguments. These objects are of two types, info objects like
 * DoFInfo and IntegrationInfo and worker objects like LocalWorker and
 * IntegrationWorker.
 *
 * Worker objects usually do two different jobs: first, they compute
 * the local contribution of a cell or face to the global
 * operation. Second, they assemble this local contribution into the
 * global result, whether a functional, a form or a bilinear
 * form. While the first job is particular to the problem being
 * solved, the second is generic and only depends on the data
 * structures. Therefore, base classes for workers assembling into
 * global data are provided in the namespace Assembler.
 *
 * <h3>Simplified interfaces</h3>
 *
 * Since the loop() is fairly general, a specialization
 * integration_loop() is available, which is a wrapper around loop()
 * with a simplified interface.
 *
 * This integration_loop() is complemented by a class
 * AssemblingIntegrator, which separates local integration from
 * assembling. In order to use it, follow this recipe: fist, create a
 * class responsible for the local integration:
 *
 * @code
 * template <int dim>
 * class LocalIntegrator
 * {
 *   void cell(typename MeshWorker::IntegrationWorker<dim>::CellInfo& info) const;
 *   void bdry(typename MeshWorker::IntegrationWorker<dim>::FaceInfo& info) const;
 *   void face(typename MeshWorker::IntegrationWorker<dim>::FaceInfo& info1,
 *             typename MeshWorker::IntegrationWorker<dim>::FaceInfo& info2) const;
 * };
 * @endcode
 * The three functions in there must have exactly this signature and
 * should do the integration on cells, boundary and interior faces,
 * respectively.
 *
 * Then, create the AssemblingIntegrator object, where the second
 * template argument decides on what kind of global data is
 * assembled. In the following, we decide to assemble a simple
 * SparseMatrix with no block structure:
 *
 * @code
 * MeshWorker::AssemblingIntegrator<dim, MeshWorker::Assembler::MatrixSimple<SparseMatrix<double> >>
 *   integrator(&LocalIntegrator<dim>::integrate_cell_term,
 *              &LocalIntegrator<dim>::integrate_boundary_term,
 *              &LocalIntegrator<dim>::integrate_face_term);
 * @endcode
 *
 * Before we can run the integration loop, we have to initialize
 * several data structures in our AssemblingIntegrator. For instance,
 * we have to decide on the quadrature rule or we may need more than
 * the default update flags.
 *
 * @code
 * integrator.initialize_gauss_quadrature(2,2,2);
 * integrator.add_update_flags(update_values | update_gradients, true, true, true, true);
 * integrator.initialize(system_matrix);
 * @endcode
 *
 * Finally, we set up the structures needed by the integration_loop()
 * and run it.
 *
 * @code
 * MeshWorker::IntegrationInfoBox<dim> info_box(dof_handler);
 * info_box.initialize(integrator, fe, mapping);
 *
 * MeshWorker::integration_loop(dof_handler.begin_active(), dof_handler.end(),
 *                              info_box, integrator);
 * @endcode
 *
 * @ingroup MeshWorker
 * @author <NAME>, 2009
 */
namespace MeshWorker
{
/**
 * Template for a class for the objects doing the actual work on cells
 * and faces.
 *
 * This class can serve as a base class for the actual worker class,
 * since, while we do not use virtual functions, we provide the
 * necessary interface for the mesh loops and the DoFInfo
 * class here. Thus, they do not have to be reprogrammed.
 *
 * In particular, the mesh loops will require data elements
 * #interior_fluxes and #boundary_fluxes to determine whether the
 * loop over faces will be started at all.
 *
 * @author <NAME>, 2009
 */
  template <int dim>
  class LocalWorker
  {
    public:
				       /**
					* Constructor, setting<commit_msg>Update documentation.<commit_after>//---------------------------------------------------------------------------
//    $Id$
//
//    Copyright (C) 2006, 2007, 2008, 2009, 2010 by the deal.II authors
//
//    This file is subject to QPL and may not be  distributed
//    without copyright and license information. Please refer
//    to the file deal.II/doc/license.html for the  text  and
//    further information on this license.
//
//---------------------------------------------------------------------------

#ifndef __deal2__mesh_worker_h
#define __deal2__mesh_worker_h

#include <base/config.h>
#include <base/std_cxx1x/function.h>
#include <base/geometry_info.h>
#include <base/named_data.h>
#include <lac/block_indices.h>
#include <multigrid/mg_level_object.h>
#include <numerics/mesh_worker_vector_selector.h>
#include <numerics/mesh_worker_info.h>
#include <numerics/mesh_worker_assembler.h>


DEAL_II_NAMESPACE_OPEN

template<int,int> class DoFHandler;
template<int,int> class MGDoFHandler;

/**
 * A collection of functions and classes for the mesh loops that are
 * an ubiquitous part of each finite element program.
 *
 * The workhorse of this namespace is the loop() function, which implements a
 * completely generic loop over all mesh cells.
 *
 * The loop() depends on certain objects handed to it as
 * arguments. These objects are of two types, info objects like
 * DoFInfo and IntegrationInfo and worker objects like LocalWorker and
 * IntegrationWorker.
 *
 * Worker objects usually do two different jobs: first, they compute
 * the local contribution of a cell or face to the global
 * operation. Second, they assemble this local contribution into the
 * global result, whether a functional, a form or a bilinear
 * form. While the first job is particular to the problem being
 * solved, the second is generic and only depends on the data
 * structures. Therefore, base classes for workers assembling into
 * global data are provided in the namespace Assembler.
 *
 * <h3>Simplified interfaces</h3>
 *
 * Since the loop() is fairly general, a specialization
 * integration_loop() is available, which is a wrapper around loop()
 * with a simplified interface.
 *
 * The integration_loop() function loop takes most of the information
 * that it needs to pass to loop() from an IntegrationInfoBox
 * object. Its use is explained in @ref step_38 "step-38", but in
 * short it requires functions that do the local integration on a
 * cell, interior or boundary face, and it needs an object (called
 * "assembler") that copies these local contributions into the global
 * matrix and right hand side objects.
 *
 * Before we can run the integration loop, we have to initialize
 * several data structures in our IntegrationWorker and assembler
 * objects. For instance, we have to decide on the quadrature rule or
 * we may need more than the default update flags.
 *
 * @ingroup MeshWorker
 * @author <NAME>, 2009
 */
namespace MeshWorker
{
/**
 * Template for a class for the objects doing the actual work on cells
 * and faces.
 *
 * This class can serve as a base class for the actual worker class,
 * since, while we do not use virtual functions, we provide the
 * necessary interface for the mesh loops and the DoFInfo
 * class here. Thus, they do not have to be reprogrammed.
 *
 * In particular, the mesh loops will require data elements
 * #interior_fluxes and #boundary_fluxes to determine whether the
 * loop over faces will be started at all.
 *
 * @author <NAME>, 2009
 */
  template <int dim>
  class LocalWorker
  {
    public:
				       /**
					* Constructor, setting
{'fraction_non_alphanumeric': 0.11180555555555556, 'fraction_numerical': 0.008680555555555556, 'mean_word_length': 3.4199488491048595, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6336851', 'n_tokens_mistral': 2407, 'n_tokens_neox': 2279, 'n_words': 982}