Package solvcon :: Package io :: Module block :: Class TrivialBlockFormat
[hide private]
[frames] | no frames]

Class TrivialBlockFormat

source code

 object --+        
          |        
core.Format --+    
              |    
    BlockFormat --+
                  |
                 TrivialBlockFormat

Simplest blk format.

Nested Classes [hide private]

Inherited from BlockFormat: __metaclass__

Instance Methods [hide private]
 
_save_meta(self, blk, stream)
Returns: nothing.
source code

Inherited from BlockFormat: __init__, load, save

Inherited from core.Format: read_meta

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
_save_bclist(cls, blk, stream)
Returns: nothing.
source code
 
_save_boundcond(cls, compressor, blk, stream)
Returns: nothing.
source code
solvcon.gendata.AttributeDict
_parse_meta(cls, lines)
Parse meta information from the file.
source code
list
_load_bclist(cls, meta, lines, blk)
Returns: BC information.
source code
 
_load_boundcond(cls, meta, bcsinfo, fpdtype, stream, blk)
Returns: nothing.
source code

Inherited from core.Format (private): _get_textpart

Static Methods [hide private]

Inherited from BlockFormat (private): _construct_subarrays, _convert_bc

Inherited from core.Format (private): _read_array, _write_array

Class Variables [hide private]
  FORMAT_REV = '0.0.1'
revision of format; must be overridden.
  SPEC_OF_META = (('GLOBAL', <type 'str'>), ('SWITCH', <function...
the order and converter of each meta-data section occured in the text part; must be overridden.
  META_GLOBAL = ('FORMAT_REV', 'compressor')
  META_DESC = ('fpdtypestr')
  META_GEOM = ('blkn', 'FCMND', 'CLMND', 'CLMFC', 'ndim', 'nnode...
  META_SWITCH = ()
  META_ATT = ('ngroup', 'nbc')
  meta_length = 17
length of all META_ entries; calculated by FormatMeta.

Inherited from BlockFormat: FILE_HEADER

Inherited from core.Format: BINARY_MARKER, READ_BLOCK

Instance Variables [hide private]

Inherited from BlockFormat: compressor, fpdtype

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_save_meta(self, blk, stream)

source code 
Parameters:
  • blk (solvcon.block.Block) - block object to alter.
  • stream (file) - output stream.
Returns:
nothing.

_save_bclist(cls, blk, stream)
Class Method

source code 
Parameters:
  • blk (solvcon.block.Block) - block object to alter.
  • stream (file) - output stream.
Returns:
nothing.
Overrides: BlockFormat._save_bclist

_save_boundcond(cls, compressor, blk, stream)
Class Method

source code 
Parameters:
  • compressor (str) - the compression to use: '', 'gz', or 'bz2'
  • blk (solvcon.block.Block) - block object to alter.
  • stream (file or str) - file object or file name to be read.
Returns:
nothing.
Overrides: BlockFormat._save_boundcond

_parse_meta(cls, lines)
Class Method

source code 

Parse meta information from the file.

Parameters:
  • lines (list) - text part of the file.
Returns: solvcon.gendata.AttributeDict
meta information dictionary.
Overrides: core.Format._parse_meta

_load_bclist(cls, meta, lines, blk)
Class Method

source code 
Parameters:
  • meta (solvcon.gendata.AttributeDict) - meta information dictionary.
  • lines (list) - text data
  • blk (solvcon.block.Block) - Block object to load to.
Returns: list
BC information.
Overrides: BlockFormat._load_bclist

_load_boundcond(cls, meta, bcsinfo, fpdtype, stream, blk)
Class Method

source code 
Parameters:
  • meta (solvcon.gendata.AttributeDict) - meta information dictionary.
  • bcsinfo (list) - list for information tuples for BCs.
  • fpdtype (numpy.dtype) - fpdtype for the to-be-created BC objects.
  • stream (file) - input stream.
  • blk (solvcon.block.Block) - block object to alter.
Returns:
nothing.
Overrides: BlockFormat._load_boundcond

Class Variable Details [hide private]

SPEC_OF_META

the order and converter of each meta-data section occured in the text part; must be overridden.
Value:
(('GLOBAL', <type 'str'>),
 ('SWITCH', <function strbool at 0x31817d0>),
 ('DESC', <type 'str'>),
 ('GEOM', <type 'int'>),
 ('ATT', <type 'int'>))

META_GEOM

Value:
('blkn',
 'FCMND',
 'CLMND',
 'CLMFC',
 'ndim',
 'nnode',
 'nface',
 'ncell',
...