class_keytable.f90 Source File


Files dependent on this one

sourcefile~~class_keytable.f90~~AfferentGraph sourcefile~class_keytable.f90 class_keytable.f90 sourcefile~class_mesh_procedures.f90 class_mesh_procedures.F90 sourcefile~class_mesh_procedures.f90->sourcefile~class_keytable.f90 sourcefile~class_mesh.f90 class_mesh.F90 sourcefile~class_mesh_procedures.f90->sourcefile~class_mesh.f90 sourcefile~class_mesh.f90->sourcefile~class_keytable.f90 sourcefile~supplement_implementation.f90 supplement_implementation.f90 sourcefile~supplement_implementation.f90->sourcefile~class_keytable.f90 sourcefile~smooth_mesh.f90 smooth_mesh.f90 sourcefile~smooth_mesh.f90->sourcefile~class_keytable.f90 sourcefile~smooth_mesh.f90->sourcefile~class_mesh.f90 sourcefile~tools_mesh_optimize.f90 tools_mesh_optimize.f90 sourcefile~smooth_mesh.f90->sourcefile~tools_mesh_optimize.f90 sourcefile~tools_mesh_check.f90 tools_mesh_check.f90 sourcefile~smooth_mesh.f90->sourcefile~tools_mesh_check.f90 sourcefile~class_bc.f90 class_bc.f90 sourcefile~smooth_mesh.f90->sourcefile~class_bc.f90 sourcefile~class_keytable_procedures.f90 class_keytable_procedures.f90 sourcefile~class_keytable_procedures.f90->sourcefile~class_keytable.f90 sourcefile~smooth_surf_vtx.f90 smooth_surf_vtx.f90 sourcefile~smooth_surf_vtx.f90->sourcefile~class_keytable.f90 sourcefile~smooth_surf_vtx.f90->sourcefile~class_mesh.f90 sourcefile~smooth_surf_vtx.f90->sourcefile~tools_mesh_optimize.f90 sourcefile~smooth_surf_vtx.f90->sourcefile~tools_mesh_check.f90 sourcefile~check_right_handed.f90 check_right_handed.f90 sourcefile~check_right_handed.f90->sourcefile~class_keytable.f90 sourcefile~check_right_handed.f90->sourcefile~class_mesh.f90 sourcefile~check_right_handed.f90->sourcefile~tools_mesh_optimize.f90 sourcefile~check_right_handed.f90->sourcefile~tools_mesh_check.f90 sourcefile~smooth_interior_vtx.f90 smooth_interior_vtx.f90 sourcefile~smooth_interior_vtx.f90->sourcefile~class_keytable.f90 sourcefile~smooth_interior_vtx.f90->sourcefile~class_mesh.f90 sourcefile~smooth_interior_vtx.f90->sourcefile~tools_mesh_optimize.f90 sourcefile~smooth_interior_vtx.f90->sourcefile~tools_mesh_check.f90 sourcefile~mobile_verts.f90 mobile_verts.f90 sourcefile~mobile_verts.f90->sourcefile~class_keytable.f90 sourcefile~mobile_verts.f90->sourcefile~tools_mesh_optimize.f90 sourcefile~tools_output.f90 tools_output.f90 sourcefile~tools_output.f90->sourcefile~class_mesh.f90 sourcefile~class_vector_field.f90 class_vector_field.f90 sourcefile~tools_output.f90->sourcefile~class_vector_field.f90 sourcefile~class_output.f90 class_output.f90 sourcefile~tools_output.f90->sourcefile~class_output.f90 sourcefile~class_scalar_field.f90 class_scalar_field.f90 sourcefile~tools_output.f90->sourcefile~class_scalar_field.f90 sourcefile~op_div.f90 op_div.f90 sourcefile~op_div.f90->sourcefile~class_mesh.f90 sourcefile~class_vector_pde.f90 class_vector_pde.f90 sourcefile~op_div.f90->sourcefile~class_vector_pde.f90 sourcefile~op_div.f90->sourcefile~class_vector_field.f90 sourcefile~class_scalar_pde.f90 class_scalar_pde.f90 sourcefile~op_div.f90->sourcefile~class_scalar_pde.f90 sourcefile~op_div.f90->sourcefile~class_scalar_field.f90 sourcefile~class_bc_wall_procedures.f90 class_bc_wall_procedures.f90 sourcefile~class_bc_wall_procedures.f90->sourcefile~class_mesh.f90 sourcefile~class_bc_wall.f90 class_bc_wall.f90 sourcefile~class_bc_wall_procedures.f90->sourcefile~class_bc_wall.f90 sourcefile~tools_mesh_optimize.f90->sourcefile~class_mesh.f90 sourcefile~tools_mesh_optimize.f90->sourcefile~class_bc.f90 sourcefile~vector_pde_source.f90 vector_pde_source.f90 sourcefile~vector_pde_source.f90->sourcefile~class_mesh.f90 sourcefile~vector_pde_source.f90->sourcefile~class_vector_pde.f90 sourcefile~vector_pde_source.f90->sourcefile~class_vector_field.f90 sourcefile~vector_pde_source.f90->sourcefile~class_scalar_pde.f90 sourcefile~rhie_chow.f90 rhie_chow.f90 sourcefile~rhie_chow.f90->sourcefile~class_mesh.f90 sourcefile~rhie_chow.f90->sourcefile~class_vector_field.f90 sourcefile~class_field.f90 class_field.f90 sourcefile~rhie_chow.f90->sourcefile~class_field.f90 sourcefile~rhie_chow.f90->sourcefile~class_scalar_field.f90 sourcefile~op_field.f90 op_field.f90 sourcefile~rhie_chow.f90->sourcefile~op_field.f90 sourcefile~class_scalar_pde_procedures.f90 class_scalar_pde_procedures.f90 sourcefile~class_scalar_pde_procedures.f90->sourcefile~class_mesh.f90 sourcefile~class_scalar_pde_procedures.f90->sourcefile~class_scalar_pde.f90 sourcefile~class_scalar_pde_procedures.f90->sourcefile~class_scalar_field.f90 sourcefile~check_vertex_quality.f90 check_vertex_quality.f90 sourcefile~check_vertex_quality.f90->sourcefile~class_mesh.f90 sourcefile~check_vertex_quality.f90->sourcefile~tools_mesh_check.f90 sourcefile~class_vector_pde.f90->sourcefile~class_mesh.f90 sourcefile~class_vector_pde.f90->sourcefile~class_vector_field.f90 sourcefile~class_pde.f90 class_pde.f90 sourcefile~class_vector_pde.f90->sourcefile~class_pde.f90 sourcefile~vector_field_grad.f90 vector_field_grad.f90 sourcefile~vector_field_grad.f90->sourcefile~class_mesh.f90 sourcefile~vector_field_grad.f90->sourcefile~class_vector_field.f90 sourcefile~op_grad.f90 op_grad.f90 sourcefile~vector_field_grad.f90->sourcefile~op_grad.f90 sourcefile~valid_tet.f90 valid_tet.f90 sourcefile~valid_tet.f90->sourcefile~class_mesh.f90 sourcefile~valid_tet.f90->sourcefile~tools_mesh_optimize.f90 sourcefile~class_scalar_field_procedures.f90 class_scalar_field_procedures.f90 sourcefile~class_scalar_field_procedures.f90->sourcefile~class_mesh.f90 sourcefile~class_scalar_field_procedures.f90->sourcefile~class_field.f90 sourcefile~class_scalar_field_procedures.f90->sourcefile~class_scalar_field.f90 sourcefile~class_scalar_field_procedures.f90->sourcefile~class_bc.f90 sourcefile~vector_pde_ddt.f90 vector_pde_ddt.f90 sourcefile~vector_pde_ddt.f90->sourcefile~class_mesh.f90 sourcefile~vector_pde_ddt.f90->sourcefile~class_vector_pde.f90 sourcefile~vector_pde_ddt.f90->sourcefile~class_vector_field.f90 sourcefile~vector_pde_ddt.f90->sourcefile~class_scalar_field.f90 sourcefile~op_ddt.f90 op_ddt.f90 sourcefile~vector_pde_ddt.f90->sourcefile~op_ddt.f90 sourcefile~class_vtk_output_procedures.f90 class_vtk_output_procedures.f90 sourcefile~class_vtk_output_procedures.f90->sourcefile~class_mesh.f90 sourcefile~class_vtk_output_procedures.f90->sourcefile~class_output.f90 sourcefile~class_vtk_output.f90 class_vtk_output.f90 sourcefile~class_vtk_output_procedures.f90->sourcefile~class_vtk_output.f90 sourcefile~vector_field_flux.f90 vector_field_flux.f90 sourcefile~vector_field_flux.f90->sourcefile~class_mesh.f90 sourcefile~vector_field_flux.f90->sourcefile~class_vector_field.f90 sourcefile~vector_field_flux.f90->sourcefile~class_field.f90 sourcefile~vector_field_flux.f90->sourcefile~class_scalar_field.f90 sourcefile~vector_field_flux.f90->sourcefile~op_field.f90 sourcefile~tools_mesh_check.f90->sourcefile~class_mesh.f90 sourcefile~tools_mesh_check.f90->sourcefile~class_scalar_field.f90 sourcefile~class_motion_procedures.f90 class_motion_procedures.f90 sourcefile~class_motion_procedures.f90->sourcefile~class_mesh.f90 sourcefile~class_vector_field.f90->sourcefile~class_mesh.f90 sourcefile~class_vector_field.f90->sourcefile~class_field.f90 sourcefile~class_vector_field.f90->sourcefile~class_bc.f90 sourcefile~class_bc_math_procedures.f90 class_bc_math_procedures.f90 sourcefile~class_bc_math_procedures.f90->sourcefile~class_mesh.f90 sourcefile~vector_pde_laplacian.f90 vector_pde_laplacian.f90 sourcefile~vector_pde_laplacian.f90->sourcefile~class_mesh.f90 sourcefile~vector_pde_laplacian.f90->sourcefile~class_vector_pde.f90 sourcefile~vector_pde_laplacian.f90->sourcefile~class_vector_field.f90 sourcefile~vector_pde_laplacian.f90->sourcefile~class_scalar_field.f90 sourcefile~vector_pde_laplacian.f90->sourcefile~class_bc.f90 sourcefile~vector_pde_laplacian.f90->sourcefile~op_grad.f90 sourcefile~op_laplacian.f90 op_laplacian.f90 sourcefile~vector_pde_laplacian.f90->sourcefile~op_laplacian.f90 sourcefile~check_tet_quality.f90 check_tet_quality.f90 sourcefile~check_tet_quality.f90->sourcefile~class_mesh.f90 sourcefile~check_tet_quality.f90->sourcefile~tools_mesh_check.f90 sourcefile~scalar_pde_source.f90 scalar_pde_source.f90 sourcefile~scalar_pde_source.f90->sourcefile~class_mesh.f90 sourcefile~op_source.f90 op_source.f90 sourcefile~scalar_pde_source.f90->sourcefile~op_source.f90 sourcefile~class_bc_procedures.f90 class_bc_procedures.f90 sourcefile~class_bc_procedures.f90->sourcefile~class_mesh.f90 sourcefile~class_bc_procedures.f90->sourcefile~class_bc.f90 sourcefile~class_output.f90->sourcefile~class_mesh.f90 sourcefile~class_output.f90->sourcefile~class_vector_field.f90 sourcefile~class_output.f90->sourcefile~class_scalar_field.f90 sourcefile~class_exodus.f90 class_exodus.f90 sourcefile~class_exodus.f90->sourcefile~class_mesh.f90 sourcefile~class_exodus.f90->sourcefile~class_vector_field.f90 sourcefile~class_exodus.f90->sourcefile~class_output.f90 sourcefile~class_exodus.f90->sourcefile~class_scalar_field.f90 sourcefile~class_exodus_procedures.f90 class_exodus_procedures.f90 sourcefile~class_exodus_procedures.f90->sourcefile~class_mesh.f90 sourcefile~class_exodus_procedures.f90->sourcefile~class_vector_field.f90 sourcefile~class_exodus_procedures.f90->sourcefile~class_output.f90 sourcefile~class_exodus_procedures.f90->sourcefile~class_exodus.f90 sourcefile~class_exodus_procedures.f90->sourcefile~class_scalar_field.f90 sourcefile~class_bc_wall.f90->sourcefile~class_mesh.f90 sourcefile~class_field_procedures.f90 class_field_procedures.f90 sourcefile~class_field_procedures.f90->sourcefile~class_mesh.f90 sourcefile~class_field_procedures.f90->sourcefile~class_field.f90 sourcefile~write_vector_field.f90 write_vector_field.f90 sourcefile~write_vector_field.f90->sourcefile~class_mesh.f90 sourcefile~write_vector_field.f90->sourcefile~tools_output.f90 sourcefile~write_vector_field.f90->sourcefile~class_vector_field.f90 sourcefile~write_vector_field.f90->sourcefile~class_output.f90 sourcefile~class_vtk_output.f90->sourcefile~class_mesh.f90 sourcefile~class_vtk_output.f90->sourcefile~class_vector_field.f90 sourcefile~class_vtk_output.f90->sourcefile~class_output.f90 sourcefile~class_vtk_output.f90->sourcefile~class_scalar_field.f90 sourcefile~class_scalar_pde.f90->sourcefile~class_mesh.f90 sourcefile~class_scalar_pde.f90->sourcefile~class_pde.f90 sourcefile~class_scalar_pde.f90->sourcefile~class_scalar_field.f90 sourcefile~tools_nemo.f90 tools_nemo.f90 sourcefile~tools_nemo.f90->sourcefile~class_mesh.f90 sourcefile~tools_nemo.f90->sourcefile~tools_output.f90 sourcefile~tools_nemo.f90->sourcefile~op_div.f90 sourcefile~tools_nemo.f90->sourcefile~tools_mesh_optimize.f90 sourcefile~tools_nemo.f90->sourcefile~class_vector_pde.f90 sourcefile~tools_nemo.f90->sourcefile~tools_mesh_check.f90 sourcefile~tools_nemo.f90->sourcefile~class_vector_field.f90 sourcefile~tools_nemo.f90->sourcefile~class_output.f90 sourcefile~tools_nemo.f90->sourcefile~class_scalar_pde.f90 sourcefile~tools_nemo.f90->sourcefile~class_scalar_field.f90 sourcefile~tools_nemo.f90->sourcefile~class_bc.f90 sourcefile~tools_nemo.f90->sourcefile~op_grad.f90 sourcefile~tools_nemo.f90->sourcefile~op_laplacian.f90 sourcefile~tools_nemo.f90->sourcefile~op_field.f90 sourcefile~tools_nemo.f90->sourcefile~op_source.f90 sourcefile~tools_nemo.f90->sourcefile~op_ddt.f90 sourcefile~op_d2dt2.f90 op_d2dt2.f90 sourcefile~tools_nemo.f90->sourcefile~op_d2dt2.f90 sourcefile~class_field.f90->sourcefile~class_mesh.f90 sourcefile~class_field.f90->sourcefile~class_bc.f90 sourcefile~class_pde.f90->sourcefile~class_mesh.f90 sourcefile~class_output_procedures.f90 class_output_procedures.F90 sourcefile~class_output_procedures.f90->sourcefile~class_mesh.f90 sourcefile~class_output_procedures.f90->sourcefile~class_vector_field.f90 sourcefile~class_output_procedures.f90->sourcefile~class_output.f90 sourcefile~class_output_procedures.f90->sourcefile~class_vtk_output.f90 sourcefile~class_output_procedures.f90->sourcefile~class_scalar_field.f90 sourcefile~flux_pde_div.f90 flux_pde_div.f90 sourcefile~flux_pde_div.f90->sourcefile~class_mesh.f90 sourcefile~flux_pde_div.f90->sourcefile~op_div.f90 sourcefile~write_mesh.f90 write_mesh.f90 sourcefile~write_mesh.f90->sourcefile~class_mesh.f90 sourcefile~write_mesh.f90->sourcefile~tools_output.f90 sourcefile~write_mesh.f90->sourcefile~class_output.f90 sourcefile~class_vector_pde_procedures.f90 class_vector_pde_procedures.f90 sourcefile~class_vector_pde_procedures.f90->sourcefile~class_mesh.f90 sourcefile~class_vector_pde_procedures.f90->sourcefile~class_vector_pde.f90 sourcefile~class_vector_pde_procedures.f90->sourcefile~class_vector_field.f90 sourcefile~class_vector_pde_procedures.f90->sourcefile~class_pde.f90 sourcefile~scalar_pde_laplacian.f90 scalar_pde_laplacian.f90 sourcefile~scalar_pde_laplacian.f90->sourcefile~class_mesh.f90 sourcefile~scalar_pde_laplacian.f90->sourcefile~class_bc.f90 sourcefile~scalar_pde_laplacian.f90->sourcefile~op_grad.f90 sourcefile~scalar_pde_laplacian.f90->sourcefile~op_laplacian.f90 sourcefile~class_scalar_field.f90->sourcefile~class_mesh.f90 sourcefile~class_scalar_field.f90->sourcefile~class_field.f90 sourcefile~class_scalar_field.f90->sourcefile~class_bc.f90 sourcefile~check_mesh_quality.f90 check_mesh_quality.f90 sourcefile~check_mesh_quality.f90->sourcefile~class_mesh.f90 sourcefile~check_mesh_quality.f90->sourcefile~tools_mesh_check.f90 sourcefile~check_mesh_quality.f90->sourcefile~class_scalar_field.f90 sourcefile~scalar_field_grad.f90 scalar_field_grad.f90 sourcefile~scalar_field_grad.f90->sourcefile~class_mesh.f90 sourcefile~scalar_field_grad.f90->sourcefile~class_scalar_field.f90 sourcefile~scalar_field_grad.f90->sourcefile~op_grad.f90 sourcefile~vector_pde_div.f90 vector_pde_div.f90 sourcefile~vector_pde_div.f90->sourcefile~class_mesh.f90 sourcefile~vector_pde_div.f90->sourcefile~op_div.f90 sourcefile~vector_pde_div.f90->sourcefile~class_vector_pde.f90 sourcefile~vector_pde_div.f90->sourcefile~class_bc.f90 sourcefile~scalar_pde_d2dt2.f90 scalar_pde_d2dt2.f90 sourcefile~scalar_pde_d2dt2.f90->sourcefile~class_mesh.f90 sourcefile~scalar_pde_d2dt2.f90->sourcefile~op_d2dt2.f90 sourcefile~vector_pde_grad.f90 vector_pde_grad.f90 sourcefile~vector_pde_grad.f90->sourcefile~class_mesh.f90 sourcefile~vector_pde_grad.f90->sourcefile~class_vector_pde.f90 sourcefile~vector_pde_grad.f90->sourcefile~class_scalar_field.f90 sourcefile~vector_pde_grad.f90->sourcefile~op_grad.f90 sourcefile~vector_pde_d2dt2.f90 vector_pde_d2dt2.f90 sourcefile~vector_pde_d2dt2.f90->sourcefile~class_mesh.f90 sourcefile~vector_pde_d2dt2.f90->sourcefile~class_vector_pde.f90 sourcefile~vector_pde_d2dt2.f90->sourcefile~class_vector_field.f90 sourcefile~vector_pde_d2dt2.f90->sourcefile~class_scalar_field.f90 sourcefile~vector_pde_d2dt2.f90->sourcefile~op_d2dt2.f90 sourcefile~scalar_pde_div.f90 scalar_pde_div.f90 sourcefile~scalar_pde_div.f90->sourcefile~class_mesh.f90 sourcefile~scalar_pde_div.f90->sourcefile~op_div.f90 sourcefile~scalar_pde_div.f90->sourcefile~class_bc.f90 sourcefile~class_vector_field_procedures.f90 class_vector_field_procedures.f90 sourcefile~class_vector_field_procedures.f90->sourcefile~class_mesh.f90 sourcefile~class_vector_field_procedures.f90->sourcefile~class_vector_field.f90 sourcefile~class_vector_field_procedures.f90->sourcefile~class_field.f90 sourcefile~class_vector_field_procedures.f90->sourcefile~class_bc.f90 sourcefile~scalar_pde_ddt.f90 scalar_pde_ddt.f90 sourcefile~scalar_pde_ddt.f90->sourcefile~class_mesh.f90 sourcefile~scalar_pde_ddt.f90->sourcefile~op_ddt.f90 sourcefile~class_bc.f90->sourcefile~class_bc_wall.f90 sourcefile~op_grad.f90->sourcefile~class_vector_pde.f90 sourcefile~op_grad.f90->sourcefile~class_vector_field.f90 sourcefile~op_grad.f90->sourcefile~class_scalar_field.f90 sourcefile~laplacian_smooth.f90 laplacian_smooth.f90 sourcefile~laplacian_smooth.f90->sourcefile~tools_mesh_optimize.f90 sourcefile~op_laplacian.f90->sourcefile~class_vector_pde.f90 sourcefile~op_laplacian.f90->sourcefile~class_vector_field.f90 sourcefile~op_laplacian.f90->sourcefile~class_scalar_pde.f90 sourcefile~op_laplacian.f90->sourcefile~class_scalar_field.f90 sourcefile~write_scalar_field.f90 write_scalar_field.f90 sourcefile~write_scalar_field.f90->sourcefile~tools_output.f90 sourcefile~op_field.f90->sourcefile~class_vector_field.f90 sourcefile~op_field.f90->sourcefile~class_scalar_field.f90 sourcefile~class_pde_procedures.f90 class_pde_procedures.f90 sourcefile~class_pde_procedures.f90->sourcefile~class_pde.f90 sourcefile~op_source.f90->sourcefile~class_scalar_pde.f90 sourcefile~op_source.f90->sourcefile~class_scalar_field.f90 sourcefile~scalar_vector_fld_mul.f90 scalar_vector_fld_mul.f90 sourcefile~scalar_vector_fld_mul.f90->sourcefile~class_vector_field.f90 sourcefile~scalar_vector_fld_mul.f90->sourcefile~class_field.f90 sourcefile~scalar_vector_fld_mul.f90->sourcefile~class_scalar_field.f90 sourcefile~scalar_vector_fld_mul.f90->sourcefile~op_field.f90 sourcefile~scalar_fld_vector_mul.f90 scalar_fld_vector_mul.f90 sourcefile~scalar_fld_vector_mul.f90->sourcefile~class_vector_field.f90 sourcefile~scalar_fld_vector_mul.f90->sourcefile~class_field.f90 sourcefile~scalar_fld_vector_mul.f90->sourcefile~class_scalar_field.f90 sourcefile~scalar_fld_vector_mul.f90->sourcefile~op_field.f90 sourcefile~op_ddt.f90->sourcefile~class_vector_pde.f90 sourcefile~op_ddt.f90->sourcefile~class_vector_field.f90 sourcefile~op_ddt.f90->sourcefile~class_scalar_pde.f90 sourcefile~op_ddt.f90->sourcefile~class_scalar_field.f90 sourcefile~op_d2dt2.f90->sourcefile~class_vector_pde.f90 sourcefile~op_d2dt2.f90->sourcefile~class_vector_field.f90 sourcefile~op_d2dt2.f90->sourcefile~class_scalar_pde.f90 sourcefile~op_d2dt2.f90->sourcefile~class_scalar_field.f90 sourcefile~op_ddt_procedures.f90 op_ddt_procedures.f90 sourcefile~op_ddt_procedures.f90->sourcefile~op_ddt.f90 sourcefile~op_d2dt2_procedures.f90 op_d2dt2_procedures.f90 sourcefile~op_d2dt2_procedures.f90->sourcefile~op_d2dt2.f90 sourcefile~op_laplacian_procedures.f90 op_laplacian_procedures.f90 sourcefile~op_laplacian_procedures.f90->sourcefile~op_laplacian.f90

