def test_bar2(): '''Clamped bar composed of two linked bars loaded at the right end [00]-[01]-[02]-[03]-[04]-[05]-[06]-[07]-[08]-[09]-[10] [11]-[12]-[13]-[14]-[15]-[16]-[17]-[18]-[19]-[20]-[21] u[0] = 0, u[5] = u[16], R[-1] = R[21] = 10 ''' fets_eval = FETS1D2L(mats_eval=MATS1DElastic(E=10., A=1.)) # Discretization fe_domain1 = FEGrid(coord_max=(10., 0., 0.), shape=(10, ), n_nodal_dofs=1, dof_r=fets_eval.dof_r, geo_r=fets_eval.geo_r) fe_domain2 = FEGrid(coord_min=(10., 0., 0.), coord_max=(20., 0., 0.), shape=(10, ), n_nodal_dofs=1, dof_r=fets_eval.dof_r, geo_r=fets_eval.geo_r) ts = TS(iterms=[(fets_eval, fe_domain1), (fets_eval, fe_domain2)], dof_resultants=True, bcond_list=[ BCDof(var='u', dof=0, value=0.), BCDof(var='u', dof=5, link_dofs=[16], link_coeffs=[1.], value=0.), BCDof(var='f', dof=21, value=10) ], rtrace_list=[ RTraceGraph(name='Fi,right over u_right (iteration)', var_y='F_int', idx_y=0, var_x='U_k', idx_x=1), ]) # Add the time-loop control tloop = TLoop(tstepper=ts, tline=TLine(min=0.0, step=1, max=1.0)) u = tloop.eval() print 'u', u # # '---------------------------------------------------------------' # 'Clamped bar composed of two linked bars control displ at right' # 'u[0] = 0, u[5] = u[16], u[21] = 1' # Remove the load and put a unit displacement at the right end # Note, the load is irrelevant in this case and will be rewritten # ts.bcond_list = [ BCDof(var='u', dof=0, value=0.), BCDof(var='u', dof=5, link_dofs=[16], link_coeffs=[1.], value=0.), BCDof(var='u', dof=21, value=1.) ] # system solver u = tloop.eval() print 'u', u
def _get_fe_domain_structure(self): '''Root of the domain hierarchy ''' elem_length = self.length / float(self.shape) fe_domain = FEDomain() fe_m_level = FERefinementGrid(name='matrix domain', domain=fe_domain, fets_eval=self.fets_m) fe_grid_m = FEGrid(name='matrix grid', coord_max=(self.length, ), shape=(self.shape, ), level=fe_m_level, fets_eval=self.fets_m, geo_transform=self.geo_transform) fe_fb_level = FERefinementGrid(name='fiber bond domain', domain=fe_domain, fets_eval=self.fets_fb) fe_grid_fb = FEGrid(coord_min=(0., length / 5.), coord_max=(length, 0.), shape=(self.shape, 1), level=fe_fb_level, fets_eval=self.fets_fb, geo_transform=self.geo_transform) return fe_domain, fe_grid_m, fe_grid_fb, fe_m_level, fe_fb_level
def _get_fe_disk_grid(self): fe_grid = FEGrid(coord_min=(-1, -1), coord_max=(1, 1), geo_transform=self.geo_disk, shape=(self.n_elems, self.n_elems), fets_eval=self.fets_disk) return fe_grid
def _get_fe_grid_roof(self): return FEGrid(coord_min=(0.0, 0.0, 0.0), coord_max=(1.0, 1.0, 1.0), geo_transform=self.hp_shell, shift_array=self.shift_array, shape=(self.n_elems_xy, self.n_elems_xy, self.n_elems_z), fets_eval=self.fe_roof)
def _get_fe_grid_column(self): return FEGrid(coord_min=(0.0, 0.0, 0.0), coord_max=(1.0, 1.0, 1.0), geo_transform=self.column, shape=(self.n_elems_col_xy, self.n_elems_col_xy, self.n_elems_col_z), fets_eval=self.fe_column)
def example_with_new_domain(): from ibvpy.api import \ TStepper as TS, RTDofGraph, RTraceDomainListField, TLoop, \ TLine, BCDof, IBVPSolve as IS, DOTSEval from ibvpy.mats.mats1D.mats1D_elastic.mats1D_elastic import MATS1DElastic fets_eval = FETS1D2L3U(mats_eval=MATS1DElastic(E=10.)) from ibvpy.mesh.fe_grid import FEGrid # Discretization domain = FEGrid(coord_max=(3., ), shape=(3, ), fets_eval=fets_eval) ts = TS(dof_resultants=True, sdomain=domain, # conversion to list (square brackets) is only necessary for slicing of # single dofs, e.g "get_left_dofs()[0,1]" # bcond_list = [ BCDof(var='u', dof = 0, value = 0.) ] + # [ BCDof(var='u', dof = 2, value = 0.001 ) ]+ # [ ) ], bcond_list=[BCDof(var='u', dof=0, value=0.), # BCDof(var='u', dof = 1, link_dofs = [2], link_coeffs = [0.5], # value = 0. ), # BCDof(var='u', dof = 2, link_dofs = [3], link_coeffs = [1.], # value = 0. ), BCDof(var='f', dof=6, value=1, # link_dofs = [2], link_coeffs = [2] )], rtrace_list=[RTDofGraph(name='Fi,right over u_right (iteration)', var_y='F_int', idx_y=0, var_x='U_k', idx_x=1), RTraceDomainListField(name='Stress', var='sig_app', idx=0), RTraceDomainListField(name='Displacement', var='u', idx=0), RTraceDomainListField(name='N0', var='N_mtx', idx=0, record_on='update') ] ) # Add the time-loop control tloop = TLoop(tstepper=ts, tline=TLine(min=0.0, step=1, max=1.0)) print('---- result ----') print(tloop.eval()) print(ts.F_int) print(ts.rtrace_list[0].trace.ydata) # Put the whole stuff into the simulation-framework to map the # individual pieces of definition into the user interface. # from ibvpy.plugins.ibvpy_app import IBVPyApp app = IBVPyApp(ibv_resource=tloop) app.main()
def _get_domain(self): # Number of elements n_e_x = 20 # Element definition domain = FEGrid(coord_max=(self.L_x, ), shape=(n_e_x, ), fets_eval=self.fets_eval) return domain
def _get_fe_grid_columns(self): return [ FEGrid(coord_min=(0.0, 0.0, 0.0), coord_max=(1.0, 1.0, 1.0), geo_transform=column, shape=(1, 1, 1), fets_eval=self.fe_column) for column in self.columns ]
def _get_friction_fe_grid(self): fe_grid = FEGrid(coord_min=(0, 0), coord_max=(1, 1), level=self.friction_fe_level, geo_transform=self.friction_geo, shape=(self.friction_ne_x, self.friction_ne_y), fets_eval=self.friction_fets) return fe_grid
def setUp(self): ''' Construct the FEDomain with one FERefinementGrids (2,2) ''' self.fets_eval = FETS3D8H() self.grid = FEGrid(coord_max=(1., 1., 1.), shape=(1, 1, 1), fets_eval=self.fets_eval)
def _get_specmn_fe_grid(self): fe_grid = FEGrid(coord_max=(1, 1, 1), shape=(self.shape_x, self.shape_y, self.shape_z), level=self.specmn_fe_level, geo_transform=self.barel_shell_geo, fets_eval=self.specmn_fets) return fe_grid
def setUp(self): ''' Construct the FEDomain with two FERefinementGrids (2,2) ''' self.domain1 = FEDomain() self.fets_eval = FETS2D4Q(mats_eval=MATS2DElastic()) self.d1 = FERefinementGrid(name='d1', domain=self.domain1) g1 = FEGrid(coord_max=(1., 1., 0.), shape=(2, 2), fets_eval=self.fets_eval, level=self.d1) self.d2 = FERefinementGrid(name='d2', domain=self.domain1) g2 = FEGrid(coord_min=(1., 0., 0.), coord_max=(2., 1., 0.), shape=(2, 2), fets_eval=self.fets_eval, level=self.d2)
def _get_buttstrap_clamp_fe_grid(self): fe_grid = FEGrid(coord_min=(0, 0), coord_max=(1, 1), level=self.buttstrap_clamp_fe_level, geo_transform=self.buttstrap_clamp_geo, shape=(1, self.buttstrap_ne_y), fets_eval=self.buttstrap_fets) return fe_grid
def _get_specmn_fe_grid(self): # only a quarter of the beam is simulated due to symmetry: fe_grid = FEGrid(coord_min=(self.sym_elstmr_length, 0., 0.), coord_max=(self.sym_specmn_length, self.sym_width, self.thickness), shape=(self.shape_x, self.shape_y, self.shape_z), level=self.specmn_fe_level, fets_eval=self.specmn_fets) return fe_grid
def _get_fe_grid(self): elem_length = self.length / float(self.shape) fe_grid = FEGrid(coord_max=(self.length, ), shape=(self.shape, ), level=self.fe_grid_level, fets_eval=self.fets) return fe_grid
def _get_fe_grid_roofs(self): return [ FEGrid(coord_min=(0.0, 0.0, 0.0), coord_max=(1.0, 1.0, 1.0), geo_transform=hp_shell, shape=(self.n_elems_xy_quarter, self.n_elems_xy_quarter, self.n_elems_z), fets_eval=self.fe_roof) for hp_shell in self.hp_shells ]
def notched_bended_beam(): fets_eval_4u = FETS2D4Q(mats_eval=MATS2DScalarDamage()) fets_eval_cracked = FETSLSEval(parent_fets=fets_eval_4u) # Discretization fe_domain1 = FEGrid(coord_max=(5., 2., 0.), shape=(3, 2), fets_eval=fets_eval_4u) fe_child_domain = FERefinementGrid(parent_domain=fe_domain1, fets_eval=fets_eval_cracked, fine_cell_shape=(1, 1)) crack_level_set = lambda X: X[0] - 2.5 fe_child_domain.refine_elem((1, 0), crack_level_set) dots = fe_child_domain.new_dots() fe_domain = FEDomainList(subdomains=[fe_domain1]) fe_domain_tree = FEDomainTree(domain_list=fe_domain) ts = TS( dof_resultants=True, sdomain=[fe_domain1, fe_child_domain], bcond_list=[ BCDofGroup(var='u', value=0., dims=[0, 1], get_dof_method=fe_domain1.get_left_dofs), BCDofGroup(var='u', value=0., dims=[0, 1], get_dof_method=fe_domain1.get_right_dofs), BCDofGroup(var='f', value=-1., dims=[1], get_dof_method=fe_domain1.get_top_dofs), ], rtrace_list=[ # RTDofGraph(name = 'Fi,right over u_right (iteration)' , # var_y = 'F_int', idx_y = 0, # var_x = 'U_k', idx_x = 1), # RTraceDomainListField(name = 'Stress' , # var = 'sig_app', idx = 0, warp = True ), # RTraceDomainField(name = 'Displacement' , # var = 'u', idx = 0), # RTraceDomainField(name = 'N0' , # var = 'N_mtx', idx = 0, # record_on = 'update') # ]) # Add the time-loop control tloop = TLoop(tstepper=ts, tline=TLine(min=0.0, step=1, max=1.0)) print(tloop.eval())
def run_example(): from ibvpy.api import \ TStepper as TS, RTraceGraph, RTraceDomainListField, \ RTraceDomainListInteg, TLoop, \ TLine, BCDof, IBVPSolve as IS, DOTSEval from ibvpy.mats.mats2D.mats2D_conduction.mats2D_conduction import MATS2DConduction from ibvpy.api import BCDofGroup fets_eval = FETS2D4Q4T(mats_eval=MATS2DConduction(k=1.)) print fets_eval.vtk_node_cell_data from ibvpy.mesh.fe_grid import FEGrid from ibvpy.mesh.fe_refinement_grid import FERefinementGrid from ibvpy.mesh.fe_domain import FEDomain from mathkit.mfn import MFnLineArray # Discretization fe_grid = FEGrid(coord_max=(1., 1., 0.), shape=(2, 2), fets_eval=fets_eval) tstepper = TS( sdomain=fe_grid, bcond_list=[ BCDofGroup(var='u', value=0., dims=[0], get_dof_method=fe_grid.get_left_dofs), # BCDofGroup( var='u', value = 0., dims = [1], # get_dof_method = fe_grid.get_bottom_dofs ), BCDofGroup(var='u', value=.005, dims=[0], get_dof_method=fe_grid.get_top_right_dofs) ], rtrace_list=[ # RTraceDomainListField(name = 'Damage' , # var = 'omega', idx = 0, # record_on = 'update', # warp = True), # RTraceDomainListField(name = 'Displacement' , # var = 'u', idx = 0, # record_on = 'update', # warp = True), # RTraceDomainListField(name = 'N0' , # var = 'N_mtx', idx = 0, # record_on = 'update') ]) print tstepper.setup() return # Add the time-loop control tloop = TLoop(tstepper=tstepper, debug=False, tline=TLine(min=0.0, step=1.0, max=1.0)) tloop.eval()
def _get_elstmr_fe_grid(self): x_max = self.sym_elstmr_length y_max = self.width / 2. z_max = self.thickness + self.elstmr_thickness fe_grid = FEGrid(coord_min=(0, 0, self.thickness), coord_max=(x_max, y_max, z_max), level=self.elstmr_fe_level, shape=(self.mid_shape_x, self.shape_y, 1), fets_eval=self.elstmr_fets) return fe_grid
def setUp(self): self.fets_eval = FETS1D2L(mats_eval=MATS1DElastic(E=10.)) # Discretization self.fe_domain1 = FEGrid(coord_max=(3., 0., 0.), shape=(3, ), fets_eval=self.fets_eval) self.fe_domain2 = FEGrid(coord_min=(3., 0., 0.), coord_max=(6., 0., 0.), shape=(3, ), fets_eval=self.fets_eval) self.fe_domain3 = FEGrid(coord_min=(3., 0., 0.), coord_max=(6., 0., 0.), shape=(3, ), fets_eval=self.fets_eval) self.ts = TS( dof_resultants=True, sdomain=[self.fe_domain1, self.fe_domain2, self.fe_domain3], bcond_list=[ BCDof(var='u', dof=0, value=0.), BCDof(var='u', dof=4, link_dofs=[3], link_coeffs=[1.], value=0.), BCDof(var='f', dof=7, value=1, link_dofs=[2], link_coeffs=[2]) ], rtrace_list=[ RTraceGraph(name='Fi,right over u_right (iteration)', var_y='F_int', idx_y=0, var_x='U_k', idx_x=1), ]) # Add the time-loop control self.tloop = TLoop(tstepper=self.ts, tline=TLine(min=0.0, step=1, max=1.0))
def demo3d(): # Geometry # length = 1.0 from ibvpy.fets.fets3D import FETS3D8H, FETS3D8H20U, FETS3D8H27U, FETS3D8H20U from ibvpy.mats.mats3D import MATS3DElastic # Material and FE Formulation # lin_x_temperature = TemperatureLinFn(length=length, n_dims=3, offset=0.5) fets_eval = FETS3D8H20U(mats_eval=MATS3DElastic( E=30e3, nu=0.2, initial_strain=lin_x_temperature)) fets_eval.vtk_r *= 0.99 # Discretization # domain = FEGrid(coord_max=(length, length, length), shape=(6, 3, 3), fets_eval=fets_eval) bcond_list = [ BCSlice(var='u', dims=[0, 1, 2], slice=domain[0, 0, 0, 0, 0, 0], value=0), BCSlice(var='u', dims=[0, 1], slice=domain[0, 0, -1, 0, 0, -1], value=0), BCSlice(var='u', dims=[0], slice=domain[0, -1, 0, 0, -1, 0], value=0), ] rtrace_list = [ sig_trace, eps_trace, eps0_trace, eps1t_trace, max_p_sig_trace, u_trace ] for rtrace in rtrace_list: rtrace.position = 'int_pnts' rtrace.warp = False corner_dof = domain[-1, -1, -1, -1, -1, -1].dofs[0, 0, 2] ts = TS(sdomain=domain, bcond_list=bcond_list, rtrace_list=rtrace_list) # Time integration # tloop = TLoop(tstepper=ts, tline=TLine(min=0.0, step=3, max=1.0)) tloop.eval() # Postprocessing # app = IBVPyApp(ibv_resource=tloop) app.main()
def _get_supprt_fe_grid(self): return FEGrid( coord_min=(0, 0, 0), coord_max=(1, 1, 1), level=self.supprt_fe_level, # use shape (2,2) in order to place support in the center of the steel support # corresponding to 4 elements of the slab mesh # shape=(self.shape_supprt_x, self.shape_supprt_x, 1), geo_transform=self.geo_supprt, fets_eval=self.supprt_fets)
def setUp(self): self.fets_eval = FETS1D2L(mats_eval=MATS1DElastic(E=10.)) # Discretization self.domain = FEGrid(coord_max=(10., 0., 0.), shape=(1, ), fets_eval=self.fets_eval) self.ts = TS(sdomain=self.domain, dof_resultants=True) self.tloop = TLoop(tstepper=self.ts, tline=TLine(min=0.0, step=1, max=1.0))
def _get_elstmr_fe_grid(self): fe_grid = FEGrid(coord_min=(self.sym_mid_zone_specmn_length - self.sym_elstmr_length, 0., self.thickness), coord_max=(self.sym_mid_zone_specmn_length + self.sym_elstmr_length, self.sym_width, self.thickness + self.elstmr_thickness), level=self.elstmr_fe_level, shape=(self.load_zone_shape_x, self.shape_y, 1), fets_eval=self.elstmr_fets) return fe_grid
def example_2d(): from ibvpy.mats.mats2D.mats2D_elastic.mats2D_elastic import MATS2DElastic from ibvpy.fets.fets2D.fets2D4q import FETS2D4Q fets_eval = FETS2D4Q(mats_eval=MATS2DElastic(E=2.1e5)) # Discretization fe_domain1 = FEGrid(coord_max=(2., 5., 0.), shape=(10, 10), fets_eval=fets_eval) fe_subgrid1 = FERefinementLevel(parent=fe_domain1, fine_cell_shape=(1, 1)) print 'children' print fe_domain1.children fe_subgrid1.refine_elem((5, 5)) fe_subgrid1.refine_elem((6, 5)) fe_subgrid1.refine_elem((7, 5)) fe_subgrid1.refine_elem((8, 5)) fe_subgrid1.refine_elem((9, 5)) fe_domain = FEDomain(subdomains=[fe_domain1]) ts = TS(dof_resultants=True, sdomain=fe_domain, bcond_list=[BCDofGroup(var='f', value=0.1, dims=[0], get_dof_method=fe_domain1.get_top_dofs), BCDofGroup(var='u', value=0., dims=[0, 1], get_dof_method=fe_domain1.get_bottom_dofs), ], rtrace_list=[RTraceGraph(name='Fi,right over u_right (iteration)', var_y='F_int', idx_y=0, var_x='U_k', idx_x=1), RTraceDomainListField(name='Stress', var='sig_app', idx=0, warp=True), # RTraceDomainField(name = 'Displacement' , # var = 'u', idx = 0), # RTraceDomainField(name = 'N0' , # var = 'N_mtx', idx = 0, # record_on = 'update') ] ) # Add the time-loop control tloop = TLoop(tstepper=ts, tline=TLine(min=0.0, step=1, max=1.0)) # print tloop.eval() from ibvpy.plugins.ibvpy_app import IBVPyApp ibvpy_app = IBVPyApp(ibv_resource=tloop) ibvpy_app.main()
def __demo__(): from ibvpy.api import \ TStepper as TS, RTDofGraph, RTraceDomainListField, TLoop, \ TLine, BCDof from ibvpy.tmodel.mats1D.mats1D_elastic.mats1D_elastic import MATS1DElastic fets_eval = FETS1D2L(mats_eval=MATS1DElastic(E=10.)) from ibvpy.mesh.fe_grid import FEGrid # Discretization domain = FEGrid(coord_max=(3., ), shape=(3, ), fets_eval=fets_eval) ts = TS(dof_resultants=True, sdomain=domain, bcond_list=[ BCDof(var='u', dof=0, value=0.), BCDof( var='f', dof=3, value=1, ) ], rtrace_list=[ RTDofGraph(name='Fi,right over u_right (iteration)', var_y='F_int', idx_y=0, var_x='U_k', idx_x=1), RTraceDomainListField(name='Stress', var='sig_app', idx=0), RTraceDomainListField(name='Displacement', var='u', idx=0, warp=True), RTraceDomainListField(name='N0', var='N_mtx', idx=0, record_on='update') ]) # Add the time-loop control tloop = TLoop(tstepper=ts, tline=TLine(min=0.0, step=0.5, max=1.0)) print('---- result ----') print(tloop.eval()) print(ts.F_int) print(ts.rtrace_list[0].trace.ydata) # Put the whole stuff into the simulation-framework to map the # individual pieces of definition into the user interface. # app = IBVPyApp(ibv_resource=tloop) app.main()
def demo1d(): # Geometry # length = 1.0 # Material and FE Formulation # from ibvpy.fets.fets1D import FETS1D2L, FETS1D2L3U from ibvpy.mats.mats1D import MATS1DElastic mats_eval = MATS1DElastic(E=100., initial_strain=TemperatureLinFn(length=length, n_dims=1, offset=0.5)) fets_eval = FETS1D2L3U(mats_eval=mats_eval) fets_eval.vtk_r *= 0.99 # Discretization # domain = FEGrid(coord_max=(length, 0., 0.), n_elems=(10, ), fets_eval=fets_eval) bcond_list = [ BCSlice(var='u', dims=[0], slice=domain[0, 0], value=0), #BCSlice( var = 'u', dims = [0], slice = domain[-1, -1], value = 0 ) ] ts = TS(sdomain=domain, bcond_list=bcond_list, rtrace_list=[sig_trace, eps_trace, eps0_trace, eps1t_trace]) # Time integration # tloop = TLoop(tstepper=ts, tline=TLine(min=0.0, step=1, max=1.0)) tloop.eval() # Postprocessing # legend = [] plot_sig(eps_trace, 'eps', legend) plot_sig(eps0_trace, 'eps0', legend) plot_sig(eps1t_trace, 'eps1t', legend) p.legend(legend) p.show()
def demo2d(): # Geometry # length = 1.0 from ibvpy.fets.fets2D import FETS2D4Q, FETS2D4Q8U, FETS2D4Q12U from ibvpy.mats.mats2D import MATS2DElastic # Material and FE Formulation # lin_x_temperature = TemperatureLinFn(length=length, n_dims=2) fets_eval = FETS2D4Q12U(mats_eval=MATS2DElastic( E=30e5, nu=0.2, initial_strain=lin_x_temperature)) fets_eval.vtk_r *= 0.99 # Discretization # domain = FEGrid(coord_max=(length, length, 0.), shape=(10, 10), fets_eval=fets_eval) bcond_list = [ BCSlice(var='u', dims=[0, 1], slice=domain[0, 0, 0, 0], value=0), BCSlice(var='u', dims=[1], slice=domain[0, -1, 0, -1], value=0), ] rtrace_list = [sig_trace, eps_trace, eps0_trace, eps1t_trace, u_trace] ts = TS( sdomain=domain, bcond_list=bcond_list, rtrace_list=rtrace_list, ) # Time integration # tloop = TLoop(tstepper=ts, tline=TLine(min=0.0, step=1, max=1.0)) tloop.eval() # Postprocessing # app = IBVPyApp(ibv_resource=tloop) app.main()
def _get_fe_grid_roof(self): hp_shell = GeoHPShell(thickness = 0.6) square_to_circle = GeoSquare2Circle(post_transform = hp_shell, circle_radius = 0.15, #Scircle_center = [4.0, 4.0, 0.0], square_edge = 0.6) fe_grid = FEGrid(coord_min = (-1.0, -1.0, 0.0), coord_max = (1.0, 1.0, 1.0), geo_transform = square_to_circle, shape = (self.n_elems_xy, self.n_elems_xy, self.n_elems_z), fets_eval = self.fe_roof) mid_idx = self.mid_idx idx_min, idx_max = self.idx_min, self.idx_max print 'idx_min', idx_min print 'idx_max', idx_max interior_elems = fe_grid[ idx_min:idx_max, idx_min:idx_max, :, :, :, : ].elems fe_grid.inactive_elems = list(interior_elems) print 'elems', interior_elems return fe_grid
def test_rg_addition(self): '''Check numbering after addition of FERefinementGrid Add another FERefinementGrid (2,2) as a child of grid 1 Check the n_dofs of FEDomain to verify the re-enumeration Check the elem_dof_map of the grid 3. ''' d3 = FERefinementGrid(name='d3', parent=self.d1) g3 = FEGrid(coord_max=(1., 1., 0.), shape=(2, 2), fets_eval=self.fets_eval, level=d3) n_dofs = self.domain1.n_dofs #check the n_dofs of the domain after addition self.assertEqual(n_dofs, 54) #check elem_dof_map of added subdomain elem_dof_map = d3.elem_dof_map edm = [ 36, 37, 42, 43, 44, 45, 38, 39, 38, 39, 44, 45, 46, 47, 40, 41, 42, 43, 48, 49, 50, 51, 44, 45, 44, 45, 50, 51, 52, 53, 46, 47 ] for e_, e_ex_ in zip(elem_dof_map.flatten(), edm): self.assertEqual(e_, e_ex_)