本文整理匯總了Python中sfepy.base.base.OneTypeList.get_names方法的典型用法代碼示例。如果您正苦於以下問題:Python OneTypeList.get_names方法的具體用法?Python OneTypeList.get_names怎麽用?Python OneTypeList.get_names使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sfepy.base.base.OneTypeList
的用法示例。
在下文中一共展示了OneTypeList.get_names方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Domain
# 需要導入模塊: from sfepy.base.base import OneTypeList [as 別名]
# 或者: from sfepy.base.base.OneTypeList import get_names [as 別名]
#.........這裏部分代碼省略.........
sorted_regions = sort_by_dependency(graph)
##
# Define regions.
for name in sorted_regions:
sort_name = name_to_sort_name[name]
rdef = region_defs[sort_name]
region = self.create_region(name, rdef.select,
kind=rdef.get('kind', 'cell'),
parent=rdef.get('parent', None),
check_parents=False,
functions=functions)
output(' ', region.name)
output('...done in %.2f s' % (time.clock() - tt))
return self.regions
def save_regions(self, filename, region_names=None):
"""
Save regions as individual meshes.
Parameters
----------
filename : str
The output filename.
region_names : list, optional
If given, only the listed regions are saved.
"""
import os
if region_names is None:
region_names = self.regions.get_names()
trunk, suffix = os.path.splitext(filename)
output('saving regions...')
for name in region_names:
region = self.regions[name]
output(name)
aux = self.mesh.from_region(region, self.mesh)
aux.write('%s_%s%s' % (trunk, region.name, suffix),
io='auto')
output('...done')
def save_regions_as_groups(self, filename, region_names=None):
"""
Save regions in a single mesh but mark them by using different
element/node group numbers.
If regions overlap, the result is undetermined, with exception of the
whole domain region, which is marked by group id 0.
Region masks are also saved as scalar point data for output formats
that support this.
Parameters
----------
filename : str
The output filename.
region_names : list, optional
If given, only the listed regions are saved.
"""
output('saving regions as groups...')
示例2: Domain
# 需要導入模塊: from sfepy.base.base import OneTypeList [as 別名]
# 或者: from sfepy.base.base.OneTypeList import get_names [as 別名]
#.........這裏部分代碼省略.........
sorted_regions = sort_by_dependency(graph)
##
# Define regions.
for name in sorted_regions:
sort_name = name_to_sort_name[name]
rdef = region_defs[sort_name]
region = self.create_region(name, rdef.select,
kind=rdef.get('kind', 'cell'),
parent=rdef.get('parent', None),
check_parents=False,
functions=functions)
output(' ', region.name)
output('...done in %.2f s' % (time.clock() - tt))
return self.regions
def save_regions(self, filename, region_names=None):
"""
Save regions as individual meshes.
Parameters
----------
filename : str
The output filename.
region_names : list, optional
If given, only the listed regions are saved.
"""
import os
if region_names is None:
region_names = self.regions.get_names()
trunk, suffix = os.path.splitext(filename)
output('saving regions...')
for name in region_names:
region = self.regions[name]
output(name)
aux = self.mesh.from_region(region, self.mesh)
aux.write('%s_%s%s' % (trunk, region.name, suffix),
io='auto')
output('...done')
def save_regions_as_groups(self, filename, region_names=None):
"""
Save regions in a single mesh but mark them by using different
element/node group numbers.
If regions overlap, the result is undetermined, with exception of the
whole domain region, which is marked by group id 0.
Region masks are also saved as scalar point data for output formats
that support this.
Parameters
----------
filename : str
The output filename.
region_names : list, optional
If given, only the listed regions are saved.
"""
output('saving regions as groups...')