Contents

Source Code


Source Code

!
!     (c) 2019 Guide Star Engineering, LLC
!     This Software was developed for the US Nuclear Regulatory Commission (US NRC)
!     under contract "Multi-Dimensional Physics Implementation into Fuel Analysis under
!     Steady-state and Transients (FAST)", contract # NRC-HQ-60-17-C-0007
!
!
!    NEMO - Numerical Engine (for) Multiphysics Operators
! Copyright (c) 2007, Stefano Toninel
!                     Gian Marco Bianchi  University of Bologna
!              David P. Schmidt    University of Massachusetts - Amherst
!              Salvatore Filippone University of Rome Tor Vergata
! All rights reserved.
!
! Redistribution and use in source and binary forms, with or without modification,
! are permitted provided that the following conditions are met:
!
!     1. Redistributions of source code must retain the above copyright notice,
!        this list of conditions and the following disclaimer.
!     2. Redistributions in binary form must reproduce the above copyright notice,
!        this list of conditions and the following disclaimer in the documentation
!        and/or other materials provided with the distribution.
!     3. Neither the name of the NEMO project nor the names of its contributors
!        may be used to endorse or promote products derived from this software
!        without specific prior written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
! ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
! ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
! (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
! ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!
!---------------------------------------------------------------------------------
!
! $Id: class_keytable.f90 3206 2008-07-02 12:39:02Z sfilippo $
!
! Description:
!    Provides storage of an irregular 2d integer information, where rows would all
!    have different length.  Similar to the connectivity class, except that
!    keytables cannot currently be inverted.  However, keytables provide convenient
!    storage for non-contiguous data and provide bounds checking on calls
!
! Provides:
!    KEYTABLE             class.
!    NEW_KEYTABLE         constructor for KEYTABLE class.
!    FREE_KEYTABLE        destructor for KEYTABLE class.
!    GET_KT_ROW           returns ith row of the keytable
!    SET_KT_ROW           sets, allocating if necessary, the key table row
!    GET_ROW_UB           returns the upper bound of rows in a keytable
!    GET_ROW_LB           returns the lower bound of rows in a keytable
!
MODULE class_keytable

    ! use class_psblas ! Move it to functions

    IMPLICIT NONE

    PRIVATE ! Default
    PUBLIC :: keytable ! Class
    PUBLIC ::  ASSIGNMENT(=)                     ! Setters

    !  `public :: assignment(=)'  ==  `public :: copy_keytable'

    ! Abstract data type for handling sets of information where
    ! A two dimensional array would be wasteful, since the length
    ! Of each row in the table varies tremendously.

    TYPE a_row
        INTEGER, ALLOCATABLE :: entries(:)
    END TYPE a_row

    TYPE keytable
        PRIVATE
        TYPE(a_row), ALLOCATABLE :: row(:)
    CONTAINS
        PROCEDURE :: alloc_keytable, free_keytable     ! Constructor/Destructor
        PROCEDURE :: get_kt_row, get_rows, get_row_ub, get_row_lb  ! Getters
        PROCEDURE :: get_row_size                                  ! Getters, cont.
        PROCEDURE :: set_kt_row                                    ! Setters
        PROCEDURE, PRIVATE :: nemo_keytable_sizeof
        GENERIC, PUBLIC :: nemo_sizeof => nemo_keytable_sizeof
        PROCEDURE, PUBLIC :: exists
    END TYPE keytable

    INTERFACE
        ELEMENTAL MODULE FUNCTION nemo_keytable_sizeof(table)
            USE class_psblas, ONLY : nemo_int_long_ ! Move it to functions
            IMPLICIT NONE
            CLASS(keytable), INTENT(IN) :: table
            INTEGER(kind=nemo_int_long_)   :: nemo_keytable_sizeof
        END FUNCTION nemo_keytable_sizeof
    END INTERFACE

    ! Description of class members.
    ! entry(:)  is a_row with varying numbers of elements
    ! columns(:)    is an array of rows


    ! ----- Generic Interfaces -----

    ! Setter
    INTERFACE ASSIGNMENT(=)
        MODULE SUBROUTINE copy_keytable(table2,table1)
            USE class_psblas, ONLY : abort_psblas ! Move it to functions
            IMPLICIT NONE
            TYPE(keytable), INTENT(IN)  :: table1
            TYPE(keytable), INTENT(OUT) :: table2
        END SUBROUTINE copy_keytable
    END INTERFACE ASSIGNMENT(=)

    INTERFACE
        ELEMENTAL MODULE FUNCTION nemo_a_row_sizeof(row)
        USE class_psblas, ONLY : nemo_int_long_, nemo_sizeof_int ! Move it to functions
            IMPLICIT NONE
            TYPE(a_row), INTENT(IN) :: row
            INTEGER(kind=nemo_int_long_)   :: nemo_a_row_sizeof
        END FUNCTION nemo_a_row_sizeof

    ! ----- Constructor -----

        MODULE SUBROUTINE alloc_keytable(table,lb,ub)
            USE class_psblas, ONLY : abort_psblas ! Move it to functions
            IMPLICIT NONE
            CLASS(keytable), INTENT(INOUT) :: table
            INTEGER, INTENT(IN) :: lb, ub
        END SUBROUTINE alloc_keytable

    ! ----- Destructor -----

        MODULE SUBROUTINE free_keytable(table)
            USE class_psblas, ONLY : abort_psblas, mypnum_ ! Move it to functions
            IMPLICIT NONE
            CLASS(keytable), INTENT(INOUT) :: table
        END SUBROUTINE free_keytable

    ! ----- Getters -----

        MODULE SUBROUTINE get_kt_row(table,i,irow)
            USE class_psblas, ONLY : abort_psblas ! Move it to functions
            IMPLICIT NONE
            CLASS(keytable), INTENT(IN), TARGET :: table
            INTEGER, INTENT(IN)        :: i
            INTEGER, POINTER           :: irow(:)
        END SUBROUTINE get_kt_row

    ! indicates if the keytable memory has been allocated
        MODULE FUNCTION exists(table)
            !use class_psblas ! Move it to functions
            IMPLICIT NONE
            CLASS(keytable), INTENT(IN) :: table
            LOGICAL                    :: exists
        END FUNCTION exists

    ! ----- Get info about table  -----

        MODULE FUNCTION get_row_lb (table)
            !use class_psblas ! Move it to functions
            IMPLICIT NONE
            INTEGER :: get_row_lb
            CLASS (keytable), INTENT(IN) :: table
        END FUNCTION get_row_lb


        MODULE FUNCTION get_row_ub(table)
            IMPLICIT NONE
            INTEGER :: get_row_ub
            CLASS (keytable), INTENT(IN) :: table
        END FUNCTION get_row_ub

        MODULE FUNCTION get_rows(table)
            IMPLICIT NONE
            INTEGER :: get_rows
            CLASS(keytable), INTENT(IN) :: table
        END FUNCTION get_rows

        MODULE  FUNCTION get_row_size(table,i)
            USE class_psblas, ONLY : abort_psblas ! Move it to functions
            IMPLICIT NONE
            INTEGER :: get_row_size
            CLASS(keytable), INTENT(IN) :: table
            INTEGER,INTENT(IN) :: i
        END FUNCTION get_row_size

    ! ----- Setters -----

        MODULE SUBROUTINE set_kt_row(table,i,irow)
            USE class_psblas, ONLY : abort_psblas ! Move it to functions
            IMPLICIT NONE
            CLASS(keytable), INTENT(INOUT) :: table
            INTEGER, INTENT(IN)        :: i
            INTEGER, INTENT(IN)        :: irow(:)
        END SUBROUTINE set_kt_row

    END INTERFACE

END MODULE class_keytable