def rec_write(self,recname): print 'Writing '+self.recname+'.....' recfile=open(self.recname,'w') nodes=cubit.get_nodeset_nodes(self.receivers) for i,n in enumerate(nodes): x,y,z=cubit.get_nodal_coordinates(n) recfile.write('ST%i XX %20f %20f 0.0 0.0 \n' % (i,x,z)) recfile.close()
def rec_write(self, recname): print 'Writing ' + self.recname + '.....' recfile = open(self.recname, 'w') nodes = cubit.get_nodeset_nodes(self.receivers) for i, n in enumerate(nodes): x, y, z = cubit.get_nodal_coordinates(n) recfile.write('ST%i XX %20f %20f 0.0 0.0 \n' % (i, x, z)) recfile.close()
def rec_write(self, recname): print "Writing " + self.recname + "....." recfile = open(self.recname, "w") nodes = cubit.get_nodeset_nodes(self.receivers) for i, n in enumerate(nodes): x, y, z = cubit.get_nodal_coordinates(n) recfile.write("ST%i XX %20f %20f 0.0 0.0 \n" % (i, x, z)) recfile.close() print "Ok"
def rec_write(self,recname): """ Write receivers coordinates on file recname """ print 'Writing '+self.recname+'.....' recfile = open(self.recname,'w') nodes = cubit.get_nodeset_nodes(self.receivers) # Import nodes in nodeset containing receiver positions for i,n in enumerate(nodes): # For each receiver x,y,z = cubit.get_nodal_coordinates(n) # Import its coordinates (3 coordinates even for a 2D model in cubit) recfile.write('ST%i XX %20f %20f 0.0 0.0 \n' % (i,x,z)) # Write x and z coordinates on the file -> Model must be in x,z coordinates. TODO recfile.close() print 'Ok'
def free_write(self, free_name): freefile = open(free_name, 'w') print('writing ' + free_name) for n in self.ns_free: nodes_free = cubit.get_nodeset_nodes(n) nfree = len(nodes_free) freefile.write(str(nfree) + '\n') print('Number of free nodes ', nfree) for node in nodes_free: freefile.write(str(node) + '\n')
def absorb_write(self, absorb_name): absorbfile = open(absorb_name, 'w') print('writing ' + absorb_name) for n in self.ns_absorb: nodes_absorb = cubit.get_nodeset_nodes(n) nabs = len(nodes_absorb) absorbfile.write(str(nabs) + '\n') print('Number of absorbing nodes ', nabs) for node in nodes_absorb: absorbfile.write(str(node) + '\n')
def find_boundaries(outputfolder): vtk_found = False nodeset = cubit.get_nodeset_id_list() for n in nodeset: name = cubit.get_exodus_entity_name('nodeset', n) if name.find('vtk') >= 0: vtk_found = True print('found interface nodes to create vtk') values = name.split(" ") title = values[1] nodes_vtk = cubit.get_nodeset_nodes(n) write_vtk_file(nodes_vtk, title, outputfolder) if not vtk_found: print('no interface nodes to create vtk found')
def get_face(self): for n in self.ns_free: nodes_free = cubit.get_nodeset_nodes(n) print(nodes_free)