Changes Particle Type. This deletes all existing particle data and redeclares the associated MPI type.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_set), | intent(inout) | :: | this |
Set of particles |
||
| character(len=*), | intent(in) | :: | type |
particle type |
impure subroutine particle_set_ChangePartType(this,type) !> Changes Particle Type. ! This deletes all existing particle data and redeclares ! the associated MPI type. implicit none class(particle_set), intent(inout) :: this !! Set of particles character(len=*), intent(in) :: type !! particle type ! Select appropriate type select case (trim(adjustl(type))) case ('Default','default','DEFAULT') if (this%part_type .eq. PP_TYPE_DEFAULT) then ! Nothing to do return else this%part_type = PP_TYPE_DEFAULT end if case ('Basset', 'basset', 'BASSET' ) if (this%part_type .eq. PP_TYPE_BASSET) then ! Nothing to do return else this%part_type = PP_TYPE_BASSET end if case default call this%parallel%Stop ("Unknown particle type") end select ! Delete all data this%count_ = 0 call this%Resize(this%count_) ! Delete previous MPI Type call this%FreeMPIType() ! Set sample type call this%SetObjectType() ! Create MPI type call this%CreateMPIType return end subroutine particle_set_ChangePartType