ply_sampling_var_compute_elemdev Subroutine

public subroutine ply_sampling_var_compute_elemdev(var, threshold, min_mean)

This routine computes for each element whether the solution in it is considered to be deviating from the mean above the given threshold or not. The logical result is stored in var%deviates for each element.

The total number of deviating elements is stored in var%nDeviating.

The variation is computed by the sum of the absolute values of all higher modes divided by the first mode. As we are using series of Legendre polynomials this also is a bounding estimation for the maximal (relative) deviation from the mean in this element.

A variation of 0.01 for example would imply that the state in the element is guaranteed to nowhere deviate from the mean by more than 1 percent. However, this is a very rough estimation and the actual maximal deviation from the mean is probably much lower (at least for sufficiently high polynomial degrees).

If the mean is too close to 0, we use epsilon for the normalization instead of the actual mean.

The computation is done for the current data found in var%dat, any previous computations of these flags will be discarded by this routine.


type(ply_sampling_var_type), intent(inout) :: var

Variable data to compute the deviation for.

real(kind=rk), intent(in) :: threshold

Relative threshold to use as decision whether an element has a high deviation or not.

If the absolute value of higher modes sums to a larger value than threshold times the first mode (integral mean), the element is marked as deviating.

real(kind=rk), intent(in) :: min_mean

A minimal mean value to use as comparison (to cut off changes that are too close to 0).

This should be small but has to be larger than 0.

Called by

proc~~ply_sampling_var_compute_elemdev~~CalledByGraph proc~ply_sampling_var_compute_elemdev ply_sampling_var_compute_elemdev proc~ply_sample_adaptive ply_sample_adaptive proc~ply_sample_adaptive->proc~ply_sampling_var_compute_elemdev proc~ply_sample_data ply_sample_data proc~ply_sample_data->proc~ply_sample_adaptive proc~ply_sampled_track_output ply_sampled_track_output proc~ply_sampled_track_output->proc~ply_sample_data program~sdr_harvesting sdr_harvesting program~sdr_harvesting->proc~ply_sampled_track_output



real(kind=rk), private :: variation
real(kind=rk), private :: absmean
integer, private :: iElem
integer, private :: nElems
integer, private :: ndofs