![]() |
NLMech
0.1.0
|
Namespace to group the methods used in testing of the library. More...
Functions | |
| double | getExactIntegrationRefQuad (size_t alpha, size_t beta) |
| Computes integration of polynomial exactly over reference quadrangle. More... | |
| double | getExactIntegrationRefTet (size_t alpha, size_t beta, size_t theta) |
| Computes integration of polynomial exactly over reference tetrahedral. More... | |
| double | getExactIntegrationRefTri (size_t alpha, size_t beta) |
| Computes integration of polynomial exactly over reference triangle. More... | |
| double | getNChooseR (size_t n, size_t r) |
Computes "n choose r". More... | |
| void | testFracture () |
| Perform test on Fracture class and check if bit-wise functions are working correctly. | |
| void | testLineElem (size_t n) |
| Perform test on quadrature points on line elements. More... | |
| void | testQuadElem (size_t n) |
| Perform test on quadrature points on quadrangle elements. More... | |
| void | testTetElem (size_t n) |
| Perform test on quadrature points on tetrahedral elements. More... | |
| void | testTriElem (size_t n) |
| Perform test on quadrature points on triangle elements. More... | |
| void | testTriElemTime (size_t n, size_t N) |
| Computes the time needed when quad data for elements are stored and when they are computed as and when needed. More... | |
Namespace to group the methods used in testing of the library.
| double test::getExactIntegrationRefQuad | ( | size_t | alpha, |
| size_t | beta | ||
| ) |
Computes integration of polynomial exactly over reference quadrangle.
Given
, the exact integration is given by
If either
or
are odd number then
. Otherwise,
.
| alpha | Polynomial order in variable s |
| beta | Polynomial order in variable t |
Referenced by testQuadElem().

| double test::getExactIntegrationRefTet | ( | size_t | alpha, |
| size_t | beta, | ||
| size_t | theta | ||
| ) |
Computes integration of polynomial exactly over reference tetrahedral.
| alpha | Polynomial order in variable s |
| beta | Polynomial order in variable t |
| theta | Polynomial order in variable r |
Referenced by testTetElem().


| double test::getExactIntegrationRefTri | ( | size_t | alpha, |
| size_t | beta | ||
| ) |
Computes integration of polynomial exactly over reference triangle.
Given
, the exact integration is given by
where
We have
so that term for
is not zero. Above formula gives the exact value of integral of
over reference triangle.
| alpha | Polynomial order in variable s |
| beta | Polynomial order in variable t |
Referenced by testTriElem().


| double test::getNChooseR | ( | size_t | n, |
| size_t | r | ||
| ) |
Computes
"n choose r".
Computes formula
| n | Number |
| r | Number which is smaller or equal to n |
Referenced by getExactIntegrationRefTet(), and getExactIntegrationRefTri().

| void test::testLineElem | ( | size_t | n | ) |
Perform test on quadrature points on line elements.
This function performs accuracy test of the quadrature points for integration over reference line with vertices at {-1, 1}. List of tests are as follows:
Also tests the exactness of the integration of the polynomial up to given order. Suppose
is the order of quadrature point, then we test if the integration of the function
is exact for
and
such that
. The exact integration of function
over reference triangle is
where
We have
so that term for
is not zero. Above formula gives the exact value of integral of
over reference triangle. Approximation by quadrature point is as follows
where
is the total number of quad points,
and
are the
quad weight and point. In this test, we compare
and
and report problem if both do not match.
on
is given by
where
is the order of approximation we are testing.| n | Order of quadrature point approximation |
| void test::testQuadElem | ( | size_t | n | ) |
Perform test on quadrature points on quadrangle elements.
This function performs accuracy test of the quadrature points for integration over reference triangle with vertices at {(0,0), (1,0), (0,1)}. List of tests are as follows:
Also tests the exactness of the integration of the polynomial up to given order. Suppose
is the order of quadrature point, then we test if the integration of the function
is exact for
and
such that
. The exact integration of function
over reference triangle is
where
We have
so that term for
is not zero. Above formula gives the exact value of integral of
over reference triangle. Approximation by quadrature point is as follows
where
is the total number of quad points,
and
are the
quad weight and point. In this test, we compare
and
and report problem if both do not match.
on
is given by
where
is the order of approximation we are testing.| n | Order of quadrature point approximation |

| void test::testTetElem | ( | size_t | n | ) |
Perform test on quadrature points on tetrahedral elements.
| n | Order of quadrature point approximation |

| void test::testTriElem | ( | size_t | n | ) |
Perform test on quadrature points on triangle elements.
This function performs accuracy test of the quadrature points for integration over reference triangle with vertices at {(0,0), (1,0), (0,1)}. List of tests are as follows:
Also tests the exactness of the integration of the polynomial up to given order. Suppose
is the order of quadrature point, then we test if the integration of the function
is exact for
and
such that
. The exact integration of function
over reference triangle is
where
We have
so that term for
is not zero. Above formula gives the exact value of integral of
over reference triangle. Approximation by quadrature point is as follows
where
is the total number of quad points,
and
are the
quad weight and point. In this test, we compare
and
and report problem if both do not match.
on
is given by
where
is the order of approximation we are testing.| n | Order of quadrature point approximation |

| void test::testTriElemTime | ( | size_t | n, |
| size_t | N | ||
| ) |
Computes the time needed when quad data for elements are stored and when they are computed as and when needed.
This function allocates dummy elements and test how much time it is required to do computation when the quad data are stored for each element and when the quad data are computed.
| n | Order of quadrature point approximation |
| N | Number of elements on which this test is performed |