本文整理汇总了Python中dolfin_utils.meshconvert.meshconvert.DataHandler类的典型用法代码示例。如果您正苦于以下问题:Python DataHandler类的具体用法?Python DataHandler怎么用?Python DataHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DataHandler类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, cell_type, mesh_dim, test):
DataHandler.__init__(self)
self.vertices, self.cells, self.functions = [], [], {}
self.vertices_ended = self.cells_ended = self.closed = False
self.__type, self.__dim = cell_type, mesh_dim
self.__test = test
test.assertEqual(self._state, self.State_Invalid)
self.test_warnings = []
示例2: end_meshfunction
def end_meshfunction(self):
DataHandler.end_meshfunction(self)
self.__curfunc[-1] = True
示例3: add_entity_meshfunction
def add_entity_meshfunction(self, index, value):
DataHandler.add_entity_meshfunction(self, index, value)
self.__curfunc[2][index] = value
示例4: start_meshfunction
def start_meshfunction(self, name, dim, sz):
DataHandler.start_meshfunction(self, name, dim, sz)
entries = []
for i in range(sz):
entries.append(None)
self.__curfunc = self.functions[name] = [dim, sz, entries, False]
示例5: end_cells
def end_cells(self):
DataHandler.end_cells(self)
self.cells_ended = True
示例6: add_cell
def add_cell(self, cell, nodes):
DataHandler.add_cell(self, cell, nodes)
self.cells[cell] = tuple(nodes)
示例7: start_cells
def start_cells(self, num_cells):
DataHandler.start_cells(self, num_cells)
for i in range(num_cells):
self.cells.append(None)
示例8: end_vertices
def end_vertices(self):
DataHandler.end_vertices(self)
self.vertices_ended = True
示例9: add_vertex
def add_vertex(self, vertex, coords):
DataHandler.add_vertex(self, vertex, coords)
self.vertices[vertex] = tuple(coords)
示例10: start_vertices
def start_vertices(self, num_vertices):
DataHandler.start_vertices(self, num_vertices)
self.vertices = []
for i in range(num_vertices):
self.vertices.append(None)
示例11: set_mesh_type
def set_mesh_type(self, *args):
DataHandler.set_mesh_type(self, *args)
test = self.__test
test.assertEqual(self._state, self.State_Init)
test.assertEqual(self._cell_type, self.__type)
test.assertEqual(self._dim, self.__dim)
示例12: close
def close(self):
DataHandler.close(self)
self.__test.assertEqual(self._state, self.State_Invalid)
self.closed = True