Free the interface map, then every set's model, geometry and sub-mesh, then the sub-mesh communicators. The global mesh is not owned and is left alone. Collective.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MultiSetModel3D_t), | intent(inout) | :: | this |
subroutine Free_MultiSetModel3D_t(this)
!! Free the interface map, then every set's model, geometry and sub-mesh, then the
!! sub-mesh communicators. The global mesh is not owned and is left alone.
!! Collective.
implicit none
class(MultiSetModel3D_t),intent(inout) :: this
! Local
integer :: k,ierror
call this%iface%Free()
if(allocated(this%traces)) deallocate(this%traces)
if(allocated(this%sets)) then
do k = 1,this%nSets
if(allocated(this%sets(k)%model)) then
call this%sets(k)%model%Free()
deallocate(this%sets(k)%model)
endif
if(associated(this%sets(k)%geometry)) then
call this%sets(k)%geometry%Free()
deallocate(this%sets(k)%geometry)
endif
if(associated(this%sets(k)%mesh)) then
call this%sets(k)%mesh%Free()
deallocate(this%sets(k)%mesh)
endif
if(this%sets(k)%comm /= MPI_COMM_NULL) then
call mpi_comm_free(this%sets(k)%comm,ierror)
endif
enddo
deallocate(this%sets)
endif
if(allocated(this%setOfElem)) deallocate(this%setOfElem)
if(allocated(this%setGlobalId)) deallocate(this%setGlobalId)
if(allocated(this%setOffsetThisRank)) deallocate(this%setOffsetThisRank)
nullify(this%globalMesh)
this%nSets = 0
this%nInterfaceFaces = 0
this%interfacesReady = .false.
endsubroutine Free_MultiSetModel3D_t