OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
block_matrix_application.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 // $Id: block_matrix_application.h 1415 2013-08-30 16:14:41Z secanell $
3 //
4 // Copyright (C) 2006, 2007, 2008, 2009 by Guido Kanschat
5 // Copyright (C) 2007-13 by Marc Secanell
6 //
7 //
8 // This file is subject to QPL and may not be distributed
9 // without copyright and license information. Please refer
10 // to the file deal.II/doc/license.html for the text and
11 // further information on this license.
12 //
13 //---------------------------------------------------------------------------
14 
15 #ifndef __deal2__appframe__block_matrix_application_h
16 #define __deal2__appframe__block_matrix_application_h
17 
18 #include <base/quadrature.h>
19 #include <lac/full_matrix.h>
20 #include <lac/block_sparse_matrix.h>
21 #include <lac/block_sparsity_pattern.h>
22 #include <lac/filtered_matrix.h>
23 #include <lac/vector.h>
24 #include <grid/tria.h>
25 #include <grid/tria_iterator.h>
26 #include <grid/tria_accessor.h>
27 #include <dofs/dof_tools.h>
28 #include <numerics/matrix_tools.h>
29 
31 #include <appframe/matrix_base.h>
32 #include <boost/shared_ptr.hpp>
33 
34 
35 namespace AppFrame
36 {
64  template <int dim>
66  public DoFApplication<dim>
67  {
68  public:
70 
71 
82  BlockMatrixApplication(boost::shared_ptr<ApplicationData> data =
83  boost::shared_ptr<ApplicationData>());
84 
97  bool triangulation_only);
98 
106  void _initialize(ParameterHandler& param);
107 
118  virtual void declare_parameters(ParameterHandler& param);
122  virtual void initialize (ParameterHandler& param);
124 
125 
126 
134  void add_vector_for_cell_matrix(std::string name,
135  unsigned int block,
136  unsigned int components,
137  bool values,
138  bool derivatives);
139 
148  void add_vector_for_flux_matrix(std::string name,
149  unsigned int block,
150  unsigned int components,
151  bool values,
152  bool derivatives);
154 
159  void do_assemble(
160  const FEVectors&,
163  Threads::Mutex& mutex);
164 
172  virtual void post_cell_assemble();
173 
175 
176 
181  void remesh_matrices();
186  virtual void remesh();
187 
197  void assemble(const FEVectors&);
198 
199 
222  void assemble_numerically(const FEVectors& src,
223  const double delta = 1e-6);
232  void residual_constraints(FEVector& dst) const;
233 
235 
236 
237 
243  virtual void cell_matrix(MatrixVector& cell_matrices,
244  const typename DoFApplication<dim>::CellInfo& cell);
245 
250  virtual void bdry_matrix(MatrixVector& face_matrices,
251  const typename DoFApplication<dim>::FaceInfo& face);
252 
257  virtual void face_matrix(MatrixVector& matrices11,
258  MatrixVector& matrices12,
259  MatrixVector& matrices21,
260  MatrixVector& matrices22,
261  const typename DoFApplication<dim>::FaceInfo& face1,
262  const typename DoFApplication<dim>::FaceInfo& face2);
263 
271 
272 
273  virtual void dirichlet_bc(std::map<unsigned int, double>& boundary_values) const;
275 
276  protected:
306  Table<2, DoFTools::Coupling> cell_couplings;
307 
312  Table<2, DoFTools::Coupling> flux_couplings;
313 
318  boost::shared_ptr<Quadrature<dim> > quadrature_assemble_cell;
319 
324  boost::shared_ptr<Quadrature<dim-1> > quadrature_assemble_face;
325 
326  private:
330  BlockSparsityPattern sparsities;
331 
332  protected:
337  BlockSparseMatrix<double> matrix;
344  FilteredMatrix<BlockVector<double> > filtered_matrix;
345 
346  private:
358 
359  };
360 }
361 
362 #endif