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 |
Allocating kernel arrays with number components
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(krn_t), | intent(inout) | :: | me | |||
| integer, | intent(in) | :: | size |
Used by all components add their array and port requirements
| 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 |
Add label of 2d mesh to expose 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 |
Allocating full matrices
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(krn_t), | intent(inout) | :: | me |
Used by state owners to set ports locations and get back link to them
| 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 |
Used by state owners to add coordinate format array to the full array
| 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 |
Used by links to add coordinate format array to the full array
| 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 |
Conversion full coordinate format array to sparse compressed row array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(krn_t), | intent(inout) | :: | me |
type krn_t !! Structure which will be used to size matrices like: coo,csr and ports integer :: idx = 1 integer, allocatable :: nb_state_vars(:) integer, allocatable :: nb_non_zeros_exp(:) integer, allocatable :: nb_non_zeros_imp(:) type(port_list_t) :: FF_flux_list, FF_src_list, FS_list, SS_flux_list, SS_src_list character(:), allocatable :: PortIdxForFSLink_List type(coo_csr_t(:)), allocatable :: imp !! Implicit matrices in both format coo and csr type(coo_csr_t(:)), allocatable :: exp !! Explicit matrices in both format coo and csr real(dp), allocatable :: rhs_or_solution(:) !! Right hand side of linear equation or it's solution real(dp), allocatable :: solution(:) !! solution vector of the linear system type(FF_flux_port_t), allocatable :: FF_flux_ports(:) !! Fluid/Fluid port array --> flux type(FF_src_port_t), allocatable :: FF_src_ports(:) !! Fluid/Fluid port array --> source type(FS_port_t), allocatable :: FS_ports(:) !! Fluid/Solid port array type(SS_flux_port_t), allocatable :: SS_flux_ports(:) !! Solid/Solid port array --> flux type(SS_src_port_t), allocatable :: SS_src_ports(:) !! Solid/Solid port array --> source ! TODO should be here also state space 3 vectors? contains procedure :: init_part1 => krn_init_part1 !! Allocating kernel arrays with number components procedure :: add => krn_add !! Used by all components add their array and port requirements procedure :: add_label => krn_add_label !! Add label of 2d mesh to expose ports procedure :: init_part2 => krn_init_part2 !! Allocating full matrices procedure :: update => krn_update !! Used by state owners to set ports locations and get back link to them procedure :: coo_add => krn_coo_add !! Used by state owners to add coordinate format array to the full array procedure :: coo_add_link => krn_coo_add_link !! Used by links to add coordinate format array to the full array ! before it was also get function now is used by find index procedure :: coo_to_csr => krn_coo_to_csr !! Conversion full coordinate format array to sparse compressed row array end type krn_t