本文整理匯總了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