mus_interpolate_tools_module Module

Interpolation scheme tools

For an overview over implemented interpolation methods, see Interpolation methods


Uses

  • module~~mus_interpolate_tools_module~~UsesGraph module~mus_interpolate_tools_module mus_interpolate_tools_module module~tem_construction_module tem_construction_module module~mus_interpolate_tools_module->module~tem_construction_module module~mus_scheme_header_module mus_scheme_header_module module~mus_interpolate_tools_module->module~mus_scheme_header_module module~treelmesh_module treelmesh_module module~mus_interpolate_tools_module->module~treelmesh_module module~mus_scheme_layout_module mus_scheme_layout_module module~mus_interpolate_tools_module->module~mus_scheme_layout_module module~env_module env_module module~mus_interpolate_tools_module->module~env_module module~mus_interpolate_header_module mus_interpolate_header_module module~mus_interpolate_tools_module->module~mus_interpolate_header_module module~tem_matrix_module tem_matrix_module module~mus_interpolate_tools_module->module~tem_matrix_module module~mus_pdf_module mus_pdf_module module~mus_interpolate_tools_module->module~mus_pdf_module module~tem_grow_array_module tem_grow_array_module module~mus_interpolate_tools_module->module~tem_grow_array_module module~tem_geometry_module tem_geometry_module module~mus_interpolate_tools_module->module~tem_geometry_module module~tem_element_module tem_element_module module~mus_interpolate_tools_module->module~tem_element_module module~tem_param_module tem_param_module module~mus_interpolate_tools_module->module~tem_param_module module~mus_scheme_header_module->module~env_module module~aot_table_module aot_table_module module~mus_scheme_header_module->module~aot_table_module module~aotus_module aotus_module module~mus_scheme_header_module->module~aotus_module module~tem_tools_module tem_tools_module module~mus_scheme_header_module->module~tem_tools_module module~tem_logging_module tem_logging_module module~mus_scheme_header_module->module~tem_logging_module module~aot_out_module aot_out_module module~mus_scheme_header_module->module~aot_out_module module~tem_aux_module tem_aux_module module~mus_scheme_header_module->module~tem_aux_module module~mus_scheme_layout_module->module~env_module module~mus_scheme_layout_module->module~tem_grow_array_module module~mus_scheme_layout_module->module~tem_param_module module~tem_comm_env_module tem_comm_env_module module~mus_scheme_layout_module->module~tem_comm_env_module module~mus_scheme_layout_module->module~aot_table_module mpi mpi module~mus_scheme_layout_module->mpi module~tem_stencil_module tem_stencil_module module~mus_scheme_layout_module->module~tem_stencil_module module~mus_scheme_layout_module->module~aotus_module module~mus_moments_type_module mus_moments_type_module module~mus_scheme_layout_module->module~mus_moments_type_module module~mus_scheme_layout_module->module~tem_tools_module module~mus_scheme_layout_module->module~tem_logging_module module~tem_dyn_array_module tem_dyn_array_module module~mus_scheme_layout_module->module~tem_dyn_array_module module~mus_scheme_layout_module->module~aot_out_module module~mus_scheme_layout_module->module~tem_aux_module module~mus_interpolate_header_module->module~tem_construction_module module~mus_interpolate_header_module->module~mus_scheme_layout_module module~mus_interpolate_header_module->module~env_module module~mus_interpolate_header_module->module~tem_matrix_module module~mus_interpolate_header_module->module~tem_param_module module~tem_debug_module tem_debug_module module~mus_interpolate_header_module->module~tem_debug_module module~mus_interpolate_header_module->module~aot_table_module module~mus_interpolate_header_module->module~tem_stencil_module module~mus_interpolate_header_module->module~aotus_module module~mus_directions_module mus_directions_module module~mus_interpolate_header_module->module~mus_directions_module module~tem_time_module tem_time_module module~mus_interpolate_header_module->module~tem_time_module module~mus_dervarpos_module mus_derVarPos_module module~mus_interpolate_header_module->module~mus_dervarpos_module module~tem_varsys_module tem_varSys_module module~mus_interpolate_header_module->module~tem_varsys_module module~mus_interpolate_header_module->module~tem_tools_module module~mus_interpolate_header_module->module~tem_logging_module module~mus_physics_module mus_physics_module module~mus_interpolate_header_module->module~mus_physics_module module~mus_interpolate_header_module->module~aot_out_module module~mus_field_prop_module mus_field_prop_module module~mus_interpolate_header_module->module~mus_field_prop_module module~mus_interpolate_header_module->module~tem_aux_module module~mus_pdf_module->module~tem_construction_module module~mus_pdf_module->module~env_module module~mus_pdf_module->module~tem_debug_module module~mus_pdf_module->module~tem_logging_module

