libMesh::QGrid Class Reference
#include <quadrature_grid.h>

Public Member Functions | |
| QGrid (const unsigned int _dim, const Order _order=INVALID_ORDER) | |
| ~QGrid () | |
| QuadratureType | type () const |
| ElemType | get_elem_type () const |
| unsigned int | get_p_level () const |
| unsigned int | n_points () const |
| unsigned int | get_dim () const |
| const std::vector< Point > & | get_points () const |
| std::vector< Point > & | get_points () |
| const std::vector< Real > & | get_weights () const |
| std::vector< Real > & | get_weights () |
| Point | qp (const unsigned int i) const |
| Real | w (const unsigned int i) const |
| void | init (const ElemType type=INVALID_ELEM, unsigned int p_level=0) |
| Order | get_order () const |
| void | print_info (std::ostream &os=libMesh::out) const |
| void | scale (std::pair< Real, Real > old_range, std::pair< Real, Real > new_range) |
| virtual bool | shapes_need_reinit () |
Static Public Member Functions | |
| static AutoPtr< QBase > | build (const std::string &name, const unsigned int _dim, const Order _order=INVALID_ORDER) |
| static AutoPtr< QBase > | build (const QuadratureType _qt, const unsigned int _dim, const Order _order=INVALID_ORDER) |
| static void | print_info (std::ostream &out=libMesh::out) |
| static std::string | get_info () |
| static unsigned int | n_objects () |
| static void | enable_print_counter_info () |
| static void | disable_print_counter_info () |
Public Attributes | |
| bool | allow_rules_with_negative_weights |
Protected Types | |
| typedef std::map< std::string, std::pair< unsigned int, unsigned int > > | Counts |
Protected Member Functions | |
| virtual void | init_0D (const ElemType type=INVALID_ELEM, unsigned int p_level=0) |
| void | increment_constructor_count (const std::string &name) |
| void | increment_destructor_count (const std::string &name) |
Protected Attributes | |
| libMesh::err<< "ERROR: Seems as if this quadrature rule" << std::endl<< " is not implemented for 2D."<< std::endl;libmesh_error();}#endif virtual void init_3D(const ElemType, unsigned int=0)#ifndef DEBUG{}#else{libMesh::err<< "ERROR: Seems as if this quadrature rule"<< std::endl<< " is not implemented for 3D."<< std::endl;libmesh_error();}#endif void tensor_product_quad(const QBase &q1D);void tensor_product_hex(const QBase &q1D);void tensor_product_prism(const QBase &q1D, const QBase &q2D);const unsigned int _dim;const Order _order;ElemType _type;unsigned int _p_level;std::vector< Point > | _points |
| std::vector< Real > | _weights |
Static Protected Attributes | |
| static Counts | _counts |
| static Threads::atomic < unsigned int > | _n_objects |
| static Threads::spin_mutex | _mutex |
| static bool | _enable_print_counter = true |
Private Member Functions | |
| void | init_1D (const ElemType _type=INVALID_ELEM, unsigned int p_level=0) |
| void | init_2D (const ElemType _type=INVALID_ELEM, unsigned int p_level=0) |
| void | init_3D (const ElemType _type=INVALID_ELEM, unsigned int p_level=0) |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const QBase &q) |
Detailed Description
This class creates quadrature points on a uniform grid, Order points on a side.
Definition at line 42 of file quadrature_grid.h.
Member Typedef Documentation
typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts [protected, inherited] |
Data structure to log the information. The log is identified by the class name.
Definition at line 113 of file reference_counter.h.
Constructor & Destructor Documentation
| libMesh::QGrid::QGrid | ( | const unsigned int | _dim, | |
| const Order | _order = INVALID_ORDER | |||
| ) | [inline] |
Constructor. Declares the order of the quadrature rule.
Definition at line 79 of file quadrature_grid.h.
00080 : QBase(d,o) 00081 { 00082 }
| libMesh::QGrid::~QGrid | ( | ) | [inline] |
Member Function Documentation
| AutoPtr< QBase > libMesh::QBase::build | ( | const QuadratureType | _qt, | |
| const unsigned int | _dim, | |||
| const Order | _order = INVALID_ORDER | |||
| ) | [static, inherited] |
Builds a specific quadrature rule, identified through the QuadratureType. An AutoPtr<QBase> is returned to prevent a memory leak. This way the user need not remember to delete the object. Enables run-time decision of the quadrature rule.
Definition at line 48 of file quadrature_build.C.
References libMesh::err, libMeshEnums::FIRST, libMeshEnums::FORTYTHIRD, libMesh::out, libMeshEnums::QCLOUGH, libMeshEnums::QGAUSS, libMeshEnums::QJACOBI_1_0, libMeshEnums::QJACOBI_2_0, libMeshEnums::QSIMPSON, libMeshEnums::QTRAP, libMeshEnums::THIRD, and libMeshEnums::TWENTYTHIRD.
00051 { 00052 switch (_qt) 00053 { 00054 00055 case QCLOUGH: 00056 { 00057 #ifdef DEBUG 00058 if (_order > TWENTYTHIRD) 00059 { 00060 libMesh::out << "WARNING: Clough quadrature implemented" << std::endl 00061 << " up to TWENTYTHIRD order." << std::endl; 00062 } 00063 #endif 00064 00065 AutoPtr<QBase> ap(new QClough(_dim, _order)); 00066 return ap; 00067 } 00068 00069 case QGAUSS: 00070 { 00071 00072 #ifdef DEBUG 00073 if (_order > FORTYTHIRD) 00074 { 00075 libMesh::out << "WARNING: Gauss quadrature implemented" << std::endl 00076 << " up to FORTYTHIRD order." << std::endl; 00077 } 00078 #endif 00079 00080 AutoPtr<QBase> ap(new QGauss(_dim, _order)); 00081 return ap; 00082 } 00083 00084 case QJACOBI_1_0: 00085 { 00086 00087 #ifdef DEBUG 00088 if (_order > TWENTYTHIRD) 00089 { 00090 libMesh::out << "WARNING: Jacobi(1,0) quadrature implemented" << std::endl 00091 << " up to TWENTYTHIRD order." << std::endl; 00092 } 00093 00094 if (_dim > 1) 00095 { 00096 libMesh::out << "WARNING: Jacobi(1,0) quadrature implemented" << std::endl 00097 << " in 1D only." << std::endl; 00098 } 00099 #endif 00100 00101 AutoPtr<QBase> ap(new QJacobi(_dim, _order, 1, 0)); 00102 return ap; 00103 } 00104 00105 case QJACOBI_2_0: 00106 { 00107 00108 #ifdef DEBUG 00109 if (_order > TWENTYTHIRD) 00110 { 00111 libMesh::out << "WARNING: Jacobi(2,0) quadrature implemented" << std::endl 00112 << " up to TWENTYTHIRD order." << std::endl; 00113 } 00114 00115 if (_dim > 1) 00116 { 00117 libMesh::out << "WARNING: Jacobi(2,0) quadrature implemented" << std::endl 00118 << " in 1D only." << std::endl; 00119 } 00120 #endif 00121 00122 AutoPtr<QBase> ap(new QJacobi(_dim, _order, 2, 0)); 00123 return ap; 00124 } 00125 00126 case QSIMPSON: 00127 { 00128 00129 #ifdef DEBUG 00130 if (_order > THIRD) 00131 { 00132 libMesh::out << "WARNING: Simpson rule provides only" << std::endl 00133 << " THIRD order!" << std::endl; 00134 } 00135 #endif 00136 00137 AutoPtr<QBase> ap(new QSimpson(_dim)); 00138 return ap; 00139 } 00140 00141 case QTRAP: 00142 { 00143 00144 #ifdef DEBUG 00145 if (_order > FIRST) 00146 { 00147 libMesh::out << "WARNING: Trapezoidal rule provides only" << std::endl 00148 << " FIRST order!" << std::endl; 00149 } 00150 #endif 00151 00152 AutoPtr<QBase> ap(new QTrap(_dim)); 00153 return ap; 00154 } 00155 00156 00157 default: 00158 { 00159 libMesh::err << "ERROR: Bad qt=" << _qt << std::endl; 00160 libmesh_error(); 00161 } 00162 } 00163 00164 00165 libmesh_error(); 00166 AutoPtr<QBase> ap(NULL); 00167 return ap; 00168 }
| AutoPtr< QBase > libMesh::QBase::build | ( | const std::string & | name, | |
| const unsigned int | _dim, | |||
| const Order | _order = INVALID_ORDER | |||
| ) | [static, inherited] |
Builds a specific quadrature rule, identified through the name string. An AutoPtr<QBase> is returned to prevent a memory leak. This way the user need not remember to delete the object. Enables run-time decision of the quadrature rule. The input parameter name must be mappable through the Utility::string_to_enum<>() function.
Definition at line 37 of file quadrature_build.C.
References libMesh::Utility::string_to_enum< QuadratureType >().
Referenced by libMesh::InfFE< Dim, T_radial, T_map >::attach_quadrature_rule().
00040 { 00041 return QBase::build (Utility::string_to_enum<QuadratureType> (type), 00042 _dim, 00043 _order); 00044 }
| void libMesh::ReferenceCounter::disable_print_counter_info | ( | ) | [static, inherited] |
Definition at line 106 of file reference_counter.C.
References libMesh::ReferenceCounter::_enable_print_counter.
00107 { 00108 _enable_print_counter = false; 00109 return; 00110 }
| void libMesh::ReferenceCounter::enable_print_counter_info | ( | ) | [static, inherited] |
Methods to enable/disable the reference counter output from print_info()
Definition at line 100 of file reference_counter.C.
References libMesh::ReferenceCounter::_enable_print_counter.
00101 { 00102 _enable_print_counter = true; 00103 return; 00104 }
| unsigned int libMesh::QBase::get_dim | ( | ) | const [inline, inherited] |
- Returns:
- the dimension of the quadrature rule.
Definition at line 123 of file quadrature.h.
Referenced by libMesh::InfFE< Dim, T_radial, T_map >::attach_quadrature_rule(), libMesh::QConical::conical_product_pyramid(), libMesh::QConical::conical_product_tet(), and libMesh::QConical::conical_product_tri().
| ElemType libMesh::QBase::get_elem_type | ( | ) | const [inline, inherited] |
- Returns:
- the current element type we're set up for
Definition at line 104 of file quadrature.h.
| std::string libMesh::ReferenceCounter::get_info | ( | ) | [static, inherited] |
Gets a string containing the reference information.
Definition at line 47 of file reference_counter.C.
References libMesh::ReferenceCounter::_counts, and libMesh::Quality::name().
Referenced by libMesh::ReferenceCounter::print_info().
00048 { 00049 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG) 00050 00051 std::ostringstream oss; 00052 00053 oss << '\n' 00054 << " ---------------------------------------------------------------------------- \n" 00055 << "| Reference count information |\n" 00056 << " ---------------------------------------------------------------------------- \n"; 00057 00058 for (Counts::iterator it = _counts.begin(); 00059 it != _counts.end(); ++it) 00060 { 00061 const std::string name(it->first); 00062 const unsigned int creations = it->second.first; 00063 const unsigned int destructions = it->second.second; 00064 00065 oss << "| " << name << " reference count information:\n" 00066 << "| Creations: " << creations << '\n' 00067 << "| Destructions: " << destructions << '\n'; 00068 } 00069 00070 oss << " ---------------------------------------------------------------------------- \n"; 00071 00072 return oss.str(); 00073 00074 #else 00075 00076 return ""; 00077 00078 #endif 00079 }
| Order libMesh::QBase::get_order | ( | ) | const [inline, inherited] |
- Returns:
- the order of the quadrature rule.
Definition at line 169 of file quadrature.h.
Referenced by libMesh::InfFE< Dim, T_radial, T_map >::attach_quadrature_rule().
00169 { return static_cast<Order>(_order + _p_level); }
| unsigned int libMesh::QBase::get_p_level | ( | ) | const [inline, inherited] |
- Returns:
- the current p refinement level we're initialized with
Definition at line 110 of file quadrature.h.
| std::vector<Point>& libMesh::QBase::get_points | ( | ) | [inline, inherited] |
- Returns:
- a
std::vectorcontaining the quadrature point locations on a reference object as a writeable reference.
Definition at line 135 of file quadrature.h.
References libMesh::QBase::_points.
00135 { return _points; }
| const std::vector<Point>& libMesh::QBase::get_points | ( | ) | const [inline, inherited] |
- Returns:
- a
std::vectorcontaining the quadrature point locations on a reference object.
Definition at line 129 of file quadrature.h.
References libMesh::QBase::_points.
Referenced by libMesh::FE< Dim, T >::edge_reinit(), libMesh::QClough::init_1D(), libMesh::QMonomial::init_2D(), libMesh::QGauss::init_2D(), libMesh::QClough::init_2D(), libMesh::QMonomial::init_3D(), libMesh::QGauss::init_3D(), libMesh::InfFE< Dim, T_radial, T_map >::init_face_shape_functions(), libMesh::InfFE< Dim, T_radial, T_map >::init_shape_functions(), libMesh::InfFE< Dim, T_radial, T_map >::reinit(), libMesh::FEXYZ< Dim >::reinit(), and libMesh::FE< Dim, T >::reinit().
00129 { return _points; }
| std::vector<Real>& libMesh::QBase::get_weights | ( | ) | [inline, inherited] |
- Returns:
- a
std::vectorcontaining the quadrature weights.
Definition at line 145 of file quadrature.h.
References libMesh::QBase::_weights.
00145 { return _weights; }
| const std::vector<Real>& libMesh::QBase::get_weights | ( | ) | const [inline, inherited] |
- Returns:
- a
std::vectorcontaining the quadrature weights.
Definition at line 140 of file quadrature.h.
References libMesh::QBase::_weights.
Referenced by libMesh::FE< Dim, T >::edge_reinit(), libMesh::QClough::init_1D(), libMesh::QMonomial::init_2D(), libMesh::QGauss::init_2D(), libMesh::QClough::init_2D(), libMesh::QMonomial::init_3D(), libMesh::QGauss::init_3D(), libMesh::InfFE< Dim, T_radial, T_map >::init_face_shape_functions(), libMesh::InfFE< Dim, T_radial, T_map >::init_shape_functions(), libMesh::FEXYZ< Dim >::reinit(), and libMesh::FE< Dim, T >::reinit().
00140 { return _weights; }
| void libMesh::ReferenceCounter::increment_constructor_count | ( | const std::string & | name | ) | [inline, protected, inherited] |
Increments the construction counter. Should be called in the constructor of any derived class that will be reference counted.
Definition at line 163 of file reference_counter.h.
References libMesh::ReferenceCounter::_counts, and libMesh::Threads::spin_mtx.
Referenced by libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().
00164 { 00165 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx); 00166 std::pair<unsigned int, unsigned int>& p = _counts[name]; 00167 00168 p.first++; 00169 }
| void libMesh::ReferenceCounter::increment_destructor_count | ( | const std::string & | name | ) | [inline, protected, inherited] |
Increments the destruction counter. Should be called in the destructor of any derived class that will be reference counted.
Definition at line 176 of file reference_counter.h.
References libMesh::ReferenceCounter::_counts, and libMesh::Threads::spin_mtx.
Referenced by libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().
00177 { 00178 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx); 00179 std::pair<unsigned int, unsigned int>& p = _counts[name]; 00180 00181 p.second++; 00182 }
| void libMesh::QBase::init | ( | const ElemType | type = INVALID_ELEM, |
|
| unsigned int | p_level = 0 | |||
| ) | [inherited] |
Initializes the data structures to contain a quadrature rule for an object of type type.
Definition at line 27 of file quadrature.C.
References libMesh::QBase::init_0D(), libMesh::QBase::init_1D(), and libMesh::QBase::init_2D().
Referenced by libMesh::FE< Dim, T >::edge_reinit(), libMesh::QClough::init_1D(), libMesh::QTrap::init_2D(), libMesh::QSimpson::init_2D(), libMesh::QMonomial::init_2D(), init_2D(), libMesh::QGauss::init_2D(), libMesh::QClough::init_2D(), libMesh::QTrap::init_3D(), libMesh::QSimpson::init_3D(), libMesh::QMonomial::init_3D(), init_3D(), libMesh::QGauss::init_3D(), libMesh::InfFE< Dim, T_radial, T_map >::init_face_shape_functions(), libMesh::QGauss::QGauss(), libMesh::QJacobi::QJacobi(), libMesh::QSimpson::QSimpson(), libMesh::QTrap::QTrap(), libMesh::InfFE< Dim, T_radial, T_map >::reinit(), libMesh::FEXYZ< Dim >::reinit(), and libMesh::FE< Dim, T >::reinit().
00029 { 00030 // check to see if we have already 00031 // done the work for this quadrature rule 00032 if (t == _type && p == _p_level) 00033 return; 00034 else 00035 { 00036 _type = t; 00037 _p_level = p; 00038 } 00039 00040 00041 00042 switch(_dim) 00043 { 00044 case 0: 00045 this->init_0D(_type,_p_level); 00046 00047 return; 00048 00049 case 1: 00050 this->init_1D(_type,_p_level); 00051 00052 return; 00053 00054 case 2: 00055 this->init_2D(_type,_p_level); 00056 00057 return; 00058 00059 case 3: 00060 this->init_3D(_type,_p_level); 00061 00062 return; 00063 00064 default: 00065 libmesh_error(); 00066 } 00067 }
| void libMesh::QBase::init_0D | ( | const ElemType | type = INVALID_ELEM, |
|
| unsigned int | p_level = 0 | |||
| ) | [protected, virtual, inherited] |
Initializes the 0D quadrature rule by filling the points and weights vectors with the appropriate values. Generally this is just one point with weight 1.
Definition at line 71 of file quadrature.C.
References libMesh::QBase::_points, and libMesh::QBase::_weights.
Referenced by libMesh::QBase::init().
| void libMesh::QGrid::init_1D | ( | const ElemType | type = INVALID_ELEM, |
|
| unsigned int | p_level = 0 | |||
| ) | [private, virtual] |
Initializes the 1D quadrature rule by filling the points and weights vectors with the appropriate values. The order of the rule will be defined by the implementing class. It is assumed that derived quadrature rules will at least define the init_1D function, therefore it is pure virtual.
Implements libMesh::QBase.
Definition at line 30 of file quadrature_grid_1D.C.
References libMesh::QBase::_points, and libMesh::QBase::_weights.
00032 { 00033 //---------------------------------------------------------------------- 00034 // 1D quadrature rules 00035 00036 // We ignore p - the grid rule is just for experimentation 00037 00038 _points.resize(_order + 1); 00039 _weights.resize(_order + 1); 00040 for (int i = 0; i != _order + 1; ++i) 00041 { 00042 _points[i](0) = 2.0 * (double)i / (double)_order - 1.0; 00043 _weights[i] = 2.0 / (double)(_order + 1); 00044 } 00045 return; 00046 }
| void libMesh::QGrid::init_2D | ( | const ElemType | ElemType = INVALID_ELEM, |
|
| unsigned int | = 0 | |||
| ) | [private, virtual] |
Initializes the 2D quadrature rule by filling the points and weights vectors with the appropriate values. The order of the rule will be defined by the implementing class. Should not be pure virtual since a derived quadrature rule may only be defined in 1D. If not redefined, gives an error (when DEBUG defined) when called.
Reimplemented from libMesh::QBase.
Definition at line 27 of file quadrature_grid_2D.C.
References libMesh::QBase::_points, libMesh::QBase::_weights, libMeshEnums::EDGE2, libMesh::err, libMesh::QBase::init(), libMeshEnums::QUAD4, libMeshEnums::QUAD8, libMeshEnums::QUAD9, libMeshEnums::TRI3, and libMeshEnums::TRI6.
00029 { 00030 #if LIBMESH_DIM > 1 00031 00032 //----------------------------------------------------------------------- 00033 // 2D quadrature rules 00034 00035 // We ignore p - the grid rule is just for experimentation 00036 00037 switch (type_in) 00038 { 00039 00040 00041 //--------------------------------------------- 00042 // Quadrilateral quadrature rules 00043 case QUAD4: 00044 case QUAD8: 00045 case QUAD9: 00046 { 00047 // We compute the 2D quadrature rule as a tensor 00048 // product of the 1D quadrature rule. 00049 QGrid q1D(1,_order); 00050 q1D.init(EDGE2); 00051 tensor_product_quad( q1D ); 00052 return; 00053 } 00054 00055 00056 //--------------------------------------------- 00057 // Triangle quadrature rules 00058 case TRI3: 00059 case TRI6: 00060 { 00061 _points.resize((_order + 1)*(_order + 2)/2); 00062 _weights.resize((_order + 1)*(_order + 2)/2); 00063 00064 unsigned int pt = 0; 00065 for (int i = 0; i != _order + 1; ++i) 00066 { 00067 for (int j = 0; j != _order + 1 - i; ++j) 00068 { 00069 _points[pt](0) = (double)i / (double)_order; 00070 _points[pt](1) = (double)j / (double)_order; 00071 _weights[pt] = 1.0 / (double)(_order+1) / 00072 (double)(_order+2); 00073 pt++; 00074 } 00075 } 00076 return; 00077 } 00078 00079 //--------------------------------------------- 00080 // Unsupported type 00081 default: 00082 { 00083 libMesh::err << "Element type not supported!:" << type_in << std::endl; 00084 libmesh_error(); 00085 } 00086 } 00087 00088 libmesh_error(); 00089 00090 return; 00091 00092 #endif 00093 }
| void libMesh::QGrid::init_3D | ( | const ElemType | _type = INVALID_ELEM, |
|
| unsigned int | p_level = 0 | |||
| ) | [private] |
Definition at line 27 of file quadrature_grid_3D.C.
References libMesh::QBase::_points, libMesh::QBase::_weights, libMeshEnums::EDGE2, libMesh::err, libMeshEnums::HEX20, libMeshEnums::HEX27, libMeshEnums::HEX8, libMesh::QBase::init(), libMeshEnums::PRISM15, libMeshEnums::PRISM18, libMeshEnums::PRISM6, libMeshEnums::PYRAMID5, libMeshEnums::TET10, libMeshEnums::TET4, and libMeshEnums::TRI3.
00029 { 00030 #if LIBMESH_DIM == 3 00031 00032 //----------------------------------------------------------------------- 00033 // 3D quadrature rules 00034 00035 // We ignore p - the grid rule is just for experimentation 00036 switch (type_in) 00037 { 00038 //--------------------------------------------- 00039 // Hex quadrature rules 00040 case HEX8: 00041 case HEX20: 00042 case HEX27: 00043 { 00044 // We compute the 3D quadrature rule as a tensor 00045 // product of the 1D quadrature rule. 00046 QGrid q1D(1,_order); 00047 q1D.init(EDGE2); 00048 00049 tensor_product_hex( q1D ); 00050 00051 return; 00052 } 00053 00054 00055 00056 //--------------------------------------------- 00057 // Tetrahedral quadrature rules 00058 case TET4: 00059 case TET10: 00060 { 00061 _points.resize((_order+1)*(_order+2)*(_order+3)/6); 00062 _weights.resize((_order+1)*(_order+2)*(_order+3)/6); 00063 00064 unsigned int pt = 0; 00065 for (int i = 0; i != _order + 1; ++i) 00066 { 00067 for (int j = 0; j != _order + 1 - i; ++j) 00068 { 00069 for (int k = 0; k != _order + 1 - i - j; ++k) 00070 { 00071 _points[pt](0) = (double)i / (double)_order; 00072 _points[pt](1) = (double)j / (double)_order; 00073 _points[pt](2) = (double)k / (double)_order; 00074 _weights[pt] = 1.0 / (double)(_order+1) / 00075 (double)(_order+2) / (double)(_order+3); 00076 pt++; 00077 } 00078 } 00079 } 00080 return; 00081 } 00082 00083 00084 // Prism quadrature rules 00085 case PRISM6: 00086 case PRISM15: 00087 case PRISM18: 00088 { 00089 // We compute the 3D quadrature rule as a tensor 00090 // product of the 1D quadrature rule and a 2D 00091 // triangle quadrature rule 00092 00093 QGrid q1D(1,_order); 00094 QGrid q2D(2,_order); 00095 00096 // Initialize 00097 q1D.init(EDGE2); 00098 q2D.init(TRI3); 00099 00100 tensor_product_prism(q1D, q2D); 00101 00102 return; 00103 } 00104 00105 00106 00107 //--------------------------------------------- 00108 // Pyramid 00109 case PYRAMID5: 00110 { 00111 _points.resize((_order+1)*(_order+2)*(_order+3)/6); 00112 _weights.resize((_order+1)*(_order+2)*(_order+3)/6); 00113 00114 unsigned int pt = 0; 00115 for (int k = 0; k != _order + 1; ++k) 00116 { 00117 for (int i = 0; i != _order + 1 - k; ++i) 00118 { 00119 for (int j = 0; j != _order + 1 - k; ++j) 00120 { 00121 _points[pt](0) = 2.0 * (double)i / (double)_order 00122 - 1.0 + (double)k / (double)_order; 00123 _points[pt](1) = 2.0 * (double)j / (double)_order 00124 - 1.0 + (double)k / (double)_order; 00125 _points[pt](2) = (double)k / (double)_order; 00126 _weights[pt] = 1.0 / (double)(_order+1) / 00127 (double)(_order+2) / (double)(_order+3); 00128 pt++; 00129 } 00130 } 00131 } 00132 return; 00133 } 00134 00135 00136 00137 //--------------------------------------------- 00138 // Unsupported type 00139 default: 00140 { 00141 libMesh::err << "ERROR: Unsupported type: " << type_in << std::endl; 00142 libmesh_error(); 00143 } 00144 } 00145 00146 libmesh_error(); 00147 00148 return; 00149 00150 #endif 00151 }
| static unsigned int libMesh::ReferenceCounter::n_objects | ( | ) | [inline, static, inherited] |
Prints the number of outstanding (created, but not yet destroyed) objects.
Definition at line 79 of file reference_counter.h.
References libMesh::ReferenceCounter::_n_objects.
00080 { return _n_objects; }
| unsigned int libMesh::QBase::n_points | ( | ) | const [inline, inherited] |
- Returns:
- the number of points associated with the quadrature rule.
Definition at line 116 of file quadrature.h.
References libMesh::QBase::_points.
Referenced by libMesh::FEGenericBase< OutputType >::coarsened_dof_values(), libMesh::InfFE< Dim, T_radial, T_map >::combine_base_radial(), libMesh::QConical::conical_product_pyramid(), libMesh::QConical::conical_product_tet(), libMesh::QConical::conical_product_tri(), libMesh::InfFE< Dim, T_radial, T_map >::init_face_shape_functions(), libMesh::InfFE< Dim, T_radial, T_map >::init_shape_functions(), libMesh::FE< Dim, T >::n_quadrature_points(), libMesh::ProjectFEMSolution::operator()(), and libMesh::QBase::print_info().
| void libMesh::ReferenceCounter::print_info | ( | std::ostream & | out = libMesh::out |
) | [static, inherited] |
Prints the reference information, by default to libMesh::out.
Definition at line 88 of file reference_counter.C.
References libMesh::ReferenceCounter::_enable_print_counter, and libMesh::ReferenceCounter::get_info().
00089 { 00090 if( _enable_print_counter ) out_stream << ReferenceCounter::get_info(); 00091 }
| void libMesh::QBase::print_info | ( | std::ostream & | os = libMesh::out |
) | const [inline, inherited] |
Prints information relevant to the quadrature rule, by default to libMesh::out.
Definition at line 362 of file quadrature.h.
References libMesh::QBase::_points, libMesh::QBase::_weights, and libMesh::QBase::n_points().
Referenced by libMesh::operator<<().
00363 { 00364 libmesh_assert(!_points.empty()); 00365 libmesh_assert(!_weights.empty()); 00366 00367 os << "N_Q_Points=" << this->n_points() << std::endl << std::endl; 00368 for (unsigned int qpoint=0; qpoint<this->n_points(); qpoint++) 00369 { 00370 os << " Point " << qpoint << ":\n" 00371 << " " 00372 << _points[qpoint] 00373 << " Weight:\n " 00374 << " w=" << _weights[qpoint] << "\n" << std::endl; 00375 } 00376 }
| Point libMesh::QBase::qp | ( | const unsigned int | i | ) | const [inline, inherited] |
- Returns:
- the
quadrature point on the reference object.
Definition at line 150 of file quadrature.h.
References libMesh::QBase::_points.
Referenced by libMesh::QConical::conical_product_pyramid(), libMesh::QConical::conical_product_tet(), and libMesh::QConical::conical_product_tri().
| void libMesh::QBase::scale | ( | std::pair< Real, Real > | old_range, | |
| std::pair< Real, Real > | new_range | |||
| ) | [inherited] |
Maps the points of a 1D interval quadrature rule (typically [-1,1]) to any other 1D interval (typically [0,1]) and scales the weights accordingly. The quadrature rule will be mapped from the entries of old_range to the entries of new_range.
Definition at line 82 of file quadrature.C.
References libMesh::QBase::_points, libMesh::QBase::_weights, and libMesh::Real.
Referenced by libMesh::QConical::conical_product_tet(), and libMesh::QConical::conical_product_tri().
00084 { 00085 // Make sure we are in 1D 00086 libmesh_assert_equal_to (_dim, 1); 00087 00088 // Make sure that we have sane ranges 00089 libmesh_assert_greater (new_range.second, new_range.first); 00090 libmesh_assert_greater (old_range.second, old_range.first); 00091 00092 // Make sure there are some points 00093 libmesh_assert_greater (_points.size(), 0); 00094 00095 // We're mapping from old_range -> new_range 00096 for (unsigned int i=0; i<_points.size(); i++) 00097 { 00098 _points[i](0) = 00099 (_points[i](0) - old_range.first) * 00100 (new_range.second - new_range.first) / 00101 (old_range.second - old_range.first) + 00102 new_range.first; 00103 } 00104 00105 // Compute the scale factor and scale the weights 00106 const Real scfact = (new_range.second - new_range.first) / 00107 (old_range.second - old_range.first); 00108 00109 for (unsigned int i=0; i<_points.size(); i++) 00110 _weights[i] *= scfact; 00111 }
| virtual bool libMesh::QBase::shapes_need_reinit | ( | ) | [inline, virtual, inherited] |
Returns true if the shape functions need to be recalculated.
This can happen if the number of points or their positions change.
By default this will return false.
Definition at line 198 of file quadrature.h.
Referenced by libMesh::FE< Dim, T >::edge_reinit(), and libMesh::FE< Dim, T >::reinit().
| QuadratureType libMesh::QGrid::type | ( | ) | const [inline, virtual] |
- Returns:
QGRID
Implements libMesh::QBase.
Definition at line 60 of file quadrature_grid.h.
References libMeshEnums::QGRID.
00060 { return QGRID; }
| Real libMesh::QBase::w | ( | const unsigned int | i | ) | const [inline, inherited] |
- Returns:
- the
quadrature weight.
Definition at line 156 of file quadrature.h.
References libMesh::QBase::_weights.
Referenced by libMesh::QConical::conical_product_pyramid(), libMesh::QConical::conical_product_tet(), and libMesh::QConical::conical_product_tri().
Friends And Related Function Documentation
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const QBase & | q | |||
| ) | [friend, inherited] |
Same as above, but allows you to use the stream syntax.
Member Data Documentation
ReferenceCounter::Counts libMesh::ReferenceCounter::_counts [static, protected, inherited] |
Actually holds the data.
Definition at line 118 of file reference_counter.h.
Referenced by libMesh::ReferenceCounter::get_info(), libMesh::ReferenceCounter::increment_constructor_count(), and libMesh::ReferenceCounter::increment_destructor_count().
bool libMesh::ReferenceCounter::_enable_print_counter = true [static, protected, inherited] |
Flag to control whether reference count information is printed when print_info is called.
Definition at line 137 of file reference_counter.h.
Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().
Threads::spin_mutex libMesh::ReferenceCounter::_mutex [static, protected, inherited] |
Mutual exclusion object to enable thread-safe reference counting.
Definition at line 131 of file reference_counter.h.
Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects [static, protected, inherited] |
The number of objects. Print the reference count information when the number returns to 0.
Definition at line 126 of file reference_counter.h.
Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().
libMesh::err<< "ERROR: Seems as if this quadrature rule" << std::endl << " is not implemented for 2D." << std::endl; libmesh_error(); }#endif virtual void init_3D (const ElemType, unsigned int =0)#ifndef DEBUG {}#else { libMesh::err << "ERROR: Seems as if this quadrature rule" << std::endl << " is not implemented for 3D." << std::endl; libmesh_error(); }#endif void tensor_product_quad (const QBase& q1D); void tensor_product_hex (const QBase& q1D); void tensor_product_prism (const QBase& q1D, const QBase& q2D); const unsigned int _dim; const Order _order; ElemType _type; unsigned int _p_level; std::vector<Point> libMesh::QBase::_points [protected, inherited] |
Definition at line 332 of file quadrature.h.
Referenced by libMesh::QConical::conical_product_pyramid(), libMesh::QConical::conical_product_tet(), libMesh::QConical::conical_product_tri(), libMesh::QGauss::dunavant_rule(), libMesh::QGauss::dunavant_rule2(), libMesh::QBase::get_points(), libMesh::QGrundmann_Moller::gm_rule(), libMesh::QBase::init_0D(), libMesh::QTrap::init_1D(), libMesh::QSimpson::init_1D(), libMesh::QJacobi::init_1D(), init_1D(), libMesh::QGauss::init_1D(), libMesh::QClough::init_1D(), libMesh::QTrap::init_2D(), libMesh::QSimpson::init_2D(), libMesh::QMonomial::init_2D(), init_2D(), libMesh::QGauss::init_2D(), libMesh::QClough::init_2D(), libMesh::QTrap::init_3D(), libMesh::QSimpson::init_3D(), libMesh::QMonomial::init_3D(), init_3D(), libMesh::QGauss::init_3D(), libMesh::QGauss::keast_rule(), libMesh::QMonomial::kim_rule(), libMesh::QBase::n_points(), libMesh::QBase::print_info(), libMesh::QBase::qp(), libMesh::QBase::scale(), libMesh::QMonomial::stroud_rule(), and libMesh::QMonomial::wissmann_rule().
std::vector<Real> libMesh::QBase::_weights [protected, inherited] |
The value of the quadrature weights.
Definition at line 337 of file quadrature.h.
Referenced by libMesh::QConical::conical_product_pyramid(), libMesh::QConical::conical_product_tet(), libMesh::QConical::conical_product_tri(), libMesh::QGauss::dunavant_rule(), libMesh::QGauss::dunavant_rule2(), libMesh::QBase::get_weights(), libMesh::QGrundmann_Moller::gm_rule(), libMesh::QBase::init_0D(), libMesh::QTrap::init_1D(), libMesh::QSimpson::init_1D(), libMesh::QJacobi::init_1D(), init_1D(), libMesh::QGauss::init_1D(), libMesh::QClough::init_1D(), libMesh::QTrap::init_2D(), libMesh::QSimpson::init_2D(), libMesh::QMonomial::init_2D(), init_2D(), libMesh::QGauss::init_2D(), libMesh::QClough::init_2D(), libMesh::QTrap::init_3D(), libMesh::QSimpson::init_3D(), libMesh::QMonomial::init_3D(), init_3D(), libMesh::QGauss::init_3D(), libMesh::QGauss::keast_rule(), libMesh::QMonomial::kim_rule(), libMesh::QBase::print_info(), libMesh::QBase::scale(), libMesh::QMonomial::stroud_rule(), libMesh::QBase::w(), and libMesh::QMonomial::wissmann_rule().
bool libMesh::QBase::allow_rules_with_negative_weights [inherited] |
Flag (default true) controlling the use of quadrature rules with negative weights. Set this to false to ONLY use (potentially) safer but more expensive rules with all positive weights.
Negative weights typically appear in Gaussian quadrature rules over three-dimensional elements. Rules with negative weights can be unsuitable for some problems. For example, it is possible for a rule with negative weights to obtain a negative result when integrating a positive function.
A particular example: if rules with negative weights are not allowed, a request for TET,THIRD (5 points) will return the TET,FIFTH (14 points) rule instead, nearly tripling the computational effort required!
Definition at line 215 of file quadrature.h.
Referenced by libMesh::QMonomial::init_3D(), libMesh::QGrundmann_Moller::init_3D(), and libMesh::QGauss::init_3D().
The documentation for this class was generated from the following files:
Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:35 UTC
Hosted By: