TABLE OF CONTENTS


UTI/PRE/trivertex [ Modules ]

[ Top ] [ Modules ]

NOM

 trivertex(msh)

DESCRIPTION

 Elimination des sommets surabondants et corrige en consequence
 Eliminate overabundant peaks and correct accordingly

    ENTREES / INPUT
    msh : maillage / mesh

    SORTIES / OUTPUT
    msh : maillage corrige / corrected mesh

SOURCE

! Ce logiciel est regi par la licence [CeCILL-B]
! This software is governed by the [CeCILL-B] license
!=========================== DEBUT DES DECLARATIONS ==================== 
!.1-----  Implicit, Use
  use geo_typ
  use zorder
  IMPLICIT NONE
!.2-----  Declaration       
  type(mesh), intent(inout)             :: msh !! Maillage / Mesh
  type(chaineR3), pointer               :: R3    
  type (chaineR2), Pointer              :: R2    
  type (chaineR1), Pointer              :: R1    
  integer                               :: taille,interieur,i,j
  integer, dimension(:),allocatable     :: temp
  type(point), dimension(:),allocatable :: tempvertex         
!=========================== DEBUT DU CODE EXECUTABLE ==================
! Initialisations
  taille=0
  allocate(R1,R2,R3)
  R1%z=0.d0
  Nullify(R1%suiv) ; Nullify(R1%prec)
  R2%y=0.d0
  R2%cr1=>R1
  nullify(R2%suiv) ; Nullify(R2%prec)
  R3%x=-1.d20
  R3%cr2=>R2
  nullify(R3%suiv) ; Nullify(R3%prec)
  allocate(temp(msh%nb_vertex))
  temp=0

! Rangement des sommets
  j=0
  DO i=1,msh%nb_vertex
      CALL rangeR3 (msh%list_vertex(i)%x,msh%list_vertex(i)%y,msh%list_vertex(i)%z, R3,taille)
      j=taille
  END DO
  
! Numerotation des sommets
  CALL parcoursR3(R3)
  DO i=1,msh%nb_vertex
      CALL donne_num (msh%list_vertex(i)%x,msh%list_vertex(i)%y,msh%list_vertex(i)%z, R3,temp(i),interieur)
      IF(temp(i).le.0.or.temp(i).gt.msh%nb_vertex) THEN
          write( *,1010)msh%list_vertex(i)%x, msh%list_vertex(i)%y, msh%list_vertex(i)%z, temp(i)
1010 format('Err_Donne_num ',3e15.8,i8)
          STOP
      END IF
  END DO
  
! Modification des numeros des vertex des faces
  DO i=1,msh%nb_face
      DO j=1,msh%list_face(i)%nbvertex
          msh%list_face(i)%vertex(j)=temp(msh%list_face(i)%vertex(j))
      END DO
  END DO
  
! Remplacement des vertex
  allocate(tempvertex(taille))
  DO i=1,msh%nb_vertex
      tempvertex(temp(i))=msh%list_vertex(i)
  END DO
  deallocate(msh%list_vertex)
  msh%nb_vertex=taille
  allocate(msh%list_vertex(taille))
  msh%list_vertex=tempvertex
  deallocate(tempvertex)
  deallocate(temp)
  
! IL FAUT DESALLOUER R3,R2,R1
!===========================   FIN DE LA ROUTINE    ====================
END SUBROUTINE trivertex