Пример #1
0
 def run(self, m, n, e, props, nodes, elements, springs, constraints, flag):
     self.m = m
     self.n = n
     self.e = e
     self.nodes = nodes
     self.elements = elements
     self.props = props
     self.springs = springs
     self.constraints = constraints
     self.flag = flag
     self.rowm, self.ADDMAT, self.DELMAT, self.mitems = self.wprops(
         self.props, len(self.props))
     self.rnode, self.ADDNODE, self.DELNODE, self.nitems = self.wnodes(
         self.nodes, len(self.nodes))
     self.relem, self.ADDELEM, self.DELELEM, self.eitems = self.welems(
         self.elements, len(self.elements))
     self.rflag, self.Submit, self.flags = self.wflag(self.flag)
     self.rBC, self.bc_widget, self.neigs = self.wBound_Cond()
     self.cs = widgets.Output()
     with self.cs:
         crossect.crossect(self.nodes, self.elements, self.springs,
                           self.constraints, self.flag)
     self.page = widgets.FloatText(value=1)
     self.Assemble(self.page, self.rowm, self.rnode, self.relem, self.rflag,
                   self.cs, self.rBC)
     return self.props, self.nodes, self.elements
Пример #2
0
    def submit(self, b):
        self.props = [[] for i in range(self.m)]
        for i in range(self.m):
            for j in range(6):
                self.props[i].append(self.mitems[i][j].value)
        self.props = np.array(self.props)
        self.nodes = [[] for i in range(self.n)]
        for i in range(self.n):
            for j in range(8):
                self.nodes[i].append(self.nitems[i][j].value)
        self.nodes = np.array(self.nodes)
        self.elements = [[] for i in range(self.e)]
        for i in range(self.e):
            for j in range(5):
                self.elements[i].append(self.eitems[i][j].value)
        self.elements = np.array(self.elements)
        for i in range(len(self.flags)):
            if (self.flags[i].value == True):
                self.flag[i] = 1
            else:
                self.flag[i] = 0

        self.rflag, self.Submit, self.flags = self.wflag(self.flag)
        self.cs = widgets.Output()
        with self.cs:
            crossect.crossect(self.nodes, self.elements, self.springs,
                              self.constraints, self.flag)
        self.Assemble(self.page, self.rowm, self.rnode, self.relem, self.rflag,
                      self.cs, self.rBC)
Пример #3
0
 def del_elem(self, b):
     self.e = self.e - 1
     self.elements = [[] for i in range(self.e)]
     for i in range(self.e):
         for j in range(5):
             self.elements[i].append(self.eitems[i][j].value)
     self.elements = np.array(self.elements)
     self.relem, self.ADDELEM, self.DELELEM, self.eitems = self.welems(
         self.elements, self.e)
     self.cs = widgets.Output()
     with self.cs:
         crossect.crossect(self.nodes, self.elements, self.springs,
                           self.constraints, self.flag)
     self.Assemble(self.page, self.rowm, self.rnode, self.relem, self.rflag,
                   self.cs, self.rBC)
Пример #4
0
 def del_material(self, b):
     self.m = self.m - 1
     self.props = [[] for i in range(self.m)]
     for i in range(self.m):
         for j in range(6):
             self.props[i].append(self.mitems[i][j].value)
     self.props = np.array(self.props)
     self.rowm, self.ADDMAT, self.DELMAT, self.mitems = self.wprops(
         self.props, self.m)
     self.cs = widgets.Output()
     with self.cs:
         crossect.crossect(self.nodes, self.elements, self.springs,
                           self.constraints, self.flag)
     self.Assemble(self.page, self.rowm, self.rnode, self.relem, self.rflag,
                   self.cs, self.rBC)
Пример #5
0
 def del_node(self, b):
     self.n = self.n - 1
     if (self.n == len(self.eitems)):
         self.del_elem(b)
     self.nodes = [[] for i in range(self.n)]
     for i in range(self.n):
         for j in range(8):
             self.nodes[i].append(self.nitems[i][j].value)
     self.nodes = np.array(self.nodes)
     self.rnode, self.ADDNODE, self.DELNODE, self.nitems = self.wnodes(
         self.nodes, self.n)
     self.cs = widgets.Output()
     with self.cs:
         crossect.crossect(self.nodes, self.elements, self.springs,
                           self.constraints, self.flag)
     self.Assemble(self.page, self.rowm, self.rnode, self.relem, self.rflag,
                   self.cs, self.rBC)