## [Libmesh-users] QGauss

 [Libmesh-users] QGauss From: Roy Stogner - 2006-02-23 20:22:04 ```On Thu, 23 Feb 2006, li pan wrote: > thanks for your suggestion. I think I can try to do > the integration like with hex mesh. Another simple > question. If I'm using Tet4, and considering u v w > components (variables), and all the components have > order one, can I use QGauss(SECOND)? If you're integrating products of two linear functions, then any rule that exactly integrates quadratics will work for you - QGauss(SECOND) is the cheapest such rule. Of course, I don't know exactly what you're integrating - if you're just solving a Laplacian problem and only need to integrate products of gradients, then all your integrals except the boundary integrals are elementwise constant, and QGauss(CONSTANT) will give you the same results with one quadrature point instead of four. If you're solving a nonlinear problem or a problem with variable coefficients, then getting exact integrals from a quadrature rule may be impossible, and even if QGauss(SECOND) doesn't ruin your O(h^2) accuracy you may want to experiment with higher rules to get a better constant in front of that h^2. Ben, John, is our QGauss documentation wrong? It says, "Gauss quadrature rules of order p have the property of integrating polynomials of degree 2p-1 exactly.", but that's not true. That sounds like the theorem for a 1D Gauss rule with p points, but looking in the code, we aren't using the Order argument to choose a number of points, we're using it to choose what degree of polynomial to exactly integrate. --- Roy ```

 [Libmesh-users] QGauss From: Roy Stogner - 2006-02-23 20:22:04 ```On Thu, 23 Feb 2006, li pan wrote: > thanks for your suggestion. I think I can try to do > the integration like with hex mesh. Another simple > question. If I'm using Tet4, and considering u v w > components (variables), and all the components have > order one, can I use QGauss(SECOND)? If you're integrating products of two linear functions, then any rule that exactly integrates quadratics will work for you - QGauss(SECOND) is the cheapest such rule. Of course, I don't know exactly what you're integrating - if you're just solving a Laplacian problem and only need to integrate products of gradients, then all your integrals except the boundary integrals are elementwise constant, and QGauss(CONSTANT) will give you the same results with one quadrature point instead of four. If you're solving a nonlinear problem or a problem with variable coefficients, then getting exact integrals from a quadrature rule may be impossible, and even if QGauss(SECOND) doesn't ruin your O(h^2) accuracy you may want to experiment with higher rules to get a better constant in front of that h^2. Ben, John, is our QGauss documentation wrong? It says, "Gauss quadrature rules of order p have the property of integrating polynomials of degree 2p-1 exactly.", but that's not true. That sounds like the theorem for a 1D Gauss rule with p points, but looking in the code, we aren't using the Order argument to choose a number of points, we're using it to choose what degree of polynomial to exactly integrate. --- Roy ```