original_docstring: Write the grid to file
          
          This methods writes the grid to a file specified by path. The gr3
          format is implemented as appear in SCHISM manual.
          
docstring: Write the grid to file
  This methods writes the grid to a file specified by path. The gr3
  format is implemented as appear in SCHISM manual.
docstring_tokens: Write the grid to file This methods writes the grid to a file specified by path . The gr3 format is implemented as appear in SCHISM manual .
code: def write(self, fname, fmt='%16.10f', overwrite=False) -> None:
          """Write the grid to file
          
          This methods writes the grid to a file specified by path. The gr3
          format is implemented as appear in SCHISM manual.
          """
          nodefmt=['%10i', '%16.10f', '%16.10f', fmt]
  
          if os.path.exists(fname) & ~overwrite:
              raise Exception('File exists! Set overwrite=True to overwrite.')
          else:
              with open(fname, 'w') as f:
                  f.write(f"{self['header']}\n")
                  f.write(f"{self['nelem']}\t{self['nnode']} ")
                  f.write("! # of elements and nodes in the horizontal grid\n")
                  np.savetxt(fname=f, X=self.nodes, fmt=nodefmt)
  
          # write element table if exist
          if 'elems' in self:
              with open(fname, 'a') as f:
                  for i in np.arange(self['nelem']):
                      inodes = self['elems'][i]
                      f.write(f'{i+1:10d}\t')
                      i34 = self['elemtype'][i] # 3 or 4 node elements
                      f.write(f'{i34:2d}\t')
                      for n in np.arange(i34):
                          f.write(f'{inodes[n]:9d}\t')
                      f.write('\n')
code_tokens: def write ( self , fname , fmt = '%16.10f' , overwrite = False ) -> None : nodefmt = [ '%10i' , '%16.10f' , '%16.10f' , fmt ] if os . path . exists ( fname ) & ~ overwrite : raise Exception ( 'File exists! Set overwrite=True to overwrite.' ) else : with open ( fname , 'w' ) as f : f . write ( f"{self['header']}\n" ) f . write ( f"{self['nelem']}\t{self['nnode']} " ) f . write ( "! # of elements and nodes in the horizontal grid\n" ) np . savetxt ( fname = f , X = self . nodes , fmt = nodefmt ) if 'elems' in self : with open ( fname , 'a' ) as f : for i in np . arange ( self [ 'nelem' ] ) : inodes = self [ 'elems' ] [ i ] f . write ( f'{i+1:10d}\t' ) i34 = self [ 'elemtype' ] [ i ] f . write ( f'{i34:2d}\t' ) for n in np . arange ( i34 ) : f . write ( f'{inodes[n]:9d}\t' ) f . write ( '\n' )
short_docstring: Write the grid to file
  This methods writes the grid to a file specified by path.
short_docstring_tokens: Write the grid to file This methods writes the grid to a file specified by path .
comment: """Write the grid to file
          
          This methods writes the grid to a file specified by path. The gr3
          format is implemented as appear in SCHISM manual.
          """$SEP$# write element table if exist$SEP$# 3 or 4 node elements