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. |
||
integer, | intent(in) | :: | outLen(nDims) |
Number degrees of freedom for each direction in child_Data. |
||
real(kind=rk), | intent(in) | :: | parent_data(:,:) |
Polynomial representation in the parent elements. |
||
real(kind=rk), | intent(out) | :: | child_data(:,:) |
Computed projection of the polynomial representation in the child elements. |
||
logical, | intent(in) | :: | ignore |
Whether to ignore high modes that exceed the target maximal polynomial degree. |
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. |
||
logical, | intent(in), | optional | :: | ignore_highmodes |
Whether to ignore high modes from the parent element. |
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. |
||
logical, | intent(in), | optional | :: | ignore_highmodes |
Whether to ignore high modes from the parent element. |
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. |
||
logical, | intent(in), | optional | :: | ignore_highmodes |
Whether to ignore high modes from the parent element. |
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. |