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];
1075 double knot(
const unsigned&
i,
const unsigned& j)
const
1098 static const unsigned Npts = 64;
1100 static const double Knot[64][2], Weight[64];
1119 double knot(
const unsigned&
i,
const unsigned& j)
const
1144 static const unsigned Npts = 4;
1146 static const double Knot[4][3], Weight[4];
1165 double knot(
const unsigned&
i,
const unsigned& j)
const
1192 static const unsigned Npts = 11;
1194 static const double Knot[11][3], Weight[11];
1213 double knot(
const unsigned&
i,
const unsigned& j)
const
1240 static const unsigned Npts = 45;
1242 static const double Knot[45][3], Weight[45];
1261 double knot(
const unsigned&
i,
const unsigned& j)
const
1279 template<
unsigned DIM,
unsigned NPTS_1D>
1287 template<
unsigned NPTS_1D>
1292 static const unsigned Npts = NPTS_1D;
1295 double Knot[NPTS_1D][1], Weight[NPTS_1D];
1308 double knot(
const unsigned&
i,
const unsigned& j)
const
1325 template<
unsigned NPTS_1D>
1333 for (
unsigned i = 0;
i < NPTS_1D;
i++)
1344 template<
unsigned NPTS_1D>
1349 static const unsigned long int Npts = NPTS_1D * NPTS_1D;
1352 double Knot[NPTS_1D * NPTS_1D][2],
1353 Weight[NPTS_1D * NPTS_1D];
1367 double knot(
const unsigned&
i,
const unsigned& j)
const
1384 template<
unsigned NPTS_1D>
1391 int i_fast = 0, i_slow = 0;
1392 for (
unsigned i = 0;
i < NPTS_1D * NPTS_1D;
i++)
1394 if (i_fast == NPTS_1D)
1399 Knot[
i][0] =
s[i_fast];
1400 Knot[
i][1] =
s[i_slow];
1401 Weight[
i] = w[i_fast] * w[i_slow];
1410 template<
unsigned NPTS_1D>
1415 static const unsigned long int Npts = NPTS_1D * NPTS_1D * NPTS_1D;
1418 double Knot[NPTS_1D * NPTS_1D * NPTS_1D][3],
1419 Weight[NPTS_1D * NPTS_1D * NPTS_1D];
1433 double knot(
const unsigned&
i,
const unsigned& j)
const
1450 template<
unsigned NPTS_1D>
1457 for (
unsigned k = 0; k < NPTS_1D; k++)
1459 for (
unsigned j = 0; j < NPTS_1D; j++)
1461 for (
unsigned i = 0;
i < NPTS_1D;
i++)
1463 unsigned index = NPTS_1D * NPTS_1D * k + NPTS_1D * j +
i;
1464 Knot[index][0] =
s[
i];
1465 Knot[index][1] =
s[j];
1466 Knot[index][2] =
s[k];
1467 Weight[index] = w[
i] * w[j] * w[k];
1483 template<
unsigned DIM,
unsigned NPTS_1D>
1491 template<
unsigned NPTS_1D>
1496 static const unsigned Npts = NPTS_1D;
1499 double Knot[NPTS_1D][1], Weight[NPTS_1D];
1512 double knot(
const unsigned&
i,
const unsigned& j)
const
1529 template<
unsigned NPTS_1D>
1537 for (
unsigned i = 0;
i < NPTS_1D;
i++)
1548 template<
unsigned NPTS_1D>
1553 static const unsigned long int Npts = NPTS_1D * NPTS_1D;
1556 double Knot[NPTS_1D * NPTS_1D][2],
1557 Weight[NPTS_1D * NPTS_1D];
1571 double knot(
const unsigned&
i,
const unsigned& j)
const
1588 template<
unsigned NPTS_1D>
1595 int i_fast = 0, i_slow = 0;
1596 for (
unsigned i = 0;
i < NPTS_1D * NPTS_1D;
i++)
1598 if (i_fast == NPTS_1D)
1603 Knot[
i][0] =
s[i_fast];
1604 Knot[
i][1] =
s[i_slow];
1605 Weight[
i] = w[i_fast] * w[i_slow];
1614 template<
unsigned NPTS_1D>
1619 static const unsigned long int Npts = NPTS_1D * NPTS_1D * NPTS_1D;
1622 double Knot[NPTS_1D * NPTS_1D * NPTS_1D][3],
1623 Weight[NPTS_1D * NPTS_1D * NPTS_1D];
1637 double knot(
const unsigned&
i,
const unsigned& j)
const
1654 template<
unsigned NPTS_1D>
1661 for (
unsigned k = 0; k < NPTS_1D; k++)
1663 for (
unsigned j = 0; j < NPTS_1D; j++)
1665 for (
unsigned i = 0;
i < NPTS_1D;
i++)
1667 unsigned index = NPTS_1D * NPTS_1D * k + NPTS_1D * j +
i;
1668 Knot[index][0] =
s[
i];
1669 Knot[index][1] =
s[j];
1670 Knot[index][2] =
s[k];
1671 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....
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.
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.
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.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...