コード例 #1
0
ファイル: abaqus_link.py プロジェクト: kelidas/oricrete
 def abaqus_cae(self):
     # Initialise connection
     p = asm.open_shell()
     # establish connection
     asm.connect_cluster(p, self.login, self.tail, cluster=self.cluster, options=self.options)
     print asm.recv_some(p)
     asm.open_abaqus(p, self.tail)
     print asm.recv_some(p)
     asm.close_connection(p, self.tail)
コード例 #2
0
    def abaqus_solve(self):
        ''' Solve FE with Abaqus on RWTH Cluster.

        The previouse generated input file will be uploaded on the cluster System
        of the RWTH and solved by Abaqus. Finally the result file will be
        downloaded.

        .. note:: You need a public key connection to the Cluster System. An intsallationguide
        is following at the end. You need this key on every computer you want to run this
        code from.

        .. note:: You have to change the login ID to your own TIM ID.

        .. note:: This code can only be run from an Unix machine!

        ToDo:
        - enable this code to Windows
        - make a better output of cluster
        - implement exception handling
        - killing the connection
        '''
        # Initialise connection
        p = asm.open_shell()
        # establish connection
        asm.connect_cluster(
            p, self.login, self.tail, cluster=self.cluster, options=self.options)
        print asm.recv_some(p)
        # delete old files with same name
        asm.delete_old(p, self.model_name, self.tail)
        print asm.recv_some(p)
        # upload the input file
        asm.upload_file(p, self.login, self.model_name + '.inp', self.tail)
        print asm.recv_some(p)
        # start abaqus solver on server
        asm.solve_abaqus(p, self.model_name, self.tail)
        print asm.recv_some(p)
        # close connection
        asm.close_connection(p, self.tail)
        # open new connection for downloading results
        p = asm.open_shell()
        asm.download_file(
            p, self.login, self.model_name + '.dat', self.tail, self.model_name + '.dat')
        print asm.recv_some(p)
        p.kill()