This module provides the methods to project the polynomial representation in elements onto the representations in their halves in each dimension.
To perform the projection for Legendre polynomials we will use the computed coefficients for the Clenshaw algorithm from ply_split_legendre_module. With those the transformation is just a simple triangular matrix multiplication, but we need to take care of the orthogonal degrees of freedom as we want to handle all of them at the same time. Further we want to allow the transformation to be performed for multiple elements at once.
In each dimension we need to perform the following coordinate transformation:
Where refers to the coordinate in the original (coarse) element, and to the coordinates in the two (left and right) halves of the element.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=rk), | private, | allocatable | :: | split_legendre(:,:) | Precomputed matrix to hold the transformation operation to project Legendre polynomials to its two half intervals. This is computed by ply_split_legendre_matrix, see there for details. There are two triangular matrices stored in this array, one for the projection to the left half (-1,0) , and one for the projection to the right half (0,1). This is a module variable, as it is only needed to be computed once with sufficient size. All lower orders are just subarrays out of the larger one. |
Split elements of degree parent_degree into elements with polynomials of degree child_degree.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | parent_degree | Polynomial degree in the parent element. |
||
integer, | intent(in) | :: | child_degree | Polynomial degree in the child elements. |
||
real(kind=rk), | intent(in) | :: | parent_data(:,:) | Polynomial data in the parent element. The first index describes the degrees of freedom. The second index refers to the elements to split. |
||
real(kind=rk), | intent(out) | :: | child_data(:,:) | Polynomial data in the child elements. The first index describes the degrees of freedom. The second index refers to the elements, there needs to be four times as many elements than in the parent_data. Elements follow the ordering of the Z space filling curve. |
||
logical, | intent(in), | optional | :: | ignore_highmodes | Whether to ignore high modes from the parent element. This can be used as a simple lowpass filter by ignoring all higher modes from the parent element, that exceed the target polynomial degree. Thus, the polynomials are filtered before projection, instead of cutting them only of after refinement. Defaults to false (no filtering). |
Initialization of the module. This needs to be performed before any call of the actual transformation ply_split_element_1D.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nMaxModes | Maximal number of expected modes to perform the splitting for. |
Project a polynomial representation in elements in one dimension to its two halves in that direction.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nDims | Number of dimensions of the polynomial data. |
||
integer, | intent(in) | :: | inLen(nDims) | Number degrees of freedom for each direction in parent_Data. The first index of parent_data needs to have a length equal to the product of all inLen components. The splitting operation will be done in the last dimension. |
||
integer, | intent(in) | :: | outLen(nDims) | Number degrees of freedom for each direction in child_Data. The first index of child_data needs to have a length equal to the product of all outLen components. The data will be cyclicly exchanged. Thus, the last dimension in parent_data corresponds to the first in one in child_data and all other components are shifted once to the right. |
||
real(kind=rk), | intent(in) | :: | parent_data(:,:) | Polynomial representation in the parent elements. The first index are the degrees of freedom in elements, the second index are the elements. In the first index the shape of data has to be in the form (inLen(1), inLen(2), ... , inLen(nDims)). The splitting operation is performed on the last dimension in that data. |
||
real(kind=rk), | intent(out) | :: | child_data(:,:) | Computed projection of the polynomial representation in the child elements. Again, the first index refers to the degrees of freedom, while the second index are the elements. There need to be twice as many elements as in the parent_data. Left childs are stored in iChild = (iParent2 - 1), and the right childs in iParent2. In the first index the shape of the data has to be in the form (outLen(1), outLen(2), ... , outLen(nDims)), the data is rotated in comparison to parent_data and the splitted direction has to be the first one in child_data (while it was the last in parent_data), and all other dimensions are shifted by one to the right. |
||
logical, | intent(in) | :: | ignore | Whether to ignore high modes that exceed the target maximal polynomial degree. This can be used as a simple lowpass filter that cuts off the highest modes in the parent elements prior to mapping to child elements. |
Split one-dimensional elements of degree parent_degree into two elements with polynomials of degree child_degree.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | parent_degree | Polynomial degree in the parent element. |
||
integer, | intent(in) | :: | child_degree | Polynomial degree in the child elements. |
||
real(kind=rk), | intent(in) | :: | parent_data(:,:) | Polynomial data in the parent element. The first index describes the degrees of freedom. The second index refers to the elements to split. |
||
real(kind=rk), | intent(out) | :: | child_data(:,:) | Polynomial data in the child elements. The first index describes the degrees of freedom. The second index refers to the elements, there needs to be four times as many elements than in the parent_data. Elements follow the ordering of the Z space filling curve. |
||
logical, | intent(in), | optional | :: | ignore_highmodes | Whether to ignore high modes from the parent element. This can be used as a simple lowpass filter by ignoring all higher modes from the parent element, that exceed the target polynomial degree. Thus, the polynomials are filtered before projection, instead of cutting them only of after refinement. Defaults to false (no filtering). |
Split two-dimensional elements of degree parent_degree into four elements with polynomials of degree child_degree.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | parent_degree | Polynomial degree in the parent element. |
||
integer, | intent(in) | :: | child_degree | Polynomial degree in the child elements. |
||
real(kind=rk), | intent(in) | :: | parent_data(:,:) | Polynomial data in the parent element. The first index describes the degrees of freedom. The second index refers to the elements to split. |
||
real(kind=rk), | intent(out) | :: | child_data(:,:) | Polynomial data in the child elements. The first index describes the degrees of freedom. The second index refers to the elements, there needs to be four times as many elements than in the parent_data. Elements follow the ordering of the Z space filling curve. |
||
logical, | intent(in), | optional | :: | ignore_highmodes | Whether to ignore high modes from the parent element. This can be used as a simple lowpass filter by ignoring all higher modes from the parent element, that exceed the target polynomial degree. Thus, the polynomials are filtered before projection, instead of cutting them only of after refinement. Defaults to false (no filtering). |
Split three-dimensional elements of degree parent_degree into eight elements with polynomials of degree child_degree.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | parent_degree | Polynomial degree in the parent element. |
||
integer, | intent(in) | :: | child_degree | Polynomial degree in the child elements. |
||
real(kind=rk), | intent(in) | :: | parent_data(:,:) | Polynomial data in the parent element. The first index describes the degrees of freedom. The second index refers to the elements to split. |
||
real(kind=rk), | intent(out) | :: | child_data(:,:) | Polynomial data in the child elements. The first index describes the degrees of freedom. The second index refers to the elements, there needs to be four times as many elements than in the parent_data. Elements follow the ordering of the Z space filling curve. |
||
logical, | intent(in), | optional | :: | ignore_highmodes | Whether to ignore high modes from the parent element. This can be used as a simple lowpass filter by ignoring all higher modes from the parent element, that exceed the target polynomial degree. Thus, the polynomials are filtered before projection, instead of cutting them only of after refinement. Defaults to false (no filtering). |
Testing routine for the functions of this module.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(out) | :: | success | Indication whether the tests were completed successfully. |
Testing the 1D splitting.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nModes | Number of modes in the (1D) polynomials to use in the check. |
||
logical, | intent(out) | :: | success | Indication whether the tests were completed successfully. |
Testing the 2D splitting.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nModes | Number of modes in the (1D) polynomials to use in the check. |
||
logical, | intent(out) | :: | success | Indication whether the tests were completed successfully. |
Testing the 3D splitting.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nModes | Number of modes in the (1D) polynomials to use in the check. |
||
logical, | intent(out) | :: | success | Indication whether the tests were completed successfully. |