Used by

  • module~~mus_interpolate_tools_module~~UsedByGraph module~mus_interpolate_tools_module mus_interpolate_tools_module module~mus_aux_module mus_aux_module module~mus_aux_module->module~mus_interpolate_tools_module module~mus_interpolate_module mus_interpolate_module module~mus_aux_module->module~mus_interpolate_module module~mus_interpolate_d3q27_module mus_interpolate_d3q27_module module~mus_interpolate_d3q27_module->module~mus_interpolate_tools_module module~mus_interpolate_quadratic_module mus_interpolate_quadratic_module module~mus_interpolate_quadratic_module->module~mus_interpolate_tools_module module~mus_interpolate_d2q9_module mus_interpolate_d2q9_module module~mus_interpolate_d2q9_module->module~mus_interpolate_tools_module module~mus_interpolate_d2q9_module->module~mus_interpolate_quadratic_module module~mus_interpolate_average_module mus_interpolate_average_module module~mus_interpolate_average_module->module~mus_interpolate_tools_module module~mus_hvs_aux_module mus_hvs_aux_module module~mus_hvs_aux_module->module~mus_interpolate_tools_module module~mus_hvs_aux_module->module~mus_interpolate_module module~mus_interpolate_linear_module mus_interpolate_linear_module module~mus_interpolate_linear_module->module~mus_interpolate_tools_module module~mus_control_module mus_control_module module~mus_control_module->module~mus_aux_module module~mus_interpolate_module->module~mus_interpolate_quadratic_module module~mus_interpolate_module->module~mus_interpolate_average_module module~mus_interpolate_module->module~mus_interpolate_linear_module module~mus_program_module mus_program_module module~mus_program_module->module~mus_aux_module module~mus_program_module->module~mus_control_module module~mus_dynloadbal_module mus_dynLoadBal_module module~mus_program_module->module~mus_dynloadbal_module module~mus_construction_module mus_construction_module module~mus_program_module->module~mus_construction_module program~mus_harvesting mus_harvesting program~mus_harvesting->module~mus_hvs_aux_module program~mus_harvesting->module~mus_construction_module program~musubi musubi program~musubi->module~mus_aux_module program~musubi->module~mus_control_module program~musubi->module~mus_program_module module~mus_dynloadbal_module->module~mus_interpolate_module module~mus_dynloadbal_module->module~mus_construction_module module~mus_construction_module->module~mus_interpolate_module module~mus_hvs_construction_module mus_hvs_construction_module module~mus_hvs_construction_module->module~mus_construction_module

Contents


Functions

public pure function fillMomBuf(elemList, nElems, state, QQ, nSize, A) result(buf)

Convert PDF of a list of elements to moment, save to buf

Read more…

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: elemList(nElems)
integer, intent(in) :: nElems
real(kind=rk), intent(in) :: state(:)
integer, intent(in) :: QQ
integer, intent(in) :: nSize
real(kind=rk), intent(in) :: A(QQ,QQ)

Return Value real(kind=rk)(QQ,nElems)

public pure function get_fNeqFac_f2c(omegaF, omegaC, sFac) result(fac)

Calculate fNeq scale factor from fine level to(2) coarse level. Such scale make sure continuuity of strain rate and shear stress over levels. To achive equal strain rate, we want: fNeq_c * omega_c / dt_c = fNeq_f * omega_f / dt_f rearrange this, we get: fNeq_c = fNeq_f * ( omega_f / omega_c ) * ( dt_c / dt_f ) dt_c/dt_f is strain rate scale factor (i.e. sFac)

Read more…

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: omegaF

omega on fine and coarse level

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

omega on fine and coarse level

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

strain rate scaling factor that from fine to coarse

Return Value real(kind=rk)

public pure function get_fNeqFac_c2f(omegaC, omegaF, sFac) result(fac)

Calculate fNeq scale factor from coarse level to(2) fine level. Such scale make sure continuuity of strain rate and shear stress over levels. To achive equal strain rate, we want: fNeq_c * omega_c / dt_c = fNeq_f * omega_f / dt_f rearrange this, we get: fNeq_f = fNeq_c * ( omega_c / omega_f ) * ( dt_f / dt_c ) dt_f/dt_c is strain rate from coarse to fine scale factor (i.e. sFac)

Read more…

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: omegaC

omega on fine and coarse level

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

omega on fine and coarse level

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

strain rate scaling factor that from fine to coarse

Return Value real(kind=rk)

public pure function mus_intp_getMoments(state, elem, QQ, nScalars, nSize, toMoments) result(moments)

This function returns macroscopic moments from state

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: state(:)

State vector

