ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/utils/vector_class.F90
(Generate patch)

Comparing trunk/OOPSE-2.0/src/utils/vector_class.F90 (file contents):
Revision 1930 by gezelter, Wed Jan 12 22:41:40 2005 UTC vs.
Revision 2171 by chuckv, Tue Apr 12 17:45:31 2005 UTC

# Line 60 | Line 60
60   !! @author J. Daniel Gezelter
61   !! @author Charles F. Vardeman II
62   !! @author Matthew Meineke
63 < !! @version $Id: vector_class.F90,v 1.2 2005-01-12 22:41:39 gezelter Exp $, $Date: 2005-01-12 22:41:39 $, $Name: not supported by cvs2svn $, $Revision: 1.2 $
63 > !! @version $Id: vector_class.F90,v 1.5 2005-04-12 17:45:31 chuckv Exp $, $Date: 2005-04-12 17:45:31 $, $Name: not supported by cvs2svn $, $Revision: 1.5 $
64  
65   module Vector_class
66    
# Line 68 | Line 68 | module Vector_class
68    PRIVATE
69    
70    public :: initialize
71 +  public :: destroy
72    public :: getSize
73    public :: getElementAt
74    public :: getPropertyListSize
# Line 77 | Line 78 | module Vector_class
78    public :: getElementProperty
79    public :: getMatchingElementList
80    public :: getFirstMatchingElement
81 +  
82  
83    integer, parameter :: logical_data_type = 1
84    integer, parameter :: integer_data_type = 2
# Line 824 | Line 826 | contains
826    end function initialize_3i
827  
828    function initialize_4i(cap, nprop, capinc, propinc) result(this)
829 <    integer, intent(in) :: cap, nprop, capinc, propinc
829 >     integer, intent(in) :: cap, nprop, capinc, propinc
830      integer :: error
831      type(Vector), pointer :: this
832  
# Line 875 | Line 877 | contains
877      if(error .ne. 0) write(*,*) 'Could not allocate logicalElementProperties!'
878  
879    end function initialize_4i
880 +
881 +    !! This function destroys the vector components....
882 +  function destroy(this) result(null_this)
883 +    logical :: done
884 +    type(Vector), pointer :: this
885 +    type(Vector), pointer :: null_this
886 +
887 +
888 +    if (.not. associated(this)) then
889 +       null_this => null()
890 +       return
891 +    end if
892      
893 <  
893 > !! Walk down the list and deallocate each of the vector components
894 >     if(associated(this%elementData)) then
895 >        deallocate(this%elementData)
896 >        this%elementData=>null()
897 >     endif
898 >
899 >
900 >     if(associated(this%PropertyDescriptions)) then
901 >        deallocate(this%PropertyDescriptions)
902 >        this%PropertyDescriptions=>null()
903 >     endif
904 >    
905 >    
906 >    
907 >     if(associated(this%PropertyDataType)) then
908 >        deallocate(this%PropertyDataType)
909 >        this%PropertyDataType=>null()
910 >     endif
911 >    
912 >    
913 >     if(associated(this%integerElementProperties)) then
914 >        deallocate(this%integerElementProperties)
915 >        this%integerElementProperties=>null()
916 >     endif
917 >    
918 >
919 >     if(associated(this%realElementProperties)) then
920 >        deallocate(this%realElementProperties)
921 >        this%realElementProperties=>null()
922 >     endif
923 >
924 >     if(associated(this%logicalElementProperties)) then
925 >        deallocate(this%logicalElementProperties)
926 >        this%logicalElementProperties=>null()
927 >     endif
928 >     deallocate(this)
929 >     null_this => null()
930 >  end function destroy
931    
932   end module Vector_class

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines