Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
gauss_quad.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011-2015: G-CSC, Goethe University Frankfurt
3 * Author: Andreas Vogel
4 *
5 * This file is part of UG4.
6 *
7 * UG4 is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License version 3 (as published by the
9 * Free Software Foundation) with the following additional attribution
10 * requirements (according to LGPL/GPL v3 §7):
11 *
12 * (1) The following notice must be displayed in the Appropriate Legal Notices
13 * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14 *
15 * (2) The following notice must be displayed at a prominent place in the
16 * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17 *
18 * (3) The following bibliography is recommended for citation and must be
19 * preserved in all covered files:
20 * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21 * parallel geometric multigrid solver on hierarchically distributed grids.
22 * Computing and visualization in science 16, 4 (2013), 151-164"
23 * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24 * flexible software system for simulating pde based models on high performance
25 * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26 *
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU Lesser General Public License for more details.
31 */
32
33#ifndef __H__UG__LIB_DISC__QUADRATURE__GAUSS_QUAD__GAUSS_QUAD__
34#define __H__UG__LIB_DISC__QUADRATURE__GAUSS_QUAD__GAUSS_QUAD__
35
36#include "common/common.h"
37#include "../quadrature.h"
39
40namespace ug{
41
43template <typename TRefElem, int order>
45
47template <typename TImpl, int TDim, int TOrder, int TNip>
49{
50 public:
52 static const size_t dim = TDim;
53
56
59
61 static const size_t p = TOrder;
62
64 static const size_t nip = TNip;
65
66 public:
68 static size_t size() {return nip;}
69
71 static const MathVector<dim>& point(size_t i)
72 {UG_ASSERT(i < size(), "Wrong index"); return m_vPoint[i];}
73
75 static const MathVector<dim>* points() {return m_vPoint;}
76
78 static number weight(size_t i)
79 {UG_ASSERT(i < size(), "Wrong index"); return m_vWeight[i];}
80
82 static const number* weights() {return m_vWeight;}
83
85 static size_t order() {return p;}
86
87 protected:
90
93};
94
96
102template <typename TRefElem>
104 : public QuadratureRule<TRefElem::dim>
105{
106 public:
109
112};
113
114} // namespace ug
115
116// include implementation
117#include "gauss_quad_vertex.h"
118#include "gauss_quad_edge.h"
119#include "gauss_quad_triangle.h"
122#include "gauss_quad_pyramid.h"
123#include "gauss_quad_prism.h"
126
127
128#endif /* __H__UG__LIB_DISC__QUADRATURE__GAUSS_QUAD__GAUSS_QUAD__ */
flexible order gauss quadrature
Definition gauss_quad.h:105
~FlexGaussQuadrature()
Destructor.
Definition gauss_quad.h:111
FlexGaussQuadrature(int order)
Constructor.
wrapper to ease implementation
Definition gauss_quad.h:49
static size_t size()
number of integration points
Definition gauss_quad.h:68
MathVector< dim > position_type
Position Type in Reference Element Space.
Definition gauss_quad.h:55
static const MathVector< dim > & point(size_t i)
returns i'th integration point
Definition gauss_quad.h:71
static const number * weights()
returns all weights in an array of size()
Definition gauss_quad.h:82
static const MathVector< dim > * points()
returns all positions in an array of size()
Definition gauss_quad.h:75
static const size_t nip
Number of integration points.
Definition gauss_quad.h:64
static MathVector< dim > m_vPoint[nip]
integration points
Definition gauss_quad.h:89
static size_t order()
returns the order
Definition gauss_quad.h:85
static const size_t p
Order of quadrature rule.
Definition gauss_quad.h:61
number weight_type
Type of weights.
Definition gauss_quad.h:58
static number weight(size_t i)
return the i'th weight
Definition gauss_quad.h:78
static number m_vWeight[nip]
weights
Definition gauss_quad.h:92
static const size_t dim
Dimension of integration domain.
Definition gauss_quad.h:52
fixed order gauss quadrature
Definition gauss_quad.h:44
a mathematical Vector with N entries.
Definition math_vector.h:97
provides quadrature rule for a Reference Dimension
Definition quadrature.h:70
size_t order() const
returns the order
Definition quadrature.h:115
#define UG_ASSERT(expr, msg)
Definition assert.h:70
double number
Definition types.h:124
the ug namespace