29 #ifndef OOMPH_INTEGRAL_HEADER
30 #define OOMPH_INTEGRAL_HEADER
35 #include <oomph-lib-config.h>
67 virtual double knot(
const unsigned&
i,
const unsigned& j)
const = 0;
72 throw OomphLibError(
"Not implemented for this integration scheme (yet?).",
73 OOMPH_CURRENT_FUNCTION,
74 OOMPH_EXCEPTION_LOCATION);
78 virtual double weight(
const unsigned&
i)
const = 0;
108 double knot(
const unsigned&
i,
const unsigned& j)
const
110 throw OomphLibError(
"Local coordinate vector is of size zero, so this "
111 "should never be called.",
112 OOMPH_CURRENT_FUNCTION,
113 OOMPH_EXCEPTION_LOCATION);
143 template<
unsigned DIM,
unsigned NPTS_1D>
162 static const unsigned Npts = 2;
164 static const double Knot[2][1], Weight[2];
183 double knot(
const unsigned&
i,
const unsigned& j)
const
208 static const unsigned Npts = 3;
210 static const double Knot[3][1], Weight[3];
229 double knot(
const unsigned&
i,
const unsigned& j)
const
254 static const unsigned Npts = 4;
256 static const double Knot[4][1], Weight[4];
275 double knot(
const unsigned&
i,
const unsigned& j)
const
300 static const unsigned Npts = 4;
302 static const double Knot[4][2], Weight[4];
321 double knot(
const unsigned&
i,
const unsigned& j)
const
346 static const unsigned Npts = 9;
348 static const double Knot[9][2], Weight[9];
367 double knot(
const unsigned&
i,
const unsigned& j)
const
392 static const unsigned Npts = 16;
394 static const double Knot[16][2], Weight[16];
414 double knot(
const unsigned&
i,
const unsigned& j)
const
439 static const unsigned Npts = 8;
441 static const double Knot[8][3], Weight[8];
460 double knot(
const unsigned&
i,
const unsigned& j)
const
485 static const unsigned Npts = 27;
487 static const double Knot[27][3], Weight[27];
506 double knot(
const unsigned&
i,
const unsigned& j)
const
531 static const unsigned Npts = 64;
533 static const double Knot[64][3], Weight[64];
552 double knot(
const unsigned&
i,
const unsigned& j)
const
569 template<
unsigned DIM,
unsigned NPTS_1D>
590 Range = upper - lower;
594 double knot(
const unsigned&
i,
const unsigned& j)
const
603 pow(0.5 *
Range,
static_cast<int>(DIM));
624 template<
unsigned DIM,
unsigned NPTS_1D>
643 static const unsigned Npts = 2;
646 static const double Knot[2][1], Weight[2];
665 double knot(
const unsigned&
i,
const unsigned& j)
const
690 static const unsigned Npts = 3;
692 static const double Knot[3][1], Weight[3];
711 double knot(
const unsigned&
i,
const unsigned& j)
const
737 static const unsigned Npts = 4;
739 static const double Knot[4][1], Weight[4];
758 double knot(
const unsigned&
i,
const unsigned& j)
const
776 static const unsigned Npts = 5;
778 static const double Knot[5][1], Weight[5];
797 double knot(
const unsigned&
i,
const unsigned& j)
const
823 static const unsigned Npts = 3;
826 static const double Knot[3][2], Weight[3];
845 double knot(
const unsigned&
i,
const unsigned& j)
const
870 static const unsigned Npts = 7;
872 static const double Knot[7][2], Weight[7];
891 double knot(
const unsigned&
i,
const unsigned& j)
const
917 static const unsigned Npts = 13;
919 static const double Knot[13][2], Weight[13];
938 double knot(
const unsigned&
i,
const unsigned& j)
const
961 static const unsigned Npts = 37;
963 static const double Knot[37][2], Weight[37];
982 double knot(
const unsigned&
i,
const unsigned& j)
const
1006 static const unsigned Npts = 19;
1008 static const double Knot[19][2], Weight[19];
1027 double knot(
const unsigned&
i,
const unsigned& j)
const
1054 static const unsigned Npts = 52;
1056 static const double Knot[52][2], Weight[52];
1072 if (!User_has_been_warned)
1075 "The TGauss<2,16> integration scheme uses a high order Dunavant\n"
1076 "scheme which results in a couple of knots (slightly) outside of\n"
1077 "the element as well as some negative weights. These may be\n"
1078 "undesirable features depending on the use case and may also break\n"
1079 "some oomph-lib routines which expect points to be within the\n"
1080 "bounds of an element (locate_zeta). Please ensure that the\n"
1081 "integrand can be evaluated just outside the boundary of this\n"
1083 User_has_been_warned =
true;
1085 warning_string, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1103 double knot(
const unsigned&
i,
const unsigned& j)
const
1126 static const unsigned Npts = 64;
1128 static const double Knot[64][2], Weight[64];
1147 double knot(
const unsigned&
i,
const unsigned& j)
const
1172 static const unsigned Npts = 4;
1174 static const double Knot[4][3], Weight[4];
1193 double knot(
const unsigned&
i,
const unsigned& j)
const
1220 static const unsigned Npts = 11;
1222 static const double Knot[11][3], Weight[11];
1241 double knot(
const unsigned&
i,
const unsigned& j)
const
1268 static const unsigned Npts = 45;
1270 static const double Knot[45][3], Weight[45];
1289 double knot(
const unsigned&
i,
const unsigned& j)
const
1307 template<
unsigned DIM,
unsigned NPTS_1D>
1315 template<
unsigned NPTS_1D>
1320 static const unsigned Npts = NPTS_1D;
1323 double Knot[NPTS_1D][1], Weight[NPTS_1D];
1336 double knot(
const unsigned&
i,
const unsigned& j)
const
1353 template<
unsigned NPTS_1D>
1361 for (
unsigned i = 0;
i < NPTS_1D;
i++)
1372 template<
unsigned NPTS_1D>
1377 static const unsigned long int Npts = NPTS_1D * NPTS_1D;
1380 double Knot[NPTS_1D * NPTS_1D][2],
1381 Weight[NPTS_1D * NPTS_1D];
1395 double knot(
const unsigned&
i,
const unsigned& j)
const
1412 template<
unsigned NPTS_1D>
1419 int i_fast = 0, i_slow = 0;
1420 for (
unsigned i = 0;
i < NPTS_1D * NPTS_1D;
i++)
1422 if (i_fast == NPTS_1D)
1427 Knot[
i][0] =
s[i_fast];
1428 Knot[
i][1] =
s[i_slow];
1429 Weight[
i] = w[i_fast] * w[i_slow];
1438 template<
unsigned NPTS_1D>
1443 static const unsigned long int Npts = NPTS_1D * NPTS_1D * NPTS_1D;
1446 double Knot[NPTS_1D * NPTS_1D * NPTS_1D][3],
1447 Weight[NPTS_1D * NPTS_1D * NPTS_1D];
1461 double knot(
const unsigned&
i,
const unsigned& j)
const
1478 template<
unsigned NPTS_1D>
1485 for (
unsigned k = 0; k < NPTS_1D; k++)
1487 for (
unsigned j = 0; j < NPTS_1D; j++)
1489 for (
unsigned i = 0;
i < NPTS_1D;
i++)
1491 unsigned index = NPTS_1D * NPTS_1D * k + NPTS_1D * j +
i;
1492 Knot[index][0] =
s[
i];
1493 Knot[index][1] =
s[j];
1494 Knot[index][2] =
s[k];
1495 Weight[index] = w[
i] * w[j] * w[k];
1511 template<
unsigned DIM,
unsigned NPTS_1D>
1519 template<
unsigned NPTS_1D>
1524 static const unsigned Npts = NPTS_1D;
1527 double Knot[NPTS_1D][1], Weight[NPTS_1D];
1540 double knot(
const unsigned&
i,
const unsigned& j)
const
1557 template<
unsigned NPTS_1D>
1565 for (
unsigned i = 0;
i < NPTS_1D;
i++)
1576 template<
unsigned NPTS_1D>
1581 static const unsigned long int Npts = NPTS_1D * NPTS_1D;
1584 double Knot[NPTS_1D * NPTS_1D][2],
1585 Weight[NPTS_1D * NPTS_1D];
1599 double knot(
const unsigned&
i,
const unsigned& j)
const
1616 template<
unsigned NPTS_1D>
1623 int i_fast = 0, i_slow = 0;
1624 for (
unsigned i = 0;
i < NPTS_1D * NPTS_1D;
i++)
1626 if (i_fast == NPTS_1D)
1631 Knot[
i][0] =
s[i_fast];
1632 Knot[
i][1] =
s[i_slow];
1633 Weight[
i] = w[i_fast] * w[i_slow];
1642 template<
unsigned NPTS_1D>
1647 static const unsigned long int Npts = NPTS_1D * NPTS_1D * NPTS_1D;
1650 double Knot[NPTS_1D * NPTS_1D * NPTS_1D][3],
1651 Weight[NPTS_1D * NPTS_1D * NPTS_1D];
1665 double knot(
const unsigned&
i,
const unsigned& j)
const
1682 template<
unsigned NPTS_1D>
1689 for (
unsigned k = 0; k < NPTS_1D; k++)
1691 for (
unsigned j = 0; j < NPTS_1D; j++)
1693 for (
unsigned i = 0;
i < NPTS_1D;
i++)
1695 unsigned index = NPTS_1D * NPTS_1D * k + NPTS_1D * j +
i;
1696 Knot[index][0] =
s[
i];
1697 Knot[index][1] =
s[j];
1698 Knot[index][2] =
s[k];
1699 Weight[index] = w[
i] * w[j] * w[k];
double weight(const unsigned &i) const
Return weight of integration point i.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate s[j] (j=0) of integration point i.
unsigned nweight() const
Number of integration points of the scheme.
unsigned nweight() const
Number of integration points of the scheme.
double weight(const unsigned &i) const
Return weight of integration point i.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate s[j] (j=0) of integration point i.
unsigned nweight() const
Number of integration points of the scheme.
double weight(const unsigned &i) const
Return weight of integration point i.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate s[j] (j=0) of integration point i.
///////////////////////////////////////////////////////////////// ///////////////////////////////////...
double weight(const unsigned &i) const
Return weight of integration point i.
unsigned nweight() const
Number of integration points of the scheme.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate s[j] (j=0) of integration point i.
unsigned nweight() const
Number of integration points of the scheme.
double weight(const unsigned &i) const
Return weight of integration point i.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate s[j] (j=0) of integration point i.
double weight(const unsigned &i) const
Return weight of integration point i.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate s[j] (j=0) of integration point i.
unsigned nweight() const
Number of integration points of the scheme.
Class for multidimensional Gauss Lobatto Legendre integration rules empty - just establishes template...
Gauss()
Default constructor (empty)
void operator=(const Gauss &)=delete
Broken assignment operator.
Gauss(const Gauss &dummy)=delete
Broken copy constructor.
unsigned nweight() const
Number of integration points of the scheme.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate s[j] (j=0) of integration point i.
double weight(const unsigned &i) const
Return weight of integration point i.
double weight(const unsigned &i) const
Return weight of integration point i.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate s[j] (j=0) of integration point i.
unsigned nweight() const
Number of integration points of the scheme.
Gauss()
Default constructor (empty)
void operator=(const Gauss &)=delete
Broken assignment operator.
Gauss(const Gauss &dummy)=delete
Broken copy constructor.
void operator=(const Gauss &)=delete
Broken assignment operator.
unsigned nweight() const
Number of integration points of the scheme.
double weight(const unsigned &i) const
Return weight of integration point i.
Gauss()
Default constructor (empty)
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] (j=0) of integration point i.
Gauss(const Gauss &dummy)=delete
Broken copy constructor.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
Gauss(const Gauss &dummy)=delete
Broken copy constructor.
double weight(const unsigned &i) const
Return weight of integration point i.
void operator=(const Gauss &)=delete
Broken assignment operator.
unsigned nweight() const
Number of integration points of the scheme.
Gauss()
Default constructor (empty)
double knot(const unsigned &i, const unsigned &j) const
Return coordinate s[j] of integration point i.
void operator=(const Gauss &)=delete
Broken assignment operator.
Gauss(const Gauss &dummy)=delete
Broken copy constructor.
double weight(const unsigned &i) const
Return weight of integration point i.
unsigned nweight() const
Number of integration points of the scheme.
Gauss()
Default constructor (empty)
Gauss(const Gauss &dummy)=delete
Broken copy constructor.
Gauss()
Default constructor (empty)
double knot(const unsigned &i, const unsigned &j) const
Return coordinate s[j] of integration point i.
void operator=(const Gauss &)=delete
Broken assignment operator.
unsigned nweight() const
Number of integration points of the scheme.
double weight(const unsigned &i) const
Return weight of integration point i.
Gauss(const Gauss &dummy)=delete
Broken copy constructor.
unsigned nweight() const
Number of integration points of the scheme.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate s[j] of integration point i.
void operator=(const Gauss &)=delete
Broken assignment operator.
Gauss()
Default constructor (empty)
double weight(const unsigned &i) const
Return weight of integration point i.
void operator=(const Gauss &)=delete
Broken assignment operator.
double weight(const unsigned &i) const
Return weight of integration point i.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
Gauss()
Default constructor (empty)
unsigned nweight() const
Number of integration points of the scheme.
Gauss(const Gauss &dummy)=delete
Broken copy constructor.
Gauss()
Default constructor (empty)
unsigned nweight() const
Number of integration points of the scheme.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
void operator=(const Gauss &)=delete
Broken assignment operator.
Gauss(const Gauss &dummy)=delete
Broken copy constructor.
double weight(const unsigned &i) const
Return weight of integration point i.
Class for multidimensional Gaussian integration rules, over intervals other than -1 to 1,...
void operator=(const Gauss_Rescaled &)=delete
Broken assignment operator.
double Lower
Store for the lower and upper limits of integration and the range.
Gauss_Rescaled()
Default constructor (empty)
double knot(const unsigned &i, const unsigned &j) const
Return the rescaled knot values s[j] at integration point i.
Gauss_Rescaled(double lower, double upper)
The constructor in this case takes the lower and upper arguments.
double weight(const unsigned &i) const
Return the rescaled weight at integration point i.
Gauss_Rescaled(const Gauss_Rescaled &dummy)=delete
Broken copy constructor.
Class for multidimensional Gaussian integration rules.
Generic class for numerical integration schemes:
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
Integral(const Integral &dummy)=delete
Broken copy constructor.
virtual Vector< double > knot(const unsigned &i) const
Return local coordinates of i-th intergration point. Broken virtual.
virtual ~Integral()
Virtual destructor (empty)
Integral()
Default constructor (empty)
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
void operator=(const Integral &)=delete
Broken assignment operator.
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
Broken pseudo-integration scheme for points elements: Iit's not clear in general what this integratio...
double knot(const unsigned &i, const unsigned &j) const
Return coordinate s[j] (j=0) of integration point i – deliberately broken!
unsigned nweight() const
Number of integration points of the scheme.
PointIntegral(const PointIntegral &dummy)=delete
Broken copy constructor.
double weight(const unsigned &i) const
Return weight of integration point i.
PointIntegral()
Default constructor (empty)
void operator=(const PointIntegral &)=delete
Broken assignment operator.
TGauss(const TGauss &dummy)=delete
Broken copy constructor.
double weight(const unsigned &i) const
Return weight of integration point i.
unsigned nweight() const
Number of integration points of the scheme.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
TGauss()
Default constructor (empty)
void operator=(const TGauss &)=delete
Broken assignment operator.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
TGauss(const TGauss &dummy)=delete
Broken copy constructor.
double weight(const unsigned &i) const
Return weight of integration point i.
void operator=(const TGauss &)=delete
Broken assignment operator.
TGauss()
Default constructor (empty)
unsigned nweight() const
Number of integration points of the scheme.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
TGauss()
Default constructor (empty)
TGauss(const TGauss &dummy)=delete
Broken copy constructor.
void operator=(const TGauss &)=delete
Broken assignment operator.
unsigned nweight() const
Number of integration points of the scheme.
double weight(const unsigned &i) const
Return weight of integration point i.
double weight(const unsigned &i) const
Return weight of integration point i.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
void operator=(const TGauss &)=delete
Broken assignment operator.
TGauss()
Default constructor (empty)
TGauss(const TGauss &dummy)=delete
Broken copy constructor.
unsigned nweight() const
Number of integration points of the scheme.
TGauss()
Default constructor (empty)
double weight(const unsigned &i) const
Return weight of integration point i.
unsigned nweight() const
Number of integration points of the scheme.
TGauss(const TGauss &dummy)=delete
Broken copy constructor.
void operator=(const TGauss &)=delete
Broken assignment operator.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
static bool User_has_been_warned
A flag to track whether we have warned the user about the exterior knots and negative weights in this...
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
unsigned nweight() const
Number of integration points of the scheme.
void operator=(const TGauss &)=delete
Broken assignment operator.
TGauss()
Default constructor (empty)
TGauss(const TGauss &dummy)=delete
Broken copy constructor.
double weight(const unsigned &i) const
Return weight of integration point i.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
double weight(const unsigned &i) const
Return weight of integration point i.
unsigned nweight() const
Number of integration points of the scheme.
void operator=(const TGauss &)=delete
Broken assignment operator.
TGauss()
Default constructor (empty)
TGauss(const TGauss &dummy)=delete
Broken copy constructor.
unsigned nweight() const
Number of integration points of the scheme.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
double weight(const unsigned &i) const
Return weight of integration point i.
void operator=(const TGauss &)=delete
Broken assignment operator.
TGauss(const TGauss &dummy)=delete
Broken copy constructor.
TGauss()
Default constructor (empty)
double weight(const unsigned &i) const
Return weight of integration point i.
TGauss()
Default constructor (empty)
unsigned nweight() const
Number of integration points of the scheme.
TGauss(const TGauss &dummy)=delete
Broken copy constructor.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
void operator=(const TGauss &)=delete
Broken assignment operator.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
unsigned nweight() const
Number of integration points of the scheme.
TGauss(const TGauss &dummy)=delete
Broken copy constructor.
double weight(const unsigned &i) const
Return weight of integration point i.
void operator=(const TGauss &)=delete
Broken assignment operator.
TGauss()
Default constructor (empty)
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
unsigned nweight() const
Number of integration points of the scheme.
TGauss()
Default constructor (empty)
TGauss(const TGauss &dummy)=delete
Broken copy constructor.
double weight(const unsigned &i) const
Return weight of integration point i.
void operator=(const TGauss &)=delete
Broken assignment operator.
void operator=(const TGauss &)=delete
Broken assignment operator.
TGauss()
Default constructor (empty)
double weight(const unsigned &i) const
Return weight of integration point i.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
TGauss(const TGauss &dummy)=delete
Broken copy constructor.
unsigned nweight() const
Number of integration points of the scheme.
double weight(const unsigned &i) const
Return weight of integration point i.
void operator=(const TGauss &)=delete
Broken assignment operator.
TGauss()
Default constructor (empty)
TGauss(const TGauss &dummy)=delete
Broken copy constructor.
unsigned nweight() const
Number of integration points of the scheme.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
void operator=(const TGauss &)=delete
Broken assignment operator.
unsigned nweight() const
Number of integration points of the scheme.
double knot(const unsigned &i, const unsigned &j) const
Return coordinate x[j] of integration point i.
TGauss(const TGauss &dummy)=delete
Broken copy constructor.
double weight(const unsigned &i) const
Return weight of integration point i.
TGauss()
Default constructor (empty)
Class for Gaussian integration rules for triangles/tets.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
void gl_nodes(const unsigned &Nnode, Vector< double > &x)
void gll_nodes(const unsigned &Nnode, Vector< double > &x)
Calculates the Gauss Lobatto Legendre abscissas for degree p = NNode-1.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...