for element in S.elements.values(): faces.append(element.nodes) try: clear_layer(layer_output) except: create_layer(layer_output) vertices = S.nodes_xyz() xdraw_mesh(name='welded_mesh', vertices=vertices, faces=faces, layer=layer_output) # ============================================================================== # Debugging # ============================================================================== if __name__ == "__main__": from compas_fea.structure import Structure # mdl = Structure.load_from_obj(filename='/home/al/compas/compas_fea/data/_workshop/example_tets.obj') # plot_voxels(mdl, step='step_load', field='smises', vdx=0.100) mdl = Structure.load_from_obj(filename='C:/Temp/block_tets.obj') plot_voxels(mdl, step='step_load', field='um', vdx=0.010)
result = postprocess(self.nodes, self.elements, self.ux, self.uy, self.uz, data, 'element', 1, cbar, 255, iptype, nodal) toc, _, cnodes, *_ = result self.update_vertices_colors( {i: j for i, j in enumerate(cnodes)}) self.update_statusbar('Plotting: {0:.3f} s'.format(toc)) except: pass # ============================================================================== # Main # ============================================================================== if __name__ == "__main__": from compas_fea.structure import Structure # fnm = '/home/al/compas/compas_fea/data/_workshop/example_truss.obj' # fnm = '/home/al/compas/compas_fea/data/_workshop/example_shell.obj' fnm = '/home/al/compas/compas_fea/data/_workshop/example_tets.obj' mdl = Structure.load_from_obj(fnm) mdl.view()
dtype = 'element' # Postprocess result = postprocess(nodes, elements, ux, uy, uz, data, dtype, 1, cbar, 1, iptype, nodal) try: toc, U, cnodes, fabs, fscaled, celements, eabs = result U = array(U) print('\n***** Data processed : {0:.3f} s *****'.format(toc)) except: print( '\n***** Error encountered during data processing or plotting *****' ) plotvoxels(values=fscaled, U=U, vdx=vdx, plot=plot) # ============================================================================== # Debugging # ============================================================================== if __name__ == "__main__": from compas_fea.structure import Structure mdl = Structure.load_from_obj(filename='/home/al/temp/block_deepbeam.obj') plot_voxels(mdl, step='step_load', cbar=[0, 2], vdx=0.05, plot='vtk')