write_topology_tag Subroutine

private subroutine write_topology_tag(self, nx1, nx2, ny1, ny2, nz1, nz2, mesh_kind)

Type Bound

xml_writer_abstract

Arguments

Type IntentOptional Attributes Name
class(xml_writer_abstract), intent(inout) :: self
integer(kind=I4P), intent(in), optional :: nx1
integer(kind=I4P), intent(in), optional :: nx2
integer(kind=I4P), intent(in), optional :: ny1
integer(kind=I4P), intent(in), optional :: ny2
integer(kind=I4P), intent(in), optional :: nz1
integer(kind=I4P), intent(in), optional :: nz2
character(len=*), intent(in), optional :: mesh_kind

Calls

proc~~write_topology_tag~~CallsGraph proc~write_topology_tag xml_writer_abstract%write_topology_tag interface~str str proc~write_topology_tag->interface~str proc~chars string%chars proc~write_topology_tag->proc~chars proc~write_end_tag xml_writer_abstract%write_end_tag proc~write_topology_tag->proc~write_end_tag proc~write_self_closing_tag xml_writer_abstract%write_self_closing_tag proc~write_topology_tag->proc~write_self_closing_tag proc~write_start_tag xml_writer_abstract%write_start_tag proc~write_topology_tag->proc~write_start_tag proc~str_a_i1p str_a_I1P interface~str->proc~str_a_i1p proc~str_a_i2p str_a_I2P interface~str->proc~str_a_i2p proc~str_a_i4p str_a_I4P interface~str->proc~str_a_i4p proc~str_a_i8p str_a_I8P interface~str->proc~str_a_i8p proc~str_a_r4p str_a_R4P interface~str->proc~str_a_r4p proc~str_a_r8p str_a_R8P interface~str->proc~str_a_r8p proc~str_bol str_bol interface~str->proc~str_bol proc~str_i1p str_I1P interface~str->proc~str_i1p proc~str_i2p str_I2P interface~str->proc~str_i2p proc~str_i4p str_I4P interface~str->proc~str_i4p proc~str_i8p str_I8P interface~str->proc~str_i8p proc~str_r4p str_R4P interface~str->proc~str_r4p proc~str_r8p str_R8P interface~str->proc~str_r8p proc~strf_i1p strf_I1P interface~str->proc~strf_i1p proc~strf_i2p strf_I2P interface~str->proc~strf_i2p proc~strf_i4p strf_I4P interface~str->proc~strf_i4p proc~strf_i8p strf_I8P interface~str->proc~strf_i8p proc~strf_r4p strf_R4P interface~str->proc~strf_r4p proc~strf_r8p strf_R8P interface~str->proc~strf_r8p proc~stringify xml_tag%stringify proc~write_end_tag->proc~stringify proc~write_self_closing_tag->proc~stringify proc~write_start_tag->proc~stringify proc~str_a_i1p->proc~str_i1p proc~str_a_i2p->proc~str_i2p proc~str_a_i4p->proc~str_i4p proc~str_a_i8p->proc~str_i8p proc~str_a_r4p->proc~str_r4p proc~str_a_r8p->proc~str_r8p proc~compact_real_string compact_real_string proc~str_r4p->proc~compact_real_string proc~str_r8p->proc~compact_real_string proc~stringify->interface~str proc~stringify->proc~chars proc~attributes xml_tag%attributes proc~stringify->proc~attributes proc~end_tag xml_tag%end_tag proc~stringify->proc~end_tag proc~is_allocated string%is_allocated proc~stringify->proc~is_allocated proc~self_closing_tag xml_tag%self_closing_tag proc~stringify->proc~self_closing_tag proc~start_tag xml_tag%start_tag proc~stringify->proc~start_tag proc~self_closing_tag->proc~attributes proc~start_tag->proc~attributes

Called by

proc~~write_topology_tag~~CalledByGraph proc~write_topology_tag xml_writer_abstract%write_topology_tag proc~initialize~3 xml_writer_ascii_local%initialize proc~initialize~3->proc~write_topology_tag proc~initialize~5 xml_writer_binary_local%initialize proc~initialize~5->proc~write_topology_tag proc~initialize~6 xml_writer_appended%initialize proc~initialize~6->proc~write_topology_tag

Source Code

   subroutine write_topology_tag(self, nx1, nx2, ny1, ny2, nz1, nz2, mesh_kind)
   !< Write XML topology tag.
   class(xml_writer_abstract), intent(inout)        :: self      !< Writer.
   integer(I4P),               intent(in), optional :: nx1       !< Initial node of x axis.
   integer(I4P),               intent(in), optional :: nx2       !< Final node of x axis.
   integer(I4P),               intent(in), optional :: ny1       !< Initial node of y axis.
   integer(I4P),               intent(in), optional :: ny2       !< Final node of y axis.
   integer(I4P),               intent(in), optional :: nz1       !< Initial node of z axis.
   integer(I4P),               intent(in), optional :: nz2       !< Final node of z axis.
   character(*),               intent(in), optional :: mesh_kind !< Kind of mesh data: Float64, Float32, ecc.
   type(string)                                     :: buffer    !< Buffer string.

   buffer = ''
   select case(self%topology%chars())
   case('RectilinearGrid', 'StructuredGrid')
      buffer = 'WholeExtent="'//                             &
               trim(str(n=nx1))//' '//trim(str(n=nx2))//' '//&
               trim(str(n=ny1))//' '//trim(str(n=ny2))//' '//&
               trim(str(n=nz1))//' '//trim(str(n=nz2))//'"'
   case('PRectilinearGrid', 'PStructuredGrid')
      buffer = 'WholeExtent="'//                             &
               trim(str(n=nx1))//' '//trim(str(n=nx2))//' '//&
               trim(str(n=ny1))//' '//trim(str(n=ny2))//' '//&
               trim(str(n=nz1))//' '//trim(str(n=nz2))//'" GhostLevel="#"'
   case('PUnstructuredGrid')
      buffer = 'GhostLevel="0"'
   endselect
   call self%write_start_tag(name=self%topology%chars(), attributes=buffer%chars())
   ! parallel topologies peculiars
   select case(self%topology%chars())
   case('PRectilinearGrid')
      if (.not.present(mesh_kind)) then
         self%error = 1
         return
      endif
      call self%write_start_tag(name='PCoordinates')
      call self%write_self_closing_tag(name='PDataArray', attributes='type="'//trim(mesh_kind)//'"')
      call self%write_self_closing_tag(name='PDataArray', attributes='type="'//trim(mesh_kind)//'"')
      call self%write_self_closing_tag(name='PDataArray', attributes='type="'//trim(mesh_kind)//'"')
      call self%write_end_tag(name='PCoordinates')
   case('PStructuredGrid', 'PUnstructuredGrid')
      if (.not.present(mesh_kind)) then
         self%error = 1
         return
      endif
      call self%write_start_tag(name='PPoints')
      call self%write_self_closing_tag(name='PDataArray', &
                                       attributes='type="'//trim(mesh_kind)//'" NumberOfComponents="3" Name="Points"')
      call self%write_end_tag(name='PPoints')
   endselect
   endsubroutine write_topology_tag