geomechanics_patch.F90       coverage:  100.00 %func     72.75 %block


     1) module Geomechanics_Patch_module
     2) 
     3)   use Option_module
     4)   use Geomechanics_Grid_module
     5)   use Geomechanics_Material_module
     6)   use Geomechanics_Grid_Aux_module
     7)   use Geomechanics_Region_module
     8)   use Geomechanics_Strata_module
     9)   use Geomechanics_Coupler_module
    10)   use Geomechanics_Field_module
    11)   use Geomechanics_Auxiliary_module
    12)   use Dataset_Base_class
    13)   use PFLOTRAN_Constants_module
    14)   
    15)   implicit none
    16)   
    17)   private
    18)   
    19) #include "petsc/finclude/petscsys.h"
    20) 
    21)   type, public :: geomech_patch_type
    22)     PetscInt :: id
    23)     PetscInt, pointer :: imat(:)
    24)     type(geomech_grid_type), pointer :: geomech_grid
    25)     type(geomech_material_property_type), &
    26)         pointer :: geomech_material_properties
    27)     type(geomech_material_property_ptr_type), &
    28)         pointer :: geomech_material_property_array(:)
    29)     type(geomech_strata_list_type), pointer :: geomech_strata_list
    30)     type(gm_region_list_type), pointer :: geomech_region_list
    31)     type(geomech_coupler_list_type), &
    32)         pointer :: geomech_boundary_condition_list
    33)     type(geomech_coupler_list_type), pointer :: geomech_source_sink_list
    34)     type(geomech_field_type), pointer :: geomech_field
    35)     class(dataset_base_type), pointer :: geomech_datasets
    36)     type(geomech_auxiliary_type) :: geomech_aux
    37)   end type geomech_patch_type
    38) 
    39) 
    40)   public :: GeomechanicsPatchCreate, &
    41)             GeomechPatchLocalizeRegions, &
    42)             GeomechPatchProcessGeomechCouplers, &
    43)             GeomechPatchInitAllCouplerAuxVars, &
    44)             GeomechPatchGetDataset, &
    45)             GeomechanicsPatchDestroy
    46) 
    47) contains
    48) 
    49) ! ************************************************************************** !
    50) 
    51) function GeomechanicsPatchCreate()
    52)   ! 
    53)   ! Allocates and initializes a new geomechanics
    54)   ! patch object
    55)   ! 
    56)   ! Author: Satish Karra, LANL
    57)   ! Date: 05/23/13
    58)   ! 
    59) 
    60)   implicit none
    61)   
    62)   type(geomech_patch_type), pointer :: GeomechanicsPatchCreate
    63)   type(geomech_patch_type), pointer :: patch
    64)   
    65)   allocate(patch)
    66)   
    67)   patch%id = 0
    68)   nullify(patch%imat)
    69)   nullify(patch%geomech_grid)
    70)   
    71)   allocate(patch%geomech_boundary_condition_list)
    72)   call GeomechCouplerInitList(patch%geomech_boundary_condition_list)
    73)   allocate(patch%geomech_source_sink_list)
    74)   call GeomechCouplerInitList(patch%geomech_source_sink_list)  
    75)   
    76)   nullify(patch%geomech_material_properties)
    77)   nullify(patch%geomech_material_property_array)
    78)   
    79)   allocate(patch%geomech_strata_list)
    80)   call GeomechStrataInitList(patch%geomech_strata_list)
    81) 
    82)   allocate(patch%geomech_region_list)
    83)   call GeomechRegionInitList(patch%geomech_region_list)
    84)   
    85)   call GeomechAuxInit(patch%geomech_aux)
    86)   
    87)   nullify(patch%geomech_field)
    88)   nullify(patch%geomech_datasets)
    89)   
    90)   GeomechanicsPatchCreate => patch
    91)   
    92) end function GeomechanicsPatchCreate
    93) 
    94) ! ************************************************************************** !
    95) 
    96) subroutine GeomechPatchLocalizeRegions(geomech_patch,regions,option)
    97)   ! 
    98)   ! Localizes regions within each patch
    99)   ! 
   100)   ! Author: Satish Karra, LANL
   101)   ! Date: 05/23/13
   102)   ! 
   103) 
   104)   use Option_module
   105)   use Geomechanics_Region_module
   106) 
   107)   implicit none
   108)   
   109)   type(geomech_patch_type) :: geomech_patch
   110)   type(gm_region_list_type) :: regions
   111)   type(option_type) :: option
   112)   
   113)   type(gm_region_type), pointer :: cur_region
   114)   type(gm_region_type), pointer :: patch_region
   115)   
   116)   cur_region => regions%first
   117)   do
   118)     if (.not.associated(cur_region)) exit
   119)     patch_region => GeomechRegionCreate(cur_region)
   120)     call GeomechRegionAddToList(patch_region,geomech_patch%geomech_region_list)
   121)     cur_region => cur_region%next
   122)   enddo
   123)   
   124)  ! Need a call to a subroutine similar to GridlocalizeRegions 
   125)  ! call GridLocalizeRegions(patch%grid,patch%region_list,option)
   126)   call GeomechGridLocalizeRegions(geomech_patch%geomech_grid, &
   127)                                   geomech_patch%geomech_region_list, &
   128)                                   option)
   129)  
   130) end subroutine GeomechPatchLocalizeRegions
   131) 
   132) ! ************************************************************************** !
   133) 
   134) subroutine GeomechPatchProcessGeomechCouplers(patch,conditions,option)
   135)   ! 
   136)   ! Assigns conditions and regions to couplers
   137)   ! 
   138)   ! Author: Satish Karra, LANL
   139)   ! Date: 05/23/13
   140)   ! 
   141) 
   142)   use Option_module
   143)   use Geomechanics_Material_module
   144)   use Geomechanics_Condition_module
   145)   
   146)   implicit none
   147)   
   148)   type(geomech_patch_type) :: patch
   149)   type(geomech_condition_list_type) :: conditions
   150)   type(option_type) :: option
   151)   
   152)   type(geomech_coupler_type), pointer :: coupler
   153)   type(geomech_coupler_list_type), pointer :: coupler_list 
   154)   type(geomech_strata_type), pointer :: strata
   155)  ! type(geomech_observation_type), pointer :: observation, &
   156)  !                                                     next_observation
   157)   
   158)   PetscInt :: temp_int, isub
   159)   
   160)   ! boundary conditions
   161)   coupler => patch%geomech_boundary_condition_list%first
   162)   do
   163)     if (.not.associated(coupler)) exit
   164)     ! pointer to region
   165)     coupler%region => GeomechRegionGetPtrFromList(coupler%region_name, &
   166)                                                   patch%geomech_region_list)
   167)     if (.not.associated(coupler%region)) then
   168)       option%io_buffer = 'Geomech Region "' // trim(coupler%region_name) // &
   169)                  '" in Geomech boundary condition "' // &
   170)                  trim(coupler%name) // &
   171)                  '" not found in Geomech region list'
   172)       call printErrMsg(option)
   173)     endif
   174) 
   175)     ! pointer to geomech condition
   176)     if (option%ngeomechdof > 0) then
   177)       if (len_trim(coupler%geomech_condition_name) > 0) then
   178)         coupler%geomech_condition => &
   179)           GeomechConditionGetPtrFromList(coupler%geomech_condition_name, &
   180)                                          conditions)
   181)         if (.not.associated(coupler%geomech_condition)) then
   182)           option%io_buffer = 'Geomech condition "' // &
   183)                    trim(coupler%geomech_condition_name) // &
   184)                    '" in Geomech boundary condition "' // &
   185)                    trim(coupler%name) // &
   186)                    '" not found in geomech condition list'
   187)           call printErrMsg(option)
   188)         endif
   189)       else
   190)         option%io_buffer = &
   191)           'A GEOMECHANICS_CONDITION must be specified in ' // &
   192)           'GEOMECHANICS_BOUNDARY_CONDITION: ' // &
   193)            trim(coupler%name) // '.'
   194)         call printErrMsg(option)
   195)       endif
   196)     endif
   197)     coupler => coupler%next
   198)   enddo
   199) 
   200) 
   201)   ! SK: There are no initial conditions (at this point)
   202) 
   203)   ! source/sinks
   204)   coupler => patch%geomech_source_sink_list%first
   205)   do
   206)     if (.not.associated(coupler)) exit
   207)     ! pointer to region
   208)     coupler%region => GeomechRegionGetPtrFromList(coupler%region_name, &
   209)                                                   patch%geomech_region_list)
   210)     if (.not.associated(coupler%region)) then
   211)       option%io_buffer = 'Geomech Region "' // trim(coupler%region_name) // &
   212)                  '" in geomech source/sink "' // &
   213)                  trim(coupler%name) // &
   214)                  '" not found in geomech region list'
   215)       call printErrMsg(option)
   216)     endif
   217)     ! pointer to geomech condition
   218)     if (option%ngeomechdof > 0) then    
   219)       if (len_trim(coupler%geomech_condition_name) > 0) then
   220)         coupler%geomech_condition => &
   221)           GeomechConditionGetPtrFromList(coupler%geomech_condition_name, &
   222)                                          conditions)
   223)         if (.not.associated(coupler%geomech_condition)) then
   224)           option%io_buffer = 'Geomech condition "' // &
   225)                    trim(coupler%geomech_condition_name) // &
   226)                    '" in geomech source/sink "' // &
   227)                    trim(coupler%name) // &
   228)                    '" not found in geomech condition list'
   229)           call printErrMsg(option)
   230)         endif
   231)       else
   232)         option%io_buffer = &
   233)           'A GEOMECHANICS_CONDITION must be specified in ' // &
   234)           'GEOMECHANICS_SOURCE_SINK: ' // trim(coupler%name) // '.'
   235)         call printErrMsg(option)
   236)       endif
   237)     endif
   238)     coupler => coupler%next
   239)   enddo
   240) 
   241) !----------------------------  
   242) ! AUX  
   243)     
   244)   ! strata
   245)   ! connect pointers from strata to regions
   246)   strata => patch%geomech_strata_list%first
   247)   do
   248)     if (.not.associated(strata)) exit
   249)     ! pointer to region
   250)     if (len_trim(strata%region_name) > 1) then
   251)       strata%region => GeomechRegionGetPtrFromList(strata%region_name, &
   252)                                                    patch%geomech_region_list)
   253)       if (.not.associated(strata%region)) then
   254)         option%io_buffer = 'Geomech Region "' // trim(strata%region_name) // &
   255)                  '" in geomech strata not found in geomech region list'
   256)         call printErrMsg(option)
   257)       endif
   258)       if (strata%active) then
   259)         ! pointer to material
   260)         strata%material_property => &
   261)             GeomechanicsMaterialPropGetPtrFromArray( &
   262)                                         strata%material_property_name, &
   263)                                         patch%geomech_material_property_array)
   264)         if (.not.associated(strata%material_property)) then
   265)           option%io_buffer = 'Geomech Material "' // &
   266)                               trim(strata%material_property_name) // &
   267)                               '" not found in geomech material list'
   268)           call printErrMsg(option)
   269)         endif
   270)       endif
   271)     else
   272)       nullify(strata%region)
   273)       nullify(strata%material_property)
   274)     endif
   275)     strata => strata%next
   276)   enddo
   277) 
   278)   ! linkage of observation to regions and couplers must take place after
   279)   ! connection list have been created.
   280)   ! observation
   281) #if 0
   282)   observation => patch%observation_list%first
   283)   do
   284)     if (.not.associated(observation)) exit
   285)     next_observation => observation%next
   286)     select case(observation%itype)
   287)       case(OBSERVATION_SCALAR)
   288)         ! pointer to region
   289)         observation%region => RegionGetPtrFromList(observation%linkage_name, &
   290)                                                     patch%region_list)
   291)         if (.not.associated(observation%region)) then
   292)           option%io_buffer = 'Region "' // &
   293)                    trim(observation%linkage_name) // &
   294)                  '" in observation point "' // &
   295)                  trim(observation%name) // &
   296)                  '" not found in region list'                   
   297)           call printErrMsg(option)
   298)         endif
   299)         if (observation%region%num_cells == 0) then
   300)           ! remove the observation object
   301)           call ObservationRemoveFromList(observation,patch%observation)
   302)         endif
   303)       case(OBSERVATION_FLUX)
   304)         coupler => CouplerGetPtrFromList(observation%linkage_name, &
   305)                                          patch%boundary_condition_list)
   306)         if (associated(coupler)) then
   307)           observation%connection_set => coupler%connection_set
   308)         else
   309)           option%io_buffer = 'Boundary Condition "' // &
   310)                    trim(observation%linkage_name) // &
   311)                    '" not found in Boundary Condition list'
   312)           call printErrMsg(option)
   313)         endif
   314)         if (observation%connection_set%num_connections == 0) then
   315)           ! cannot remove from list, since there must be a global reduction
   316)           ! across all procs
   317)           ! therefore, just nullify connection set
   318)           nullify(observation%connection_set)
   319)         endif                                      
   320)     end select
   321)     observation => next_observation
   322)   enddo
   323) #endif
   324)  
   325) end subroutine GeomechPatchProcessGeomechCouplers
   326) 
   327) ! ************************************************************************** !
   328) 
   329) subroutine GeomechPatchInitAllCouplerAuxVars(patch,option)
   330)   ! 
   331)   ! Initializes coupler auxillary variables
   332)   ! within list
   333)   ! 
   334)   ! Author: Satish Karra, LANL
   335)   ! Date: 06/17/13
   336)   ! 
   337) 
   338)   use Option_module
   339)   
   340)   implicit none
   341)   
   342)   type(geomech_patch_type), pointer :: patch
   343)   type(option_type) :: option
   344)   
   345)   PetscBool :: force_update_flag = PETSC_TRUE
   346)   
   347)   call GeomechPatchInitCouplerAuxVars(patch%geomech_boundary_condition_list, &
   348)                                       patch, &
   349)                                       option)
   350)   call GeomechPatchInitCouplerAuxVars(patch%geomech_source_sink_list,patch, &
   351)                                       option)
   352) 
   353)   call GeomechPatchUpdateAllCouplerAuxVars(patch,force_update_flag,option)
   354) 
   355) end subroutine GeomechPatchInitAllCouplerAuxVars
   356) 
   357) ! ************************************************************************** !
   358) 
   359) subroutine GeomechPatchInitCouplerAuxVars(coupler_list,patch,option)
   360)   ! 
   361)   ! Initializes coupler auxillary variables
   362)   ! within list
   363)   ! 
   364)   ! Author: Satish Karra, LANL
   365)   ! Date: 06/17/13
   366)   ! 
   367) 
   368)   use Option_module
   369)   use Geomechanics_Global_Aux_module
   370)   use Geomechanics_Condition_module
   371)   
   372)   implicit none
   373)   
   374)   type(geomech_coupler_list_type), pointer :: coupler_list
   375)   type(geomech_patch_type), pointer :: patch
   376)   type(option_type) :: option
   377)   
   378)   PetscInt :: num_verts
   379)   PetscBool :: force_update_flag
   380)   
   381)   type(geomech_coupler_type), pointer :: coupler
   382)   PetscInt :: idof
   383)   character(len=MAXSTRINGLENGTH) :: string
   384)   
   385)   if (.not.associated(coupler_list)) return
   386)     
   387)   coupler => coupler_list%first
   388)   do
   389)     if (.not.associated(coupler)) exit
   390)     
   391)     if (associated(coupler%region)) then
   392)       num_verts = coupler%region%num_verts
   393)       if (associated(coupler%geomech_condition) .and. &
   394)           coupler%itype == GM_BOUNDARY_COUPLER_TYPE) then
   395)         if (associated(coupler%geomech_condition%displacement_x) .or. &
   396)             associated(coupler%geomech_condition%displacement_y) .or. &
   397)             associated(coupler%geomech_condition%displacement_z) .or. &
   398)             associated(coupler%geomech_condition%force_x) .or. &
   399)             associated(coupler%geomech_condition%force_y) .or. &
   400)             associated(coupler%geomech_condition%force_z)) then
   401)           ! allocate arrays that match the number of boundary vertices
   402)           allocate(coupler%geomech_aux_real_var(option%ngeomechdof,num_verts))
   403)           allocate(coupler%geomech_aux_int_var(1,num_verts))
   404)           coupler%geomech_aux_real_var = 0.d0
   405)           coupler%geomech_aux_int_var = 0
   406)         endif ! associated(coupler%geomech_condition%displacement_x)
   407)       else if (coupler%itype == GM_SRC_SINK_COUPLER_TYPE) then
   408)         option%io_buffer='Source/Sink not implemented for geomechanics.'
   409)         call printErrMsg(option)
   410)       endif ! coupler%itype == GM_SRC_SINK_COUPLER_TYPE
   411)     endif ! associated(coupler%region)
   412)       
   413)     coupler => coupler%next
   414)     
   415)   enddo
   416)   
   417) end subroutine GeomechPatchInitCouplerAuxVars
   418) 
   419) ! ************************************************************************** !
   420) 
   421) subroutine GeomechPatchUpdateAllCouplerAuxVars(patch,force_update_flag,option)
   422)   ! 
   423)   ! Updates auxiliary variables associated
   424)   ! with couplers in list
   425)   ! 
   426)   ! Author: Satish Karra, LANL
   427)   ! Date: 06/17/13
   428)   ! 
   429) 
   430)   use Option_module
   431)   
   432)   implicit none
   433)   
   434)   type(geomech_patch_type) :: patch
   435)   PetscBool :: force_update_flag
   436)   type(option_type) :: option
   437) 
   438)   !geh: no need to update initial conditions as they only need updating
   439)   !     once as performed in PatchInitCouplerAuxVars()
   440)   call GeomechPatchUpdateCouplerAuxVars(patch, &
   441)                                       patch%geomech_boundary_condition_list, &
   442)                                       force_update_flag,option)
   443)   call GeomechPatchUpdateCouplerAuxVars(patch,patch%geomech_source_sink_list, &
   444)                                         force_update_flag,option)
   445) 
   446) end subroutine GeomechPatchUpdateAllCouplerAuxVars
   447) 
   448) ! ************************************************************************** !
   449) 
   450) subroutine GeomechPatchUpdateCouplerAuxVars(patch,coupler_list, &
   451)                                             force_update_flag,option)
   452)   ! 
   453)   ! Updates auxiliary variables associated
   454)   ! with couplers in list
   455)   ! 
   456)   ! Author: Satish Karra, LANL
   457)   ! Date: 06/17/13
   458)   ! 
   459)                                      
   460)   use Option_module
   461)   use Geomechanics_Condition_module
   462)   use Geomechanics_Grid_module
   463)   use Geomechanics_Grid_Aux_module
   464) 
   465)   implicit none
   466)   
   467)   type(geomech_patch_type) :: patch
   468)   type(geomech_coupler_list_type), pointer :: coupler_list
   469)   PetscBool :: force_update_flag
   470)   type(option_type) :: option
   471)   
   472)   type(geomech_coupler_type), pointer :: coupler
   473)   type(geomech_condition_type), pointer :: geomech_condition
   474)   PetscBool :: update
   475)   character(len=MAXSTRINGLENGTH) :: string,string2
   476)   PetscErrorCode :: ierr
   477)   
   478)   PetscInt :: idof,num_verts
   479)   PetscInt :: ivertex,local_id,ghosted_id
   480)   
   481) 
   482)   if (.not.associated(coupler_list)) return
   483)  
   484)   coupler => coupler_list%first
   485)     
   486)   do
   487)     if (.not.associated(coupler)) exit    
   488)     if (associated(coupler%geomech_aux_real_var)) then
   489)       num_verts = coupler%region%num_verts
   490)       geomech_condition => coupler%geomech_condition
   491)       if (force_update_flag .or. &
   492)           GeomechConditionIsTransient(geomech_condition)) then
   493)         if (associated(geomech_condition%displacement_x)) then
   494)           select case(geomech_condition%displacement_x%itype)
   495)             case(DIRICHLET_BC)
   496)               coupler%geomech_aux_real_var(GEOMECH_DISP_X_DOF, &
   497)                                            1:num_verts) = &
   498)               geomech_condition%displacement_x%dataset%rarray(1)
   499)           end select
   500)         endif
   501)         if (associated(geomech_condition%displacement_y)) then
   502)           select case(geomech_condition%displacement_y%itype)
   503)             case(DIRICHLET_BC)
   504)               coupler%geomech_aux_real_var(GEOMECH_DISP_Y_DOF, &
   505)                                            1:num_verts) = &
   506)               geomech_condition%displacement_y%dataset%rarray(1)
   507)           end select
   508)         endif
   509)         if (associated(geomech_condition%displacement_z)) then
   510)           select case(geomech_condition%displacement_z%itype)
   511)             case(DIRICHLET_BC)
   512)               coupler%geomech_aux_real_var(GEOMECH_DISP_Z_DOF, &
   513)                                            1:num_verts) = &
   514)               geomech_condition%displacement_z%dataset%rarray(1)
   515)            end select
   516)         endif
   517)         if (associated(geomech_condition%force_x)) then
   518)           select case(geomech_condition%force_x%itype)
   519)             case(DIRICHLET_BC)
   520)               coupler%geomech_aux_real_var(GEOMECH_DISP_X_DOF, &
   521)                                            1:num_verts) = &
   522)               geomech_condition%force_x%dataset%rarray(1)
   523)             end select
   524)         endif
   525)         if (associated(geomech_condition%force_y)) then
   526)           select case(geomech_condition%force_y%itype)
   527)             case(DIRICHLET_BC)
   528)               coupler%geomech_aux_real_var(GEOMECH_DISP_Y_DOF, &
   529)                                            1:num_verts) = &
   530)               geomech_condition%force_y%dataset%rarray(1)
   531)              end select
   532)         endif
   533)         if (associated(geomech_condition%force_z)) then
   534)           select case(geomech_condition%force_z%itype)
   535)             case(DIRICHLET_BC)
   536)               coupler%geomech_aux_real_var(GEOMECH_DISP_Z_DOF, &
   537)                                            1:num_verts) = &
   538)               geomech_condition%force_z%dataset%rarray(1)
   539)           end select
   540)         endif        
   541)       endif
   542)     endif
   543) 
   544)     coupler => coupler%next
   545)   enddo
   546) 
   547) end subroutine GeomechPatchUpdateCouplerAuxVars
   548) 
   549) ! ************************************************************************** !
   550) 
   551) subroutine GeomechPatchGetDataset(patch,geomech_field,option,output_option, &
   552)                                   vec,ivar,isubvar,isubvar1)
   553)   ! 
   554)   ! Extracts variables indexed by ivar and isubvar
   555)   ! from a geomechanics patch
   556)   ! 
   557)   ! Author: Satish Karra, LANL
   558)   ! Date: 07/02/13
   559)   ! 
   560) 
   561)   use Geomechanics_Grid_module
   562)   use Geomechanics_Grid_Aux_module
   563)   use Option_module
   564)   use Output_Aux_module
   565)   use Geomechanics_Field_module
   566)   use Variables_module
   567) 
   568)   implicit none
   569) 
   570) #include "petsc/finclude/petscvec.h"
   571) #include "petsc/finclude/petscvec.h90"
   572) 
   573)   type(option_type), pointer :: option
   574)   !type(reaction_type), pointer :: reaction
   575)   type(output_option_type), pointer :: output_option
   576)   type(geomech_field_type), pointer :: geomech_field
   577)   type(geomech_patch_type), pointer :: patch  
   578)   Vec :: vec
   579)   PetscInt :: ivar
   580)   PetscInt :: isubvar
   581)   PetscInt, optional :: isubvar1
   582)   PetscInt :: iphase
   583) 
   584)   PetscInt :: local_id
   585)   type(geomech_grid_type), pointer :: grid
   586)   PetscReal, pointer :: vec_ptr(:)
   587)   PetscErrorCode :: ierr
   588) 
   589)   grid => patch%geomech_grid
   590) 
   591)   call GeomechGridVecGetArrayF90(grid,vec,vec_ptr,ierr)
   592)   
   593)   iphase = 1
   594)   
   595)   select case(ivar)
   596)     case(GEOMECH_DISP_X)
   597)       do local_id=1,grid%nlmax_node
   598)         vec_ptr(local_id) = &
   599)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   600)           grid%nL2G(local_id))%disp_vector(1)
   601)       enddo
   602)     case(GEOMECH_DISP_Y)
   603)       do local_id=1,grid%nlmax_node
   604)         vec_ptr(local_id) = &
   605)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   606)             grid%nL2G(local_id))%disp_vector(2)
   607)       enddo
   608)     case(GEOMECH_DISP_Z)
   609)       do local_id=1,grid%nlmax_node
   610)         vec_ptr(local_id) = &
   611)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   612)             grid%nL2G(local_id))%disp_vector(3)
   613)       enddo
   614)     case(STRAIN_XX)
   615)       do local_id=1,grid%nlmax_node
   616)         vec_ptr(local_id) = &
   617)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   618)             grid%nL2G(local_id))%strain(1)
   619)       enddo
   620)     case(STRAIN_YY)
   621)       do local_id=1,grid%nlmax_node
   622)         vec_ptr(local_id) = &
   623)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   624)             grid%nL2G(local_id))%strain(2)
   625)       enddo
   626)     case(STRAIN_ZZ)
   627)       do local_id=1,grid%nlmax_node
   628)         vec_ptr(local_id) = &
   629)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   630)             grid%nL2G(local_id))%strain(3)
   631)       enddo
   632)     case(STRAIN_XY)
   633)       do local_id=1,grid%nlmax_node
   634)         vec_ptr(local_id) = &
   635)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   636)             grid%nL2G(local_id))%strain(4)
   637)       enddo
   638)     case(STRAIN_YZ)
   639)       do local_id=1,grid%nlmax_node
   640)         vec_ptr(local_id) = &
   641)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   642)             grid%nL2G(local_id))%strain(5)
   643)       enddo
   644)     case(STRAIN_ZX)
   645)       do local_id=1,grid%nlmax_node
   646)         vec_ptr(local_id) = &
   647)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   648)             grid%nL2G(local_id))%strain(6)
   649)       enddo
   650)     case(STRESS_XX)
   651)       do local_id=1,grid%nlmax_node
   652)         vec_ptr(local_id) = &
   653)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   654)             grid%nL2G(local_id))%stress(1)
   655)       enddo
   656)     case(STRESS_YY)
   657)       do local_id=1,grid%nlmax_node
   658)         vec_ptr(local_id) = &
   659)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   660)             grid%nL2G(local_id))%stress(2)
   661)       enddo
   662)     case(STRESS_ZZ)
   663)       do local_id=1,grid%nlmax_node
   664)         vec_ptr(local_id) = &
   665)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   666)             grid%nL2G(local_id))%stress(3)
   667)       enddo
   668)     case(STRESS_XY)
   669)       do local_id=1,grid%nlmax_node
   670)         vec_ptr(local_id) = &
   671)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   672)             grid%nL2G(local_id))%stress(4)
   673)       enddo
   674)     case(STRESS_YZ)
   675)       do local_id=1,grid%nlmax_node
   676)         vec_ptr(local_id) = &
   677)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   678)             grid%nL2G(local_id))%stress(5)
   679)       enddo
   680)     case(STRESS_ZX)
   681)       do local_id=1,grid%nlmax_node
   682)         vec_ptr(local_id) = &
   683)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   684)             grid%nL2G(local_id))%stress(6)
   685)       enddo
   686)     case(GEOMECH_MATERIAL_ID)
   687)       do local_id=1,grid%nlmax_node
   688)         vec_ptr(local_id) = patch%imat(grid%nL2G(local_id))
   689)       enddo
   690)     case(GEOMECH_REL_DISP_X)
   691)       do local_id=1,grid%nlmax_node
   692)         vec_ptr(local_id) = &
   693)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   694)             grid%nL2G(local_id))%rel_disp_vector(1)
   695)       enddo
   696)     case(GEOMECH_REL_DISP_Y)
   697)       do local_id=1,grid%nlmax_node
   698)         vec_ptr(local_id) = &
   699)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   700)             grid%nL2G(local_id))%rel_disp_vector(2)
   701)       enddo
   702)     case(GEOMECH_REL_DISP_Z)
   703)       do local_id=1,grid%nlmax_node
   704)         vec_ptr(local_id) = &
   705)           patch%geomech_aux%GeomechGlobal%aux_vars(&
   706)             grid%nL2G(local_id))%rel_disp_vector(3)
   707)       enddo
   708)     case default
   709)       write(option%io_buffer, &
   710)             '(''IVAR ('',i3,'') not found in GeomechPatchGetDataset'')') ivar
   711)       call printErrMsg(option)
   712)   end select
   713) 
   714) end subroutine GeomechPatchGetDataset
   715) 
   716) ! ************************************************************************** !
   717) 
   718) subroutine GeomechanicsPatchDestroy(geomech_patch)
   719)   ! 
   720)   ! Destroys a new geomechanics patch  object
   721)   ! 
   722)   ! Author: Satish Karra, LANL
   723)   ! Date: 05/23/13
   724)   ! 
   725) 
   726)   implicit none
   727)   
   728)   type(geomech_patch_type), pointer :: geomech_patch
   729)   if (associated(geomech_patch%imat)) deallocate(geomech_patch%imat)
   730)   nullify(geomech_patch%imat)
   731)   
   732)   if (associated(geomech_patch%geomech_material_property_array)) &
   733)     deallocate(geomech_patch%geomech_material_property_array)
   734)   nullify(geomech_patch%geomech_material_property_array)
   735)   nullify(geomech_patch%geomech_material_properties)
   736) 
   737)   call GeomechStrataDestroyList(geomech_patch%geomech_strata_list)
   738)   call GeomechRegionDestroyList(geomech_patch%geomech_region_list)
   739)   
   740)   call GeomechCouplerDestroyList(geomech_patch%geomech_boundary_condition_list)
   741)   call GeomechCouplerDestroyList(geomech_patch%geomech_source_sink_list)
   742)   
   743)   nullify(geomech_patch%geomech_field)
   744)   nullify(geomech_patch%geomech_datasets)
   745)   
   746)   call GeomechAuxDestroy(geomech_patch%geomech_aux)
   747) 
   748)   deallocate(geomech_patch)
   749)   nullify(geomech_patch)
   750) 
   751) end subroutine GeomechanicsPatchDestroy
   752) 
   753) end module Geomechanics_Patch_module

generated by
Intel(R) C++/Fortran Compiler code-coverage tool
Web-Page Owner: Nobody