integer, intent(in) :: elem

element position in state array

integer, intent(in) :: QQ

number of direction in stencil

integer, intent(in) :: nScalars

number of scalars in state vector

integer, intent(in) :: nSize

Size of state vector

type(tem_matrix_type), intent(in) :: toMoments

Moments transformation matrix

Return Value real(kind=rk)(QQ)

moments

public pure function mus_intp_scaleMoments3D(momIn, pFac, vFac, nEqFac) result(momOut)

This function scales interpolated moments like density, momentum and shear stress to target level for 3D compressible model

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: momIn(10)

Interpolated moments, dens, m_1, m_2, m_3, SS_XX, SS_YY, S_ZZ, SS_XY, SS_YZ, SS_ZX

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

Scaling factor for Pressure

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

Scaling factor for velocity

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

Scaling factor for nonEq Shear stress momIn

Return Value real(kind=rk)(10)

Scaled moments, dens, m_1, m_2, m_3, SS_XX, SS_YY, S_ZZ, SS_XY, SS_YZ, SS_ZX

public pure function mus_intp_scaleMoments3D_incomp(momIn, pFac, vFac, nEqFac) result(momOut)

This function scales interpolated moments like density, velocity and shear stress to target level for 3D incompressible model

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: momIn(10)

Interpolated moments, dens, m_1, m_2, m_3, SS_XX, SS_YY, S_ZZ, SS_XY, SS_YZ, SS_ZX

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

Scaling factor for Pressure

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

Scaling factor for velocity

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

Scaling factor for nonEq Shear stress moments

Return Value real(kind=rk)(10)

Scaled moments, dens, m_1, m_2, m_3, SS_XX, SS_YY, S_ZZ, SS_XY, SS_YZ, SS_ZX

public pure function mus_intp_scaleMoments2D(momIn, pFac, vFac, nEqFac) result(momOut)

This function scales interpolated moments like density, momentum and shear stress to target level for 2D compressible model

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: momIn(6)

Interpolated moments, dens, m_1, m_2, SS_XX, SS_YY, SS_XY

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

Scaling factor for Pressure

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

Scaling factor for velocity

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

Scaling factor for nonEq Shear stress moments

Return Value real(kind=rk)(6)

Scaled moments, dens, m_1, m_2, SS_XX, SS_YY, SS_XY

public pure function mus_intp_scaleMoments2D_incomp(momIn, pFac, vFac, nEqFac) result(momOut)

This function scales interpolated moments like density, velocity and shear stress to target level for 2D incompressible model

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: momIn(6)

Interpolated momentsents, dens, m_1, m_2, SS_XX, SS_YY, SS_XY

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

Scaling factor for Pressure

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

Scaling factor for velocity

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

Scaling factor for nonEq Shear stress momentsents

Return Value real(kind=rk)(6)

Scaled moments, dens, m_1, m_2, SS_XX, SS_YY, SS_XY

public pure function mus_intp_convertMomToPDF3D(moments, nonEqScalingFacs, layout) result(PDF)

This function computes converts moments to pdf by computing equilibrium from dens and vel and use it to compute higher moments and transform moments to PDF

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: moments(layout%fStencil%QQ)

All moments

real(kind=rk), intent(in) :: nonEqScalingFacs(layout%fStencil%QQ)

nonEquilibrium scaling factor

type(mus_scheme_layout_type), intent(in) :: layout

Scheme layout

Return Value real(kind=rk)(layout%fStencil%QQ)

output pdf

public pure function mus_intp_convertMomToPDF3D_incomp(moments, nonEqScalingFacs, layout) result(PDF)

This function computes converts moments to pdf by computing equilibrium from dens and vel and use it to compute higher moments and transform moments to PDF

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: moments(layout%fStencil%QQ)

all moments

real(kind=rk), intent(in) :: nonEqScalingFacs(layout%fStencil%QQ)

nonEquilibrium scaling factor

type(mus_scheme_layout_type), intent(in) :: layout

Scheme layout

Return Value real(kind=rk)(layout%fStencil%QQ)

output pdf

public pure function mus_intp_eq_d2q9_a(u_x, u_y, rho, rho0) result(fEq)

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: u_x
real(kind=rk), intent(in) :: u_y
real(kind=rk), intent(in) :: rho
real(kind=rk), intent(in) :: rho0

Return Value real(kind=rk)(9)

public pure function mus_intp_convertMomToPDF2D(moments, nonEqScalingFacs, layout) result(PDF)

This function computes converts moments to pdf by computing equilibrium from dens and vel and use it to compute higher moments and transform moments to PDF

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: moments(layout%fStencil%QQ)

All moments

real(kind=rk), intent(in) :: nonEqScalingFacs(layout%fStencil%QQ)

