本文整理汇总了Python中mydict.Dict.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Dict.__init__方法的具体用法?Python Dict.__init__怎么用?Python Dict.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mydict.Dict
的用法示例。
在下文中一共展示了Dict.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from mydict import Dict [as 别名]
# 或者: from mydict.Dict import __init__ [as 别名]
def __init__(self,kind,keys,set=None,output='FILE',freq=1,time=False,
**kargs):
"""Create new result request.
kind = 'NODE' or 'ELEMENT' (actually, the first character suffices)
keys is a list of output identifiers (compatible with kind type)
set is single item or a list of items, where each item is either:
- a property number
- a node/elem set name
for which the results should be written
If no set is specified, the default is 'Nall' for kind=='NODE'
and 'Eall' for kind='ELEMENT'
output is either 'FILE' (.fil) or 'PRINT' (.dat)(Standard only)
freq is the output frequency in increments (0 = no output)
Extra keyword arguments are available: see the writeNodeResults and
writeElemResults functions for details.
"""
kind = kind[0].upper()
if set is None:
set = "%sall" % kind
Dict.__init__(self,{'keys':keys,'kind':kind,'set':set,'output':output,
'freq':freq})
self.update(dict(**kargs))
示例2: __init__
# 需要导入模块: from mydict import Dict [as 别名]
# 或者: from mydict.Dict import __init__ [as 别名]
def __init__(self,coords,elems):
"""Create new model data.
coords is an array with nodal coordinates
elems is either a single element connectivity array, or a list of such.
In a simple case, coords and elems can be the arrays obtained by
``coords, elems = F.feModel()``.
This is however limited to a model where all elements have the same
number of nodes. Then you can use the list of elems arrays. The 'fe'
plugin has a helper function to create this list. E.g., if ``FL`` is a
list of Formices (possibly with different plexitude), then
``fe.mergeModels([Fi.feModel() for Fi in FL])``
will return the (coords,elems) tuple to create the Model.
The model can have node and element property numbers.
"""
Dict.__init__(self)
if not type(elems) == list:
elems = [ elems ]
self.coords = Coords(coords)
self.elems = [ Connectivity(e) for e in elems ]
nelems = [ e.nelems() for e in self.elems ]
nplex = [ e.nplex() for e in self.elems ]
self.celems = cumsum([0]+nelems)
GD.message("Number of nodes: %s" % self.coords.shape[0])
GD.message("Number of elements: %s" % self.celems[-1])
GD.message("Number of element groups: %s" % len(nelems))
GD.message("Number of elements per group: %s" % nelems)
GD.message("Plexitude of each group: %s" % nplex)
示例3: __init__
# 需要导入模块: from mydict import Dict [as 别名]
# 或者: from mydict.Dict import __init__ [as 别名]
def __init__(self,kind=None,keys=None,set=None,type='FIELD',variable='PRESELECT',extra='',**options):
""" Create new output request.
- `type`: 'FIELD' or 'HISTORY'
- `kind`: None, 'NODE', or 'ELEMENT' (first character suffices)
- `extra`: an extra string to be added to the command line. This
allows to add Abaqus options not handled by this constructor.
The string will be appended to the command line preceded by a comma.
For kind=='':
- `variable`: 'ALL', 'PRESELECT' or ''
For kind=='NODE' or 'ELEMENT':
- `keys`: a list of output identifiers (compatible with kind type)
- `set`: a single item or a list of items, where each item is either
a property number or a node/element set name for which the results
should be written. If no set is specified, the default is 'Nall'
for kind=='NODE' and 'Eall' for kind='ELEMENT'
"""
if 'history' in options:
GD.warning("The `history` argument in an output request is deprecated.\nPlease use `type='history'` instead.")
if 'numberinterval' in options:
GD.warning("The `numberinterval` argument in an output request is deprecated.\nPlease use the `extra` argument instead.")
if kind:
kind = kind[0].upper()
if set is None:
set = "%sall" % kind
Dict.__init__(self,{'kind':kind})
if kind is None:
self.update({'type':type,'variable':variable,'extra':extra})
else:
self.update({'keys':keys,'set':set})
示例4: __init__
# 需要导入模块: from mydict import Dict [as 别名]
# 或者: from mydict.Dict import __init__ [as 别名]
def __init__(self):
"""Create a new properties database."""
Dict.__init__(self)
self.mats = MaterialDB()
self.sect = SectionDB()
self.prop = []
self.nprop = []
self.eprop = []
示例5: __init__
# 需要导入模块: from mydict import Dict [as 别名]
# 或者: from mydict.Dict import __init__ [as 别名]
def __init__(self,mat='',sec=''):
"""Create a new properties database."""
setMaterialDB(mat)
setSectionDB(sec)
Dict.__init__(self)
self.prop = []
self.nprop = []
self.eprop = []
示例6: __init__
# 需要导入模块: from mydict import Dict [as 别名]
# 或者: from mydict.Dict import __init__ [as 别名]
def __init__(self, data={}, default=None):
"""Creates a new Config instance.
The configuration can be initialized with a dictionary, or
with a variable that can be passed to the read() function.
The latter includes the name of a config file, or a multiline string
holding the contents of a configuration file.
"""
Dict.__init__(self, default=default)
if isinstance(data, dict):
self.update(data)
elif data:
self.read(data)
示例7: __init__
# 需要导入模块: from mydict import Dict [as 别名]
# 或者: from mydict.Dict import __init__ [as 别名]
def __init__(self,**kargs):
"""Create a new set of CanvasSettings."""
Dict.__init__(self)
self.reset(kargs)