xmm = np.linspace(xmin, xmax, nxbase) ymm = [0., 25.] zmm = np.linspace(zmin, zmax, nzbase + 1) #N = len(xmm)*len(ymm)*len(zmm) #print('Grid will contain '+str(N) +' nodes') #print(str(len(zmm))+' in the z direction') # ## assemble parameters and root names #dat = fdata() #dat.work_dir='.' # #dat.grid.make(dat.work_dir+os.sep+'GRID.inp',x=xmm,y=ymm,z=zmm) #dat.grid.write('AVS.inp', format='avs') l = pylagrit.PyLaGriT(batch=batch) mtemp = l.gridder(xmm, ymm, zmm, connect=True) mtemp.dump("AVS.inp") m = l.read('AVS.inp') #z_inj = dat.grid.node_nearest_point((0,0,zmid)).position[2] #m_l = l.create_line(2, (0.1,0.1,zmin), (0.1,0.1,zmax)) #m_l.connect_delaunay() #m.refine_to_object(m_l,level=3) #m_l.delete() #for i in range(4): # prefine = m.pset_geom( (-.1,-.1,zmin), (.1,.1,zmax)) # prefine.refine('constant','element',inclusive_flag='inclusive',prd_choice=12) # prefine.delete() m_l = l.create_line(2, [fx + fw / 2., -fl / 2., zmax + .1],
################################################################################ # This example shows how to merge multiple mesh objects together. # ################################################################################ #To use pylagrit, import the module. import pylagrit import numpy #Instantiate the lagrit object. lg = pylagrit.PyLaGriT() # Create list with mesh object as first element dxyz = numpy.array([0.25]*3) mins = numpy.array([0.]*3) maxs = numpy.array([1.]*3) ms = [lg.createpts_dxyz(dxyz,mins,maxs,'tet',connect=True)] # Create three new mesh objects, each one directly above the other for i in range(3): ms.append(ms[-1].copy()) ms[-1].trans(ms[-1].mins,ms[-1].mins+numpy.array([0.,0.,1.])) # Merge list of mesh objects and clean up mo_merge = lg.merge(ms) for mo in ms: mo.delete() mo_merge.rmpoint_compress(filter_bool=True,resetpts_itp=True) mo_merge.paraview(filename='mo_merge.inp')
def setUp(self): #Sets upt a lagrit object to be used during tests. with suppress_stdout(): self.lg = pylagrit.PyLaGriT('/n/swdev/LAGRIT/bin/lagrit_lin')
def setUp(self): #Sets upt a lagrit object to be used during tests. with suppress_stdout(): self.lg = pylagrit.PyLaGriT('/path/to/lagrit')