nonEquilibrium scaling factor

type(mus_scheme_layout_type), intent(in) :: layout

Scheme layout

Return Value real(kind=rk)(layout%fStencil%QQ)

output pdf

public pure function mus_intp_convertMomToPDF2D_incomp(moments, nonEqScalingFacs, layout) result(PDF)

This function computes converts moments to pdf by computing equilibrium from dens and vel and use it to compute higher moments and transform moments to PDF

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: moments(layout%fStencil%QQ)

All moments

real(kind=rk), intent(in) :: nonEqScalingFacs(layout%fStencil%QQ)

nonEquilibrium scaling factor

type(mus_scheme_layout_type), intent(in) :: layout

Scheme layout

Return Value real(kind=rk)(layout%fStencil%QQ)

output pdf


Subroutines

public subroutine debug_dependencies(intp, levelDesc, tree, rank)

check the dependencies from Finer

Arguments

TypeIntentOptionalAttributesName
type(mus_interpolation_type), intent(in) :: intp

interpolation method info

type(tem_levelDesc_type), intent(in) :: levelDesc(:)

state properties

type(treelmesh_type), intent(in) :: tree

global tree information

integer, intent(in) :: rank

musubi mpi communicator environment

public subroutine dump_intpLists(minLevel, maxLevel, order, levelDesc, rank)

check the dependencies from Finer

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: minLevel

global pdf information

integer, intent(in) :: maxLevel

global pdf information

integer, intent(in) :: order
type(tem_levelDesc_type), intent(in) :: levelDesc(minLevel:maxLevel)

state properties

integer, intent(in) :: rank

musubi mpi communicator environment

public subroutine mus_intp_getSrcMoments(momBuf, state, nSourceElems, srcElemList, QQ, nScalars, nSize, momTransMat, nMoms)

This routine computes moments for all sources elements in momBuf which can be accessed using depFromCoarser(iElem)%elemBuffer. In FillFiner, fine elements can have same sources so to avoid calculating moments for same source elements multiple times, momBuf is used.

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(out) :: momBuf(:,:)

Source moments

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

State vector of source elemnents

integer, intent(in) :: nSourceElems

Total number of source elements

integer, intent(in) :: srcElemList(1:nSourceElems)

element position in source state array

integer, intent(in) :: QQ

number of direction in stencil

integer, intent(in) :: nScalars

number of scalars in state vector

integer, intent(in) :: nSize

Size of state vector

type(tem_matrix_type), intent(in) :: momTransMat

Moments transformation matrix

integer, intent(in) :: nMoms

Number of moments to return

private subroutine dump_intpList(eType, levelDesc, ind, nUnit)

check the dependencies from Finer and write them out so we can compare

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: eType
type(tem_levelDesc_type), intent(in) :: levelDesc

state properties

type(grw_intarray_type), intent(in) :: ind

indirectio list

integer, intent(in) :: nUnit

private subroutine dump_MyGhostsFromFiner(intp, leveldesc, nUnit, tree)

check the dependencies from Finer and write them out so we can compare

Arguments

TypeIntentOptionalAttributesName
type(mus_interpolation_type), intent(in) :: intp

interpolation method info

type(tem_levelDesc_type), intent(in) :: leveldesc(:)

state properties

integer, intent(in) :: nUnit

unit to write to

type(treelmesh_type), intent(in) :: tree

global tree information

private subroutine dump_FinerGhostsFromMe(intp, levelDesc, nUnit, tree)

check the dependencies from Coarser

Arguments

TypeIntentOptionalAttributesName
type(mus_interpolation_type), intent(in) :: intp

interpolation method info

type(tem_levelDesc_type), intent(in) :: levelDesc(:)

state properties

integer, intent(in) :: nUnit

unit to write to

type(treelmesh_type), intent(in) :: tree

global tree information

private subroutine dump_FinerGhostsFromMeBuffer(intp, leveldesc, nUnit, tree)

check the dependencies from Coarser

Arguments

TypeIntentOptionalAttributesName
type(mus_interpolation_type), intent(in) :: intp

interpolation method info

type(tem_levelDesc_type), intent(in) :: leveldesc(:)

state properties

integer, intent(in) :: nUnit

unit to write to

type(treelmesh_type), intent(in) :: tree

global tree information

private subroutine dump_elemDep(targetElem, sourceElem, nUnit, tree, weight)

dump dependencies for one element

Arguments

TypeIntentOptionalAttributesName
integer(kind=long_k), intent(in) :: targetElem
integer(kind=long_k), intent(in) :: sourceElem
integer, intent(in) :: nUnit
type(treelmesh_type), intent(in) :: tree
real(kind=rk), optional :: weight