Package solvcon :: Package io :: Module genesis :: Class Genesis
[hide private]
[frames] | no frames]

Class Genesis

source code

   object --+    
            |    
netcdf.NetCDF --+
                |
               Genesis

Model of Genesis/ExodusII file, based on netCDF reader wrapper. The Genesis/ExodusII file must meet the following criteria: (i) have at least one block, (ii) each block needs a name, and (iii) each sideset (BC) needs a name.

Instance Methods [hide private]
 
__init__(self, *arg, **kw)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
str
get_attr_text(self, name, varname)
Get the attribute text attached to an variable.
source code
 
load(self)
Load mesh data.
source code
solvcon.block.Block
toblock(self, onlybcnames=None, bcname_mapper=None, fpdtype=None)
Convert Cubit/Genesis/ExodusII object to Block object.
source code
 
_convert_interior_to(self, blk)
Convert interior connectivities to Block object.
source code
 
_convert_bc_to(self, blk, onlynames=None, name_mapper=None)
Convert boundary condition information into Block object.
source code
solvcon.boundcond.BC
_tobc(self, ibc, blk)
Extract boundary condition information from self to become a BC object.
source code

Inherited from netcdf.NetCDF: __getattr__, close_file, get_array, get_dim, get_lines, open_file

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

Class Variables [hide private]
  CLTPN_MAP = {'HEX8': 4, 'PYRAMID': 7, 'QUAD': 2, 'TETRA': 5, '...
  CLFCS_MAP = {2: [1, 2, 3, 4], 3: [1, 2, 3], 4: [5, 2, 6, 4, 1,...

Inherited from netcdf.NetCDF: NC2_ERR, NC4_FIRST_ERROR, NC4_LAST_ERROR, NC_64BIT_OFFSET, NC_ALIGN_CHUNK, NC_BYTE, NC_CHAR, NC_CHUNKED, NC_CLASSICAL_MODE, NC_CLOBBER, NC_COMPOUND, NC_CONTIGUOUS, NC_DOUBLE, NC_EATTEXISTS, NC_EATTMETA, NC_EAXISTYPE, NC_EBADCHUNK, NC_EBADCLASS, NC_EBADDIM, NC_EBADFIELD, NC_EBADGRPID, NC_EBADID, NC_EBADNAME, NC_EBADTYPE, NC_EBADTYPID, NC_ECANTCREATE, NC_ECANTREAD, NC_ECANTWRITE, NC_ECHAR, NC_ECURL, NC_EDAP, NC_EDAPCONSTRAINT, NC_EDAPSVC, NC_EDAPURL, NC_EDAS, NC_EDATADDS, NC_EDDS, NC_EDIMMETA, NC_EDIMSCALE, NC_EDIMSIZE, NC_EEDGE, NC_EEXIST, NC_EFILEMETA, NC_EGLOBAL, NC_EHDFERR, NC_EINDEFINE, NC_EINVAL, NC_EINVALCOORDS, NC_EIO, NC_ELATEDEF, NC_ELATEFILL, NC_EMAPTYPE, NC_EMAXATTS, NC_EMAXDIMS, NC_EMAXNAME, NC_EMAXVARS, NC_ENAMEINUSE, NC_ENDIAN_BIG, NC_ENDIAN_LITTLE, NC_ENDIAN_NATIVE, NC_ENFILE, NC_ENOCOMPOUND, NC_ENODATA, NC_ENOGRP, NC_ENOMEM, NC_ENOPAR, NC_ENORECVARS, NC_ENOTATT, NC_ENOTBUILT, NC_ENOTINDEFINE, NC_ENOTNC, NC_ENOTNC3, NC_ENOTNC4, NC_ENOTVAR, NC_ENUM, NC_EPARINIT, NC_EPERM, NC_ERANGE, NC_ESTORAGE, NC_ESTRICTNC3, NC_ESTRIDE, NC_ESTS, NC_ETRUNC, NC_ETYPDEFINED, NC_EUNLIMIT, NC_EUNLIMPOS, NC_EVARMETA, NC_EVARSIZE, NC_FILL, NC_FILL_BYTE, NC_FILL_CHAR, NC_FILL_DOUBLE, NC_FILL_FLOAT, NC_FILL_INT, NC_FILL_INT64, NC_FILL_SHORT, NC_FILL_STRING, NC_FILL_UBYTE, NC_FILL_UINT, NC_FILL_UINT64, NC_FILL_USHORT, NC_FLETCHER32, NC_FLOAT, NC_FORMAT_64BIT, NC_FORMAT_CLASSIC, NC_FORMAT_NETCDF4, NC_FORMAT_NETCDF4_CLASSIC, NC_GLOBAL, NC_INT, NC_INT64, NC_LOCK, NC_LONG, NC_MAX_ATTRS, NC_MAX_BYTE, NC_MAX_CHAR, NC_MAX_DIMS, NC_MAX_DOUBLE, NC_MAX_FLOAT, NC_MAX_INT, NC_MAX_INT64, NC_MAX_NAME, NC_MAX_SHORT, NC_MAX_UBYTE, NC_MAX_UINT, NC_MAX_UINT64, NC_MAX_USHORT, NC_MAX_VARS, NC_MAX_VAR_DIMS, NC_MIN_BYTE, NC_MIN_DOUBLE, NC_MIN_FLOAT, NC_MIN_INT, NC_MIN_INT64, NC_MIN_SHORT, NC_MPIIO, NC_MPIPOSIX, NC_NAT, NC_NETCDF4, NC_NOCHECKSUM, NC_NOCLOBBER, NC_NOERR, NC_NOFILL, NC_NOSHUFFLE, NC_NOWRITE, NC_OPAQUE, NC_PNETXCDF, NC_SHARE, NC_SHORT, NC_SHUFFLE, NC_SIZEHINT_DEFAULT, NC_STRING, NC_UBYTE, NC_UINT, NC_UINT64, NC_UNLIMITED, NC_USHORT, NC_VLEN, NC_WRITE, X_INT64_MAX, X_INT64_MIN, X_UINT64_MAX

Inherited from netcdf.NetCDF (private): _FillValue

Instance Variables [hide private]
  bcs
list of tuples of (name, elem, side) for each BC (Genesis sideset).
  blks
list of tuples of (name, type_name, clnds) for each Genesis block.
  ncell
number of cells/elements.
  ndcrd
coordiate array.
  ndim
dimension (2 or 3).
  nnode
number of nodes.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *arg, **kw)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • path - the file to open.
  • omode - opening mode.
Overrides: object.__init__
(inherited documentation)

get_attr_text(self, name, varname)

source code 

Get the attribute text attached to an variable.

Parameters:
  • name (str) - name of the attribute.
  • varname (str) - name of the variable.
Returns: str
the text.

load(self)

source code 

Load mesh data.

Returns:
nothing

toblock(self, onlybcnames=None, bcname_mapper=None, fpdtype=None)

source code 

Convert Cubit/Genesis/ExodusII object to Block object.

Parameters:
  • onlybcnames (list) - positively list wanted names of BCs.
  • bcname_mapper (dict) - map name to bc type number.
  • fpdtype (str) - floating-point dtype.
Returns: solvcon.block.Block
Block object.

_convert_interior_to(self, blk)

source code 

Convert interior connectivities to Block object.

Parameters:
  • blk (solvcon.block.Block) - to-be-written Block object.
Returns:
nothing

_convert_bc_to(self, blk, onlynames=None, name_mapper=None)

source code 

Convert boundary condition information into Block object.

Parameters:
  • blk (solvcon.block.Block) - to-be-written Block object.
  • onlynames (list) - positively list wanted names of BCs.
  • name_mapper (dict) - map name to bc type and value dictionary; the two objects are organized in a tuple.
Returns:
nothing.

_tobc(self, ibc, blk)

source code 

Extract boundary condition information from self to become a BC object. Only process element/cell type of boundary information.

Parameters:
  • ibc (int) - index of the BC to be extracted.
  • blk (solvcon.block.Block) - Block object for reference, nothing will be altered.
Returns: solvcon.boundcond.BC
generic BC object.

Class Variable Details [hide private]

CLTPN_MAP

Value:
{'HEX8': 4,
 'PYRAMID': 7,
 'QUAD': 2,
 'TETRA': 5,
 'TRI3': 3,
 'WEDGE': 6}

CLFCS_MAP

Value:
{2: [1, 2, 3, 4],
 3: [1, 2, 3],
 4: [5, 2, 6, 4, 1, 3],
 5: [2, 4, 3, 1],
 6: [4, 5, 3, 1, 2],
 7: [2, 3, 4, 1, 5]}