Module used by kernel and components to assure communication between them
This module should be used (include) by the components at the initiation phase to:
This module should be used (include) by kernel to:
Sequence of execution in 2 stages of initialisation:
Translation array 0d, 1d or 2d of doubles to array of pointers
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in), | target | :: | arr |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in), | target | :: | arr(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in), | target | :: | arr(:,:) |
encapsulate pointer in order to create array of pointers
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=dp), | public, | pointer | :: | p |
pointer to double |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | len | :: | nnz |
number of non-zeros (major size of the type) |
||
| integer, | public | :: | idx | = | 1 |
tracing last filled index of global array |
|
| integer, | public | :: | coo_col(nnz) |
column idx of non zero array in coo |
|||
| integer, | public | :: | coo_row(nnz) |
row idx of non zero array in coo |
|||
| type(dbl_pointer_t), | public | :: | coo_ptr(nnz) |
non zero length array of pointers to physical value in coo |
|||
| integer, | public, | pointer | :: | csr_col(:) |
for pardiso final column idx of non zero array in csr |
||
| integer, | public, | pointer | :: | csr_row(:) |
for pardiso final row idx of non zero array in csr |
||
| type(dbl_pointer_t), | public, | pointer | :: | csr_ptr(:) |
for pardiso final non zero length array of pointers to physical value in csr |
||
| real(kind=dp), | public | :: | csr_val(nnz) |
non zero value array for pardiso |
|||
| type(mkl_pardiso_handle), | public | :: | pt(64) |
internal pointers of pardiso |
|||
| integer, | public | :: | iparm(64) | = | 0 |
parameters for pardiso |
|
| integer, | public | :: | perm(nnz) |
non zero size after analysis for pardiso |
|||
| logical, | public | :: | analysed | = | .false. |
is pardiso analysed? |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | loc |
top left location of port matrix |
|||
| logical, | public | :: | can_be_shared | = | .false. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | idx | = | 1 |
Tracking new entries |
|
| integer, | public, | allocatable | :: | nb(:) |
Number of ports per component |
||
| character(len=:), | public, | allocatable | :: | list |
contains entries like this: |
| procedure, public :: add => port_list_add | Used by State components exposing ports here |
| procedure, public :: update => port_list_update | Used by krn_update to calculate offsets etc... |
| procedure, public :: find => port_list_find | Finding index of the port in the ports list by links components |
| procedure, public :: find_nbPorts => port_list_find_nbPorts | Finding number of ports for a given label in the ports list by links components |
Structure which will be used to size matrices like: coo,csr and ports
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | idx | = | 1 | ||
| integer, | public, | allocatable | :: | nb_state_vars(:) | |||
| integer, | public, | allocatable | :: | nb_non_zeros_exp(:) | |||
| integer, | public, | allocatable | :: | nb_non_zeros_imp(:) | |||
| type(port_list_t), | public | :: | FF_flux_list | ||||
| type(port_list_t), | public | :: | FF_src_list | ||||
| type(port_list_t), | public | :: | FS_list | ||||
| type(port_list_t), | public | :: | SS_flux_list | ||||
| type(port_list_t), | public | :: | SS_src_list | ||||
| character(len=:), | public, | allocatable | :: | PortIdxForFSLink_List | |||
| type(coo_csr_t(:)), | public, | allocatable | :: | imp |
Implicit matrices in both format coo and csr |
||
| type(coo_csr_t(:)), | public, | allocatable | :: | exp |
Explicit matrices in both format coo and csr |
||
| real(kind=dp), | public, | allocatable | :: | rhs_or_solution(:) |
Right hand side of linear equation or it's solution |
||
| real(kind=dp), | public, | allocatable | :: | solution(:) |
solution vector of the linear system |
||
| type(FF_flux_port_t), | public, | allocatable | :: | FF_flux_ports(:) |
Fluid/Fluid port array --> flux |
||
| type(FF_src_port_t), | public, | allocatable | :: | FF_src_ports(:) |
Fluid/Fluid port array --> source |
||
| type(FS_port_t), | public, | allocatable | :: | FS_ports(:) |
Fluid/Solid port array |
||
| type(SS_flux_port_t), | public, | allocatable | :: | SS_flux_ports(:) |
Solid/Solid port array --> flux |
||
| type(SS_src_port_t), | public, | allocatable | :: | SS_src_ports(:) |
Solid/Solid port array --> source |
| procedure, public :: init_part1 => krn_init_part1 | Allocating kernel arrays with number components |
| procedure, public :: add => krn_add | Used by all components add their array and port requirements |
| procedure, public :: add_label => krn_add_label | Add label of 2d mesh to expose ports |
| procedure, public :: init_part2 => krn_init_part2 | Allocating full matrices |
| procedure, public :: update => krn_update | Used by state owners to set ports locations and get back link to them |
| procedure, public :: coo_add => krn_coo_add | Used by state owners to add coordinate format array to the full array |
| procedure, public :: coo_add_link => krn_coo_add_link | Used by links to add coordinate format array to the full array |
| procedure, public :: coo_to_csr => krn_coo_to_csr | Conversion full coordinate format array to sparse compressed row array |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | loc |
top left location of port matrix |
|||
| logical, | public | :: | can_be_shared | = | .false. | ||
| real(kind=dp), | public | :: | Prim(Nb_VarP) |
Channel->link, primitive variables |
|||
| real(kind=dp), | public | :: | Cons(Nb_VarC) |
Channel->link, conservative variables |
|||
| real(kind=dp), | public | :: | Su_fric |
Channel->link, friction source term |
|||
| real(kind=dp), | public | :: | DerSu_fric(Nb_VarC) |
Channel->link, derivatives of friction source term |
|||
| real(kind=dp), | public | :: | Sr_fric |
Channel->link, friction source term (4th eq) |
|||
| real(kind=dp), | public | :: | DerSr_fric(Nb_VarC) |
Channel->link, derivatives of friction source term (4th eq) |
|||
| real(kind=dp), | public | :: | Area |
Channel->link, cross-section area of the pipe |
|||
| real(kind=dp), | public | :: | dxLoc |
Channel->link, space step of the cell close to the boundary |
|||
| real(kind=dp), | public | :: | Sgn4j |
Channel->link, sign used by junctions to identify incoming branches |
|||
| real(kind=dp), | public | :: | flx(Nb_VarC) |
Link->channel, flux calculated by link |
|||
| real(kind=dp), | public | :: | vit |
Link->channel, fluid velocity |
|||
| real(kind=dp), | public | :: | derFlx_derCon(Nb_VarC,Nb_VarC) |
Link->channel, partial derivative of flux calculated by link |
|||
| real(kind=dp), | public | :: | derVit_derCon(Nb_VarC) |
Link->channel, derivative of velocity for every variable |
|||
| logical, | public | :: | connected |
Link connected to a port or not |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | loc |
top left location of port matrix |
|||
| logical, | public | :: | can_be_shared | = | .false. | ||
| real(kind=dp), | public | :: | Pra | ||||
| real(kind=dp), | public | :: | Re | ||||
| real(kind=dp), | public | :: | Phi | ||||
| real(kind=dp), | public | :: | llambda | ||||
| real(kind=dp), | public | :: | TempP | ||||
| real(kind=dp), | public | :: | AreaP | ||||
| real(kind=dp), | public | :: | DiamP | ||||
| real(kind=dp), | public | :: | dPrdUi(Nb_VarC) | ||||
| real(kind=dp), | public | :: | dRedUi(Nb_VarC) | ||||
| real(kind=dp), | public | :: | DerPhi(Nb_VarC) | ||||
| real(kind=dp), | public | :: | DerllambdadUi(Nb_VarC) | ||||
| real(kind=dp), | public | :: | DerTempPdUi(Nb_VarC) | ||||
| real(kind=dp), | public | :: | rhs_Se | ||||
| real(kind=dp), | public | :: | rhs_Sr | ||||
| real(kind=dp), | public | :: | DerSe(Nb_VarC) | ||||
| real(kind=dp), | public | :: | DerSr(Nb_VarC) | ||||
| real(kind=dp), | public | :: | Prim(Nb_VarP) | ||||
| real(kind=dp), | public | :: | Cons(Nb_VarC) |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(FF_src_port_t), | public, | pointer | :: | p |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | loc |
top left location of port matrix |
|||
| logical, | public | :: | can_be_shared | = | .false. | ||
| character(len=6), | public | :: | typeS | ||||
| real(kind=dp), | public | :: | Pra | ||||
| real(kind=dp), | public | :: | Re | ||||
| real(kind=dp), | public | :: | Phi | ||||
| real(kind=dp), | public | :: | llambda | ||||
| real(kind=dp), | public | :: | TempP | ||||
| real(kind=dp), | public | :: | AreaP | ||||
| real(kind=dp), | public | :: | DiamP | ||||
| real(kind=dp), | public | :: | dxLoc | ||||
| real(kind=dp), | public | :: | dPrdUi(Nb_VarC) | ||||
| real(kind=dp), | public | :: | dRedUi(Nb_VarC) | ||||
| real(kind=dp), | public | :: | DerPhi(Nb_VarC) | ||||
| real(kind=dp), | public | :: | DerllambdadUi(Nb_VarC) | ||||
| real(kind=dp), | public | :: | DerTempPdUi(Nb_VarC) | ||||
| real(kind=dp), | public | :: | TempS | ||||
| real(kind=dp), | public | :: | AreaS | ||||
| real(kind=dp), | public | :: | rhoMS | ||||
| real(kind=dp), | public | :: | cpMS | ||||
| real(kind=dp), | public | :: | dcpMSdT | ||||
| real(kind=dp), | public | :: | Dist4Grad | ||||
| real(kind=dp), | public | :: | VolMS | ||||
| real(kind=dp), | public | :: | lambdS | ||||
| real(kind=dp), | public | :: | DerlambdS | ||||
| real(kind=dp), | public | :: | LengthCont | ||||
| real(kind=dp), | public | :: | cpS | ||||
| real(kind=dp), | public | :: | dcpSdT | ||||
| real(kind=dp), | public | :: | rhoS | ||||
| real(kind=dp), | public | :: | SurfS | ||||
| real(kind=dp), | public | :: | rhs_SrcP_Se | ||||
| real(kind=dp), | public | :: | rhs_SrcP_Sr | ||||
| real(kind=dp), | public | :: | rhs_SrcS | ||||
| real(kind=dp), | public | :: | DerSrcSdT | ||||
| real(kind=dp), | public | :: | DerSrcP_Se(Nb_VarC) | ||||
| real(kind=dp), | public | :: | DerSrcP_Sr(Nb_VarC) | ||||
| real(kind=dp), | public | :: | Flx | ||||
| real(kind=dp), | public | :: | derFlx_derCon |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(FS_port_t), | public, | pointer | :: | p |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | loc |
top left location of port matrix |
|||
| logical, | public | :: | can_be_shared | = | .false. | ||
| real(kind=dp), | public | :: | TempS | ||||
| real(kind=dp), | public | :: | lambdS | ||||
| real(kind=dp), | public | :: | DerlambdS | ||||
| real(kind=dp), | public | :: | AreaS | ||||
| real(kind=dp), | public | :: | Sgn4lk | ||||
| real(kind=dp), | public | :: | dxLoc | ||||
| real(kind=dp), | public | :: | rhoMS | ||||
| real(kind=dp), | public | :: | cpMs | ||||
| real(kind=dp), | public | :: | Flx | ||||
| real(kind=dp), | public | :: | derFlx_derCon |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(SS_flux_port_t), | public, | pointer | :: | p |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | loc |
top left location of port matrix |
|||
| logical, | public | :: | can_be_shared | = | .false. | ||
| character(len=6), | public | :: | typeS | ||||
| real(kind=dp), | public | :: | TempS | ||||
| real(kind=dp), | public | :: | rhoS | ||||
| real(kind=dp), | public | :: | VolS | ||||
| real(kind=dp), | public | :: | Dist4Grad | ||||
| real(kind=dp), | public | :: | LengthCont | ||||
| real(kind=dp), | public | :: | Height | ||||
| real(kind=dp), | public | :: | SurfS | ||||
| real(kind=dp), | public | :: | cpS | ||||
| real(kind=dp), | public | :: | dcpSdT | ||||
| real(kind=dp), | public | :: | lambdS | ||||
| real(kind=dp), | public | :: | DerlambdS | ||||
| real(kind=dp), | public | :: | rhs_SrcS | ||||
| real(kind=dp), | public | :: | DerSrcSdT | ||||
| real(kind=dp), | public | :: | Flx | ||||
| real(kind=dp), | public | :: | derFlx_derCon |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(SS_src_port_t), | public, | pointer | :: | p |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(port_list_t), | intent(inout) | :: | me | |||
| integer, | intent(in) | :: | idx | |||
| integer, | intent(in) | :: | loc(:) | |||
| integer, | intent(in) | :: | start_state_idx | |||
| class(port_t), | intent(in), | target | :: | ports_array(:) |
which will have updated loc (should be inout?) |
Returned view on the ports array with updated values of: loc
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(port_list_t), | intent(in), | target | :: | me | ||
| character(len=*), | intent(in) | :: | name |
Name of the component |
||
| integer, | intent(in) | :: | idx |
Port number |
Index of the port on ports array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(port_list_t), | intent(in), | target | :: | me | ||
| character(len=*), | intent(in) | :: | name |
Name of the component |
Index of the port on ports array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in), | target | :: | arr |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in), | target | :: | arr(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in), | target | :: | arr(:,:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(dbl_pointer_t), | intent(inout) | :: | ptr_arr(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(port_list_t), | intent(inout) | :: | me | |||
| integer, | intent(in) | :: | idx | |||
| character(len=*), | intent(in) | :: | name |
Component (port) name |
||
| integer, | intent(in) | :: | nb_ports |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(krn_t), | intent(inout) | :: | me | |||
| integer, | intent(in) | :: | size |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(krn_t), | intent(inout) | :: | me |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(krn_t), | intent(inout), | target | :: | me | ||
| real(kind=dp), | intent(out), | optional, | pointer | :: | rhs_or_solution_view(:) |
Returns pointer with rhs or solution array |
| integer, | intent(in), | optional | :: | FF_flux_p_loc(:) |
Position (state index) of the FF_flux ports local to the component |
|
| integer, | intent(in), | optional | :: | FS_p_loc(:) |
Position (state index) of the FS ports local to the component |
|
| integer, | intent(in), | optional | :: | FF_src_p_loc(:) |
Position (state index) of the FF_src ports local to the component |
|
| integer, | intent(in), | optional | :: | SS_flux_p_loc(:) |
Position (state index) of the SS_flux ports local to the component |
|
| integer, | intent(in), | optional | :: | SS_src_p_loc(:) |
Position (state index) of the SS_src ports local to the component |
|
| character(len=*), | intent(in), | optional | :: | CompName | ||
| type(FF_flux_port_t), | intent(out), | optional, | pointer | :: | FF_flux_p_view(:) |
Returns pointer with array of FF_flux ports for this component |
| type(FS_port_t), | intent(out), | optional, | pointer | :: | FS_p_view(:) |
Returns pointer with array of FS ports for this component |
| type(FF_src_port_t), | intent(out), | optional, | pointer | :: | FF_src_p_view(:) |
Returns pointer with array of FF_src ports for this component |
| type(SS_flux_port_t), | intent(out), | optional, | pointer | :: | SS_flux_p_view(:) |
Returns pointer with array of SS_flux ports for this component |
| type(SS_src_port_t), | intent(out), | optional, | pointer | :: | SS_src_p_view(:) |
Returns pointer with array of SS_src ports for this component |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(krn_t), | intent(inout) | :: | me | |||
| character(len=*), | intent(in) | :: | name | |||
| integer, | intent(in) | :: | nb_state_vars | |||
| integer, | intent(in) | :: | nb_non_zeros_exp | |||
| integer, | intent(in) | :: | nb_non_zeros_imp | |||
| integer, | intent(in) | :: | nb_FF_flux_ports | |||
| integer, | intent(in) | :: | nb_FS_ports | |||
| integer, | intent(in) | :: | nb_FF_src_ports | |||
| integer, | intent(in) | :: | nb_SS_flux_ports | |||
| integer, | intent(in) | :: | nb_SS_src_ports |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(krn_t), | intent(inout) | :: | me | |||
| character(len=*), | intent(in) | :: | name_plus_label | |||
| integer, | intent(in), | optional | :: | nb_nodes_FS | ||
| integer, | intent(in), | optional | :: | nb_nodes_SS |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(krn_t), | intent(inout), | target | :: | me | ||
| logical, | intent(in) | :: | for_explicit |
if true add to explicit arrays otherwise to implicit |
||
| integer, | intent(in) | :: | col(:) |
relative indexes of the variables placed into global matrix |
||
| integer, | intent(in) | :: | row(:) |
relative indexes of the variables placed into global matrix |
||
| type(dbl_pointer_t), | intent(in) | :: | val(:) |
pointer to the value which should be placed into global matrix |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(krn_t), | intent(inout) | :: | me | |||
| class(port_t), | intent(in) | :: | port1 | |||
| class(port_t), | intent(in) | :: | port2 | |||
| integer, | intent(in) | :: | col(:) |
relative indexes of the variables placed into global matrix |
||
| integer, | intent(in) | :: | row(:) |
relative indexes of the variables placed into global matrix |
||
| type(dbl_pointer_t), | intent(in) | :: | val(:) |
pointer to the value which should be placed into global matrix |
||
| type(dbl_pointer_t), | intent(out), | optional | :: | val_out(:) |
in case of overlapping matrix |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | Mat2add(:,:) | |||
| type(dbl_pointer_t), | intent(inout) | :: | Mx(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(krn_t), | intent(inout) | :: | me |
Using Intel sblas functions to translate coo to csr matrix
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nb_state_vars | |||
| type(coo_csr_t(:)), | intent(inout), | allocatable, target | :: | arr |