struct_def.f90 Source File


This file depends on

sourcefile~~struct_def.f90~~EfferentGraph sourcefile~struct_def.f90 struct_def.f90 sourcefile~precision_def.f90 precision_def.F90 sourcefile~struct_def.f90->sourcefile~precision_def.f90

Files dependent on this one

sourcefile~~struct_def.f90~~AfferentGraph sourcefile~struct_def.f90 struct_def.f90 sourcefile~pstruct_data.f90 pstruct_data.f90 sourcefile~pstruct_data.f90->sourcefile~struct_def.f90 sourcefile~grid_param.f90 grid_param.f90 sourcefile~grid_param.f90->sourcefile~struct_def.f90 sourcefile~grid_part_connect.f90 grid_part_connect.f90 sourcefile~grid_part_connect.f90->sourcefile~pstruct_data.f90 sourcefile~grid_part_lib.f90 grid_part_lib.f90 sourcefile~grid_part_connect.f90->sourcefile~grid_part_lib.f90 sourcefile~grid_part_util.f90 grid_part_util.f90 sourcefile~grid_part_util.f90->sourcefile~pstruct_data.f90 sourcefile~grid_part_util.f90->sourcefile~grid_part_lib.f90 sourcefile~mpi_field_interface.f90 mpi_field_interface.f90 sourcefile~mpi_field_interface.f90->sourcefile~pstruct_data.f90 sourcefile~mpi_field_interface.f90->sourcefile~grid_param.f90 sourcefile~pic_dump.f90 pic_dump.f90 sourcefile~pic_dump.f90->sourcefile~grid_param.f90 sourcefile~array_alloc.f90 array_alloc.f90 sourcefile~pic_dump.f90->sourcefile~array_alloc.f90 sourcefile~set_grid_param.f90 set_grid_param.f90 sourcefile~set_grid_param.f90->sourcefile~grid_param.f90 sourcefile~stretched_grid.f90 stretched_grid.f90 sourcefile~stretched_grid.f90->sourcefile~grid_param.f90 sourcefile~init_beam_part_distrib.f90 init_beam_part_distrib.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~grid_param.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~grid_part_util.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~mpi_field_interface.f90 sourcefile~psolve.f90 psolve.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~psolve.f90 sourcefile~init_grid_fields.f90 init_grid_fields.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~init_grid_fields.f90 sourcefile~mpi_curr_interface.f90 mpi_curr_interface.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~mpi_curr_interface.f90 sourcefile~init_beam_part_distrib.f90->sourcefile~array_alloc.f90 sourcefile~init_laser_field.f90 init_laser_field.f90 sourcefile~init_laser_field.f90->sourcefile~pstruct_data.f90 sourcefile~init_laser_field.f90->sourcefile~init_grid_fields.f90 sourcefile~grid_fields.f90 grid_fields.f90 sourcefile~init_laser_field.f90->sourcefile~grid_fields.f90 sourcefile~pic_out.f90 pic_out.f90 sourcefile~pic_out.f90->sourcefile~pstruct_data.f90 sourcefile~pic_out.f90->sourcefile~grid_param.f90 sourcefile~psolve.f90->sourcefile~pstruct_data.f90 sourcefile~psolve.f90->sourcefile~grid_param.f90 sourcefile~psolve.f90->sourcefile~grid_fields.f90 sourcefile~grid_part_lib.f90->sourcefile~grid_param.f90 sourcefile~grid_part_lib.f90->sourcefile~stretched_grid.f90 sourcefile~window.f90 window.f90 sourcefile~window.f90->sourcefile~pstruct_data.f90 sourcefile~window.f90->sourcefile~grid_param.f90 sourcefile~window.f90->sourcefile~mpi_field_interface.f90 sourcefile~mpi_part_interface.f90 mpi_part_interface.f90 sourcefile~window.f90->sourcefile~mpi_part_interface.f90 sourcefile~run_data_info.f90 run_data_info.f90 sourcefile~window.f90->sourcefile~run_data_info.f90 sourcefile~init_part_distrib.f90 init_part_distrib.f90 sourcefile~init_part_distrib.f90->sourcefile~grid_param.f90 sourcefile~init_part_distrib.f90->sourcefile~array_alloc.f90 sourcefile~mpi_part_interface.f90->sourcefile~grid_param.f90 sourcefile~mpi_part_interface.f90->sourcefile~array_alloc.f90 sourcefile~init_grid_fields.f90->sourcefile~pstruct_data.f90 sourcefile~grid_field_param.f90 grid_field_param.f90 sourcefile~init_grid_fields.f90->sourcefile~grid_field_param.f90 sourcefile~diag_part_and_fields.f90 diag_part_and_fields.f90 sourcefile~diag_part_and_fields.f90->sourcefile~pstruct_data.f90 sourcefile~diag_part_and_fields.f90->sourcefile~grid_param.f90 sourcefile~set_init_param.f90 set_init_param.f90 sourcefile~set_init_param.f90->sourcefile~grid_param.f90 sourcefile~set_init_param.f90->sourcefile~set_grid_param.f90 sourcefile~mpi_curr_interface.f90->sourcefile~pstruct_data.f90 sourcefile~mpi_curr_interface.f90->sourcefile~grid_param.f90 sourcefile~curr_and_fields_util.f90 curr_and_fields_util.f90 sourcefile~curr_and_fields_util.f90->sourcefile~pstruct_data.f90 sourcefile~curr_and_fields_util.f90->sourcefile~grid_param.f90 sourcefile~curr_and_fields_util.f90->sourcefile~grid_part_connect.f90 sourcefile~curr_and_fields_util.f90->sourcefile~mpi_field_interface.f90 sourcefile~curr_and_fields_util.f90->sourcefile~init_grid_fields.f90 sourcefile~curr_and_fields_util.f90->sourcefile~mpi_curr_interface.f90 sourcefile~curr_and_fields_util.f90->sourcefile~grid_fields.f90 sourcefile~grid_field_param.f90->sourcefile~grid_param.f90 sourcefile~boris_push.f90 boris_push.f90 sourcefile~boris_push.f90->sourcefile~pstruct_data.f90 sourcefile~run_data_info.f90->sourcefile~pstruct_data.f90 sourcefile~run_data_info.f90->sourcefile~grid_param.f90 sourcefile~array_alloc.f90->sourcefile~pstruct_data.f90 sourcefile~pic_evolve_in_time.f90 pic_evolve_in_time.f90 sourcefile~pic_evolve_in_time.f90->sourcefile~window.f90 sourcefile~pic_evolve_in_time.f90->sourcefile~mpi_part_interface.f90 sourcefile~pic_evolve_in_time.f90->sourcefile~init_grid_fields.f90 sourcefile~pic_evolve_in_time.f90->sourcefile~curr_and_fields_util.f90 sourcefile~pic_evolve_in_time.f90->sourcefile~boris_push.f90 sourcefile~fluid_density_momenta.f90 fluid_density_momenta.f90 sourcefile~pic_evolve_in_time.f90->sourcefile~fluid_density_momenta.f90 sourcefile~ionize.f90 ionize.f90 sourcefile~pic_evolve_in_time.f90->sourcefile~ionize.f90 sourcefile~pic_in.f90 pic_in.f90 sourcefile~pic_in.f90->sourcefile~init_laser_field.f90 sourcefile~pic_in.f90->sourcefile~init_part_distrib.f90 sourcefile~fluid_density_momenta.f90->sourcefile~mpi_field_interface.f90 sourcefile~fluid_density_momenta.f90->sourcefile~grid_fields.f90 sourcefile~start_all.f90 start_all.F90 sourcefile~start_all.f90->sourcefile~pic_dump.f90 sourcefile~start_all.f90->sourcefile~set_grid_param.f90 sourcefile~start_all.f90->sourcefile~set_init_param.f90 sourcefile~start_all.f90->sourcefile~run_data_info.f90 sourcefile~start_all.f90->sourcefile~array_alloc.f90 sourcefile~start_all.f90->sourcefile~pic_in.f90 sourcefile~start_all.f90->sourcefile~ionize.f90 sourcefile~env_evolve_in_time.f90 env_evolve_in_time.f90 sourcefile~env_evolve_in_time.f90->sourcefile~window.f90 sourcefile~env_evolve_in_time.f90->sourcefile~mpi_part_interface.f90 sourcefile~env_evolve_in_time.f90->sourcefile~curr_and_fields_util.f90 sourcefile~env_evolve_in_time.f90->sourcefile~boris_push.f90 sourcefile~env_evolve_in_time.f90->sourcefile~fluid_density_momenta.f90 sourcefile~env_evolve_in_time.f90->sourcefile~ionize.f90 sourcefile~grid_fields.f90->sourcefile~grid_field_param.f90 sourcefile~ionize.f90->sourcefile~array_alloc.f90 sourcefile~aladyn.f90 ALaDyn.F90 sourcefile~aladyn.f90->sourcefile~init_beam_part_distrib.f90 sourcefile~aladyn.f90->sourcefile~pic_out.f90 sourcefile~aladyn.f90->sourcefile~diag_part_and_fields.f90 sourcefile~aladyn.f90->sourcefile~run_data_info.f90 sourcefile~aladyn.f90->sourcefile~pic_evolve_in_time.f90 sourcefile~aladyn.f90->sourcefile~start_all.f90 sourcefile~aladyn.f90->sourcefile~env_evolve_in_time.f90 sourcefile~pic_out_util.f90 pic_out_util.f90 sourcefile~aladyn.f90->sourcefile~pic_out_util.f90 sourcefile~pic_out_util.f90->sourcefile~grid_part_util.f90 sourcefile~pic_out_util.f90->sourcefile~mpi_field_interface.f90 sourcefile~pic_out_util.f90->sourcefile~psolve.f90 sourcefile~pic_out_util.f90->sourcefile~mpi_curr_interface.f90

