Neko 0.9.99
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
spectral_error Module Reference

Implements type spectral_error_t.

Data Types

type  spectral_error_t
 Provides tools to calculate the spectral error indicator. More...
 

Functions/Subroutines

subroutine spectral_error_init (this, json, case)
 Constructor.
 
subroutine spectral_error_init_from_attributes (this, coef)
 Actual constructor.
 
subroutine spectral_error_free (this)
 Destructor.
 
subroutine spectral_error_compute (this, t, tstep)
 Compute the spectral error indicator.
 
subroutine transform_to_spec_or_phys (u_hat, u, wk, coef, space)
 Transform a field u to u_hat into physical or spectral space the result of the transformation is in u_hat.
 
subroutine spectral_error_get_indicators (this, coef)
 Transform and get the spectral error indicators.
 
subroutine spectral_error_write (this, t)
 Write error indicators in a field file.
 
subroutine calculate_indicators (this, coef, eind, sig, lnelt, lx1, ly1, lz1, var)
 Wrapper for old fortran 77 subroutines.
 
subroutine speri_var (this, est, sig, var, nell, xa, xb, lx1, ly1, lz1)
 Calculate the indicator in a specified variable.
 
subroutine speri_extrap (this, estx, sigx, coef11, coef, ix_st, ix_en, nyl, nzl)
 Extrapolate the Legendre spectrum from the last points.
 

Function/Subroutine Documentation

◆ calculate_indicators()

subroutine spectral_error::calculate_indicators ( type(spectral_error_t), intent(inout this,
type(coef_t), intent(in coef,
real(kind=rp), dimension(lnelt eind,
real(kind=rp), dimension(lnelt sig,
integer  lnelt,
integer  lx1,
integer  ly1,
integer  lz1,
real(kind=rp), dimension(lx1,ly1,lz1,lnelt var 
)
private
Parameters
coefcoef type
eindspectral indicator
sigcoefficient of the exponential fit
lneltnumber of elements
LX1gll points in x
LY1gll points in y
LZ1gll points in z @paran var variable to calculate indicator

Definition at line 366 of file spectral_error.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spectral_error_compute()

subroutine spectral_error::spectral_error_compute ( class(spectral_error_t), intent(inout this,
real(kind=rp), intent(in t,
integer, intent(in tstep 
)
private

Copy the element indicator into all points of the field

Definition at line 229 of file spectral_error.f90.

◆ spectral_error_free()

subroutine spectral_error::spectral_error_free ( class(spectral_error_t), intent(inout this)
private

Definition at line 187 of file spectral_error.f90.

◆ spectral_error_get_indicators()

subroutine spectral_error::spectral_error_get_indicators ( class(spectral_error_t), intent(inout this,
type(coef_t), intent(inout coef 
)
private
Parameters
coeftype coef for mesh parameters and space

Definition at line 318 of file spectral_error.f90.

Here is the call graph for this function:

◆ spectral_error_init()

subroutine spectral_error::spectral_error_init ( class(spectral_error_t), intent(inout this,
type(json_file), intent(inout json,
class(case_t), intent(inout), target  case 
)

Add keyword "fields" to the json so that the field writer

Definition at line 114 of file spectral_error.f90.

Here is the call graph for this function:

◆ spectral_error_init_from_attributes()

subroutine spectral_error::spectral_error_init_from_attributes ( class(spectral_error_t), intent(inout this,
type(coef_t), intent(in coef 
)
private
Parameters
coeftype with all geometrical variables.

Initialize fields and copy data from proper one

Allocate arrays (Consider moving some to coef)

The following code has been lifted from Adam's implementation

Definition at line 137 of file spectral_error.f90.

Here is the caller graph for this function:

◆ spectral_error_write()

subroutine spectral_error::spectral_error_write ( class(spectral_error_t), intent(inout this,
real(kind=rp), intent(in t 
)
private
Parameters
tCurrent simulation time.

Write the file Remember that the list is already ponting to the fields that were just modified.

Definition at line 343 of file spectral_error.f90.

◆ speri_extrap()

subroutine spectral_error::speri_extrap ( type(spectral_error_t), intent(inout this,
real(kind=rp)  estx,
real(kind=rp)  sigx,
real(kind=rp)  coef11,
real(kind=rp), dimension(this%seri_np_max,nyl,nzl coef,
integer  ix_st,
integer  ix_en,
integer  nyl,
integer  nzl 
)
private
Parameters
estxspectral indicator
sigxcoefficient of the exponential fit
coef11legendre coefficients @paran coef legendre coefficients @paran ix_st argument list @paran ix_en argument list
nylargument list
nzlargument list
ix_stargument list
ix_enargument list
nylargument list
nzlargument list
coefLegendre coefficients; last SERI_NP columns
coef11Legendre coefficients; first value coeff(1,1,1)
estxestimated error and decay rate
sigxestimated error and decay rate

local variables

Definition at line 523 of file spectral_error.f90.

Here is the caller graph for this function:

◆ speri_var()

subroutine spectral_error::speri_var ( type(spectral_error_t), intent(inout this,
real(kind=rp), dimension(nell est,
real(kind=rp), dimension(nell sig,
real(kind=rp), dimension(lx1,ly1,lz1,nell var,
integer  nell,
real(kind=rp), dimension(lx1,ly1,lz1 xa,
real(kind=rp), dimension(lx1,ly1,lz1 xb,
integer  lx1,
integer  ly1,
integer  lz1 
)
private
Parameters
estspectral indicator
sigcoefficient of the exponential fit
nellnumber of elements @paran var variable to calculate indicator @paran xa work array @paran xb work array
LX1gll points in x
LY1gll points in y
LZ1gll points in z

local variables

polynomial coefficients

Legendre coefficients; first value coeff(1,1,1)

copy of last SERI_NP columns of coefficients

estimated error

estimated decay rate

loop over elements

go to Legendre space (done in two operations) and square the coefficient

lower left corner

small value; nothing to od

extrapolate coefficients X - direction copy last SERI_NP collumns (or less if NX1 is smaller) SERI_ELR allows to exclude last row

get extrapolated values

Y - direction copy last SERI_NP collumns (or less if NY1 is smaller) SERI_ELR allows to exclude last row

get extrapolated values

Z - direction copy last SERI_NP collumns (or less if NZ1 is smaller) SERI_ELR allows to exclude last row

get extrapolated values

average

for testing

for testing; end

Definition at line 401 of file spectral_error.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transform_to_spec_or_phys()

subroutine spectral_error::transform_to_spec_or_phys ( type(field_t), intent(inout u_hat,
type(field_t), intent(inout u,
type(field_t), intent(inout wk,
type(coef_t), intent(inout coef,
character(len=4), intent(in space 
)
private
Parameters
u_hatTransformed field (output).
uField to transform (input).
wkWorking field.
coefType coef for mesh parameters.
spaceString that indicates which space to transform, "spec" or "phys".

Define some constants

Copy field to working array

Definition at line 274 of file spectral_error.f90.

Here is the caller graph for this function: