|
33 | 33 | class VolMesh(HalfFace): |
34 | 34 | """Geometric implementation of a face data structure for volumetric meshes. |
35 | 35 |
|
36 | | - Attributes |
| 36 | + Parameters |
37 | 37 | ---------- |
38 | | - attributes : dict |
39 | | - A dictionary of general volmesh attributes. |
40 | | -
|
41 | | - * ``'name': "VolMesh"`` |
42 | | -
|
43 | | - default_vertex_attributes : dict |
44 | | - The names of pre-assigned vertex attributes and their default values. |
45 | | -
|
46 | | - * ``'x': 0.0`` |
47 | | - * ``'y': 0.0`` |
48 | | - * ``'z': 0.0`` |
49 | | -
|
50 | | - default_edge_attributes : dict |
51 | | - The default data attributes assigned to every new edge. |
52 | | - default_face_attributes : dict |
53 | | - The default data attributes assigned to every new face. |
54 | | - name : str |
55 | | - The name of the volmesh. |
56 | | - Shorthand for ``volmesh.attributes['name']`` |
57 | | -
|
58 | | - data : dict |
59 | | - The data representing the mesh. |
60 | | - The dict has the following structure: |
61 | | -
|
62 | | - * 'attributes' => dict |
63 | | - * 'dva' => dict |
64 | | - * 'dea' => dict |
65 | | - * 'dfa' => dict |
66 | | - * 'dca' => dict |
67 | | - * 'vertex' => dict |
68 | | - * 'halface' => dict |
69 | | - * 'cell' => dict |
70 | | - * 'plane' => dict |
71 | | - * 'edgedata' => dict |
72 | | - * 'facedata' => dict |
73 | | - * 'celldata' => dict |
74 | | - * 'max_int_key' => int |
75 | | - * 'max_int_hfkey' => int |
76 | | - * 'max_int_ckey' => int |
| 38 | + name: str, optional |
| 39 | + The name of the graph. |
| 40 | + Defaults to "Graph". |
| 41 | + default_vertex_attributes: dict, optional |
| 42 | + Default values for vertex attributes. |
| 43 | + default_edge_attributes: dict, optional |
| 44 | + Default values for edge attributes. |
| 45 | + default_face_attributes: dict, optional |
| 46 | + Default values for face attributes. |
| 47 | + default_cell_attributes: dict, optional |
| 48 | + Default values for cell attributes. |
77 | 49 |
|
78 | 50 | """ |
79 | 51 |
|
80 | 52 | bounding_box = volmesh_bounding_box |
81 | 53 | transform = volmesh_transform |
82 | 54 | transformed = volmesh_transformed |
83 | 55 |
|
84 | | - def __init__(self, name=None): |
85 | | - super(VolMesh, self).__init__() |
86 | | - self.attributes.update({'name': name or 'VolMesh'}) |
87 | | - self.default_vertex_attributes.update({'x': 0.0, 'y': 0.0, 'z': 0.0}) |
| 56 | + def __init__(self, |
| 57 | + name=None, |
| 58 | + default_vertex_attributes=None, |
| 59 | + default_edge_attributes=None, |
| 60 | + default_face_attributes=None, |
| 61 | + default_cell_attributes=None): |
| 62 | + name = name or 'VolMesh' |
| 63 | + _default_vertex_attributes = {'x': 0.0, 'y': 0.0, 'z': 0.0} |
| 64 | + _default_edge_attributes = {} |
| 65 | + _default_face_attributes = {} |
| 66 | + _default_cell_attributes = {} |
| 67 | + if default_vertex_attributes: |
| 68 | + _default_vertex_attributes.update(default_vertex_attributes) |
| 69 | + if default_edge_attributes: |
| 70 | + _default_edge_attributes.update(default_edge_attributes) |
| 71 | + if default_face_attributes: |
| 72 | + _default_face_attributes.update(default_face_attributes) |
| 73 | + if default_cell_attributes: |
| 74 | + _default_cell_attributes.update(default_cell_attributes) |
| 75 | + super(VolMesh, self).__init__(name=name, |
| 76 | + default_vertex_attributes=_default_vertex_attributes, |
| 77 | + default_edge_attributes=_default_edge_attributes, |
| 78 | + default_face_attributes=_default_face_attributes, |
| 79 | + default_cell_attributes=_default_cell_attributes) |
88 | 80 |
|
89 | 81 | def __str__(self): |
90 | 82 | tpl = "<VolMesh with {} vertices, {} faces, {} cells, {} edges>" |
|
0 commit comments