Contents

Source Code


Source Code

!*****************************************************************************************************!
!                            Copyright 2008-2020  The ALaDyn Collaboration                            !
!*****************************************************************************************************!

!*****************************************************************************************************!
!  This file is part of ALaDyn.                                                                       !
!                                                                                                     !
!  ALaDyn is free software: you can redistribute it and/or modify                                     !
!  it under the terms of the GNU General Public License as published by                               !
!  the Free Software Foundation, either version 3 of the License, or                                  !
!  (at your option) any later version.                                                                !
!                                                                                                     !
!  ALaDyn is distributed in the hope that it will be useful,                                          !
!  but WITHOUT ANY WARRANTY; without even the implied warranty of                                     !
!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                      !
!  GNU General Public License for more details.                                                       !
!                                                                                                     !
!  You should have received a copy of the GNU General Public License                                  !
!  along with ALaDyn.  If not, see <http://www.gnu.org/licenses/>.                                    !
!*****************************************************************************************************!
 module struct_def
  use precision_def
  implicit none
  public

  type species
   real(dp), allocatable :: part(:, :)
  end type

  type grid
   integer :: ng
   !!Number of cells in a given direction of the grid
   integer :: p_ind(2)
   !!Minimum and maximum cell number of the grid
   real(dp) :: gmin
   !!Value of the corresponding axis at the minimum cell
   real(dp) :: gmax
   !!Value of the corresponding axis at the maximum cell
   integer :: min_cell
   !!Initial cell of the grid in absolute units (i.e. respect to the total grid)
   integer :: max_cell
   !!Final cell of the grid in absolute units (i.e. respect to the total grid)
  end type

  type sgrid
   integer :: sind(2)
   !!Initial and final stretched cell (sind(1) also coincides with the number of
   !!stretched cells)
   real(dp) :: smin
   !!Axis value on the boundary between stretched and unstretched grid (left side of the box)
   real(dp) :: smax
   !!Axis value on the boundary between stretched and unstretched grid (right side of the box)
  end type

  type index_array
   !! Type defining an array of consecutive integer numbers, useful as
   !! indices in arrays.
   integer, allocatable :: indices(:)
  contains
   procedure, public :: find_index
  end type

  interface index_array
   module procedure new_index_array
  end interface

 contains

  function new_index_array(length) result(this)
    !! Constructor for the index_array type
   integer, intent(in) :: length
   type(index_array) :: this
   integer :: i

   allocate (this%indices(length))
   this%indices = [(i, i=1, length)]
  end function

  subroutine find_index(index_in, mask)
    !! Type bound procedure that finds and pack all the array indices
    !! according to the given mask

   class(index_array), intent(inout) :: index_in
   logical, intent(in) :: mask(:)
   index_in%indices = PACK(index_in%indices, mask)
  end subroutine

 end module