MCPcopy Create free account
hub / github.com/Apress/python-for-matlab-development / load_model

Function load_model

pythran/fem/triangle_utils.py:120–135  ·  view source on GitHub ↗

Reads .node and .ele files created by triangle and returns a dict of nodes and triangular elements.

(base_file)

Source from the content-addressed store, hash-verified

118 return np.array(elements)
119# }}}
120def load_model(base_file): # {{{
121 """
122 Reads <base_file>.node and <base_file>.ele files
123 created by triangle and returns a dict of
124 nodes and triangular elements.
125 """
126
127 node_file = f'{base_file}.node'
128 elem_file = f'{base_file}.ele'
129
130 return {
131 'vertices' : load_node_file(node_file),
132 'triangles' : load_ele_file( elem_file) - 1, # 0-based indexing
133 'constrained_x' : np.array([]),
134 'constrained_y' : np.array([]),
135 }
136# }}}
137def main(): # {{{
138 if len(sys.argv) < 2:

Callers 1

mainFunction · 0.70

Calls 2

load_node_fileFunction · 0.70
load_ele_fileFunction · 0.70

Tested by

no test coverage detected