$extrastylesheet
jump_error_estimator.h
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019 
00020 #ifndef LIBMESH_JUMP_ERROR_ESTIMATOR_H
00021 #define LIBMESH_JUMP_ERROR_ESTIMATOR_H
00022 
00023 // Local Includes
00024 #include "libmesh/auto_ptr.h"
00025 #include "libmesh/dense_vector.h"
00026 #include "libmesh/error_estimator.h"
00027 #include "libmesh/fe_base.h"
00028 
00029 // C++ includes
00030 #include <cstddef>
00031 #include <string>
00032 #include <vector>
00033 
00034 namespace libMesh
00035 {
00036 
00037 // Forward Declarations
00038 class Point;
00039 class Elem;
00040 
00041 
00042 
00043 
00044 
00051 class JumpErrorEstimator : public ErrorEstimator
00052 {
00053 public:
00054 
00058   JumpErrorEstimator()
00059     : ErrorEstimator(),
00060       scale_by_n_flux_faces(false),
00061       integrate_boundary_sides(false),
00062       fine_elem(NULL), coarse_elem(NULL),
00063       fine_error(0), coarse_error(0),
00064       fine_side(libMesh::invalid_uint),
00065       var(libMesh::invalid_uint),
00066       fe_fine(), fe_coarse() {}
00067 
00071   virtual ~JumpErrorEstimator() {}
00072 
00073 
00080   virtual void estimate_error (const System& system,
00081                                ErrorVector& error_per_cell,
00082                                const NumericVector<Number>* solution_vector = NULL,
00083                                bool estimate_parent_error = false);
00084 
00093   bool scale_by_n_flux_faces;
00094 
00095 protected:
00100   void reinit_sides();
00101 
00105   float coarse_n_flux_faces_increment();
00106 
00111   virtual void initialize(const System& system,
00112                           ErrorVector& error_per_cell,
00113                           bool estimate_parent_error);
00114 
00119   virtual void internal_side_integration() = 0;
00120 
00126   virtual bool boundary_side_integration() { return false; }
00127 
00132   bool integrate_boundary_sides;
00133 
00137   const Elem *fine_elem, *coarse_elem;
00138 
00142   Real fine_error, coarse_error;
00143 
00147   unsigned int fine_side;
00148 
00152   unsigned int var;
00153 
00157   DenseVector<Number> Ufine, Ucoarse;
00158 
00162   UniquePtr<FEBase> fe_fine, fe_coarse;
00163 };
00164 
00165 
00166 } // namespace libMesh
00167 
00168 #endif // LIBMESH_JUMP_ERROR_ESTIMATOR_H