$extrastylesheet
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_HP_COARSENTEST_H 00021 #define LIBMESH_HP_COARSENTEST_H 00022 00023 // Local Includes 00024 #include "libmesh/auto_ptr.h" 00025 #include "libmesh/dense_matrix.h" 00026 #include "libmesh/dense_vector.h" 00027 #include "libmesh/hp_selector.h" 00028 #include "libmesh/id_types.h" 00029 #include "libmesh/libmesh_common.h" 00030 00031 #include "libmesh/fe.h" // MipsPro requires fe.h and quadrature.h in order to 00032 #include "libmesh/quadrature.h" // delete UniquePtrs<> upon destruction 00033 00034 // C++ includes 00035 #include <vector> 00036 00037 #ifdef LIBMESH_ENABLE_AMR 00038 00039 namespace libMesh 00040 { 00041 00042 // Forward Declarations 00043 class Elem; 00044 class Point; 00045 class System; 00046 template <typename T> class TensorValue; 00047 template <typename T> class VectorValue; 00048 typedef VectorValue<Real> RealVectorValue; 00049 typedef TensorValue<Real> RealTensorValue; 00050 typedef RealVectorValue RealGradient; 00051 typedef RealTensorValue RealTensor; 00052 00053 00067 class HPCoarsenTest : public HPSelector 00068 { 00069 public: 00070 00074 HPCoarsenTest() : p_weight(1.0) 00075 { 00076 libmesh_experimental(); 00077 } 00078 00082 virtual ~HPCoarsenTest() {} 00083 00084 00091 virtual void select_refinement (System& system); 00092 00097 Real p_weight; 00098 00099 protected: 00104 void add_projection(const System&, const Elem*, unsigned int var); 00105 00109 const Elem *coarse; 00110 00114 std::vector<dof_id_type> dof_indices; 00115 00119 UniquePtr<FEBase> fe, fe_coarse; 00120 00124 const std::vector<std::vector<Real> > *phi, *phi_coarse; 00125 const std::vector<std::vector<RealGradient> > *dphi, *dphi_coarse; 00126 const std::vector<std::vector<RealTensor> > *d2phi, *d2phi_coarse; 00127 00131 const std::vector<Real> *JxW; 00132 00136 const std::vector<Point> *xyz_values; 00137 std::vector<Point> coarse_qpoints; 00138 00142 UniquePtr<QBase> qrule; 00143 00147 DenseMatrix<Number> Ke; 00148 DenseVector<Number> Fe; 00153 DenseVector<Number> Uc; 00154 DenseVector<Number> Up; 00155 }; 00156 00157 } // namespace libMesh 00158 00159 #endif // #ifdef LIBMESH_ENABLE_AMR 00160 00161 #endif // LIBMESH_HP_COARSENTEST_H