Exemplo n.º 1
0
 def _GenerateNode(self):
     count = 1
     for jdx in range(0, self._module_number_x + 1):
         for idx in range(0, self._module_number_x + 1):
             no = count
             x = idx * self._length
             y = jdx * self._length
             h_max = self._height
             dh = self._height / self._module_number_x
             if idx <= self._module_number_x - jdx:
                 z = dh * (idx + jdx)
             else:
                 z = 2 * h_max - dh * (idx + jdx)
             self._nodes.append(NodeItem(no, x, y, z))
             count += 1
             #inner grid
     for jdx in range(0, self._module_number_x):
         for idx in range(0, self._module_number_x):
             no = count
             x = idx * self._length + 0.5 * self._length
             y = jdx * self._length + 0.5 * self._length
             h_max = self._height
             dh = self._height / self._module_number_x
             if idx <= self._module_number_x - jdx - 1:
                 z = dh * (idx + jdx + 1)
             else:
                 z = 2 * h_max - dh * (idx + jdx + 1)
             self._nodes.append(NodeItem(no, x, y, z))
             count += 1
Exemplo n.º 2
0
 def _GenerateAddtionalElement(self):
     comlength = 5
     nodeCount = len(self._nodes) + 1
     elemCount = len(self._elements) + 1
     for node in self.left_node:
         dnode = NodeItem(nodeCount, node._x - comlength, node._y, node._z)
         self._nodes.append(dnode)
         delem = LineElement("COMBIN", elemCount, node._id, dnode._id, 1, 0, 0)
         self._elements.append(delem)
         nodeCount += 1
         elemCount += 1
     for node in self.right_node:
         dnode = NodeItem(nodeCount, node._x + comlength, node._y, node._z)
         self._nodes.append(dnode)
         delem = LineElement("COMBIN", elemCount, node._id, dnode._id, 2, 0, 0)
         self._elements.append(delem)
         nodeCount += 1
         elemCount += 1
     for node in self.bottom_node:
         dnode = NodeItem(nodeCount, node._x, node._y - comlength, node._z)
         self._nodes.append(dnode)
         delem = LineElement("COMBIN", elemCount, node._id, dnode._id, 2, 0, 0)
         self._elements.append(delem)
         nodeCount += 1
         elemCount += 1
Exemplo n.º 3
0
 def _GenerateSoilNode(self):
     count = self.node_count_accumulated + 1
     soilside = []
     soilbottom = []
     soiltop = []
     soiltopall = []    
     dx = self._soil_size_x/self._soil_module_x
     dy = self._soil_size_y/self._soil_module_y
     dz = self._soil_size_z/self._soil_module_z
     structx = self._struct_size_x * 0.5
     structy = self._struct_size_y * 0.5
     for kdx in range(0, self._soil_module_z+1):
         for jdx in range(0, self._soil_module_y+1):
             for idx in range(0, self._soil_module_x+1):
                 no = count
                 x = idx * dx - 0.5 * self._soil_size_x
                 y = jdx * dy - 0.5 * self._soil_size_y
                 z = - kdx * dz
                 node_item = NodeItem(no, x, y, z)
                 if (idx == self._soil_module_x or idx == 0 or jdx == self._soil_module_y or jdx == 0) and kdx != self._soil_module_z:
                     soilside.append(node_item)
                 if kdx == self._soil_module_z:
                     soilbottom.append(node_item)
                 if abs(x)<=structx and abs(y)<=structy and kdx == 0:
                     soiltop.append(node_item)
                 if kdx == 0:
                     soiltopall.append(node_item)
                 self._nodes.append(node_item)
                 count += 1
     self._nodegroup['soilside'] = soilside
     self._nodegroup['soilbottom'] = soilbottom
     self._nodegroup['soiltop'] = soiltop
     self._nodegroup['soiltopall'] = soiltopall
Exemplo n.º 4
0
 def _AdjustNode(self):
     for elem in self.bottom_elems:
         old_id = elem._node_1
         new_id = 0
         oldNode = NodeItem(0, 0, 0, 0)
         for node in self._nodegroup['structbase']:
             if node._id == old_id:
                 oldNode = node
         for node in self._nodegroup['soiltop']:
             if node._x == oldNode._x and node._y == oldNode._y:
                 new_id = node._id
         elem._node_1 = new_id
Exemplo n.º 5
0
 def _GenerateNode(self):
     count = 1
     #grid
     for jdx in range(0, self._module_number_x + 1):
         for idx in range(0, self._module_number_x + 1):
             no = count
             x = idx * self._length - 0.5 * self._length * self._module_number_x
             y = jdx * self._length - 0.5 * self._length * self._module_number_x
             z = 0
             self._nodes.append(NodeItem(no, x, y, z))
             count += 1
     #inner grid
     for jdx in range(0, self._module_number_x):
         for idx in range(0, self._module_number_x):
             no = count
             x = idx * self._length + 0.5 * self._length - 0.5 * self._length * self._module_number_x
             y = jdx * self._length + 0.5 * self._length - 0.5 * self._length * self._module_number_x
             z = 0
             self._nodes.append(NodeItem(no, x, y, z))
             count += 1
     self._nodes.append(NodeItem(count, 0, 0, -self._height))
Exemplo n.º 6
0
 def _GenerateNode(self):
     count = 1
     dx = self._width / self._module_number_x
     dy = self._length / self._module_number_y
     for jdx in range(0, self._module_number_y + 1):
         for idx in range(0, self._module_number_x + 1):
             no = count
             x = idx * dx
             y = jdx * dy
             z = 0.0
             self._nodes.append(NodeItem(no, x, y, z))
             count += 1
Exemplo n.º 7
0
 def _GenerateNode(self):
     count = 1
     for jdx in range(0, self._module_number_y + 1):
         for idx in range(0, self._module_number_x + 1):
             no = count
             x = idx * self._length - 0.5 * self._length * self._module_number_x
             y = jdx * self._length - 0.5 * self._length * self._module_number_x
             #z = - self._height * (x*x+y*y) / (length*length)
             z = -math.sqrt(self._height * self._height - (x * x + y * y))
             self._nodes.append(NodeItem(no, x, y, z))
             count += 1
             #inner grid
     for jdx in range(0, self._module_number_y):
         for idx in range(0, self._module_number_x):
             no = count
             x = idx * self._length + 0.5 * self._length - 0.5 * self._length * self._module_number_x
             y = jdx * self._length + 0.5 * self._length - 0.5 * self._length * self._module_number_x
             length = 0.5 * self._length * self._module_number_x
             #z = - self._height * (x*x+y*y) / (length*length)
             z = -math.sqrt(self._height * self._height - (x * x + y * y))
             self._nodes.append(NodeItem(no, x, y, z))
             count += 1
Exemplo n.º 8
0
 def _GenerateNode(self):
     count = 1
     for jdx in range(0, self._module_number_y + 1):
         for idx in range(0, self._module_number_x):
             no = count
             dTheta = 360.0 / self._module_number_x
             dh = self._height / self._module_number_y
             r = self._r0 + jdx * self._length
             x = r * math.cos(math.radians(idx * dTheta))
             y = r * math.sin(math.radians(idx * dTheta))
             z = self._height - jdx * dh
             self._nodes.append(NodeItem(no, x, y, z))
             count += 1
Exemplo n.º 9
0
 def _GenerateNode(self):
     count = 1
     #grid
     for jdx in range(0, self._module_number_x + 1):
         for idx in range(0, self._module_number_x + 1):
             no = count
             x = idx * self._length - 0.5 * self._length * self._module_number_x
             y = jdx * self._length - 0.5 * self._length * self._module_number_x
             length = 0.5 * self._length * self._module_number_x
             z = self._height * (1.0 - y * y / length / length)
             self._nodes.append(NodeItem(no, x, y, z))
             count += 1
     #inner grid
     for jdx in range(0, self._module_number_x):
         for idx in range(0, self._module_number_x):
             no = count
             x = idx * self._length + 0.5 * self._length - 0.5 * self._length * self._module_number_x
             y = jdx * self._length + 0.5 * self._length - 0.5 * self._length * self._module_number_x
             length = 0.5 * self._length * self._module_number_x
             z = self._height * (1.0 - y * y / length / length)
             self._nodes.append(NodeItem(no, x, y, z))
             count += 1
Exemplo n.º 10
0
 def _GenerateNode(self):
     count = 1
     dTheta = 90.0 / self._module_number_x
     dt = self._t / self._module_number_y
     for jdx in range(0, self._module_number_y + 1):
         for idx in range(0, self._module_number_x + 1):
             no = count
             r = self._R - jdx * dt
             x = r * math.cos(math.radians(idx * dTheta))
             y = r * math.sin(math.radians(idx * dTheta))
             z = 0
             self._nodes.append(NodeItem(no, x, y, z))
             count += 1
Exemplo n.º 11
0
 def _GenerateNode(self):
     count = 1
     dx = self._width / self._module_number_x
     dy = self._length / self._module_number_y
     for jdx in range(0, self._module_number_y+1):
         for idx in range(0, self._module_number_x+1):
             no = count
             x = idx * dx
             y = jdx * dy
             z = 0.0
             node = NodeItem(no, x, y, z)
             self._nodes.append(node)
             count += 1
             if idx == 0:
                 self.left_node.append(node)
             if idx == self._module_number_x:
                 self.right_node.append(node)
             if jdx == 0:
                 self.bottom_node.append(node)
Exemplo n.º 12
0
 def _GenerateStructNode(self):
     structbase = []
     dx = self._struct_size_x/self._struct_module_x
     dy = self._struct_size_y/self._struct_module_y
     dz = self._struct_size_z/self._struct_module_z
     count = self.node_count_accumulated + 1
     for zdx in range(0, self._struct_module_z+1):
        for jdx in range(0, self._struct_module_y+1):
            for idx in range(0, self._struct_module_x+1):
                 no = count
                 x = idx * dx - 0.5 * self._struct_size_x
                 y = jdx * dy - 0.5 * self._struct_size_y 
                 z = zdx * dz
                 nodeItem = NodeItem(no, x, y, z)
                 if zdx==0:
                     structbase.append(nodeItem)
                 self._nodes.append(nodeItem)
                 count += 1
     self._nodegroup['structbase'] = structbase
Exemplo n.º 13
0
 def _GenerateStructNode(self, xm, ym):
     dx = self._struct_size_x/self._struct_module_x
     dy = self._struct_size_y/self._struct_module_y
     dz = self._struct_size_z/self._struct_module_z
     count = self.node_count_accumulated + 1
     for zdx in range(0, self.module_z[(xm,ym)]+1):
         for jdx in range(0, self._struct_module_y+1):
             for idx in range(0, self._struct_module_x+1):
                 no = count
                 x = idx * dx - 0.5 * self._struct_size_x
                 y = jdx * dy - 0.5 * self._struct_size_y
                 x = x - 0.5 * self._soil_size_x
                 y = y - 0.5 * self._soil_size_y
                 x = x + (2 * xm + 1) * 0.5 * self._soil_size_x / self._module_count_x
                 y = y + (2 * ym + 1) * 0.5 * self._soil_size_y / self._module_count_y
                 z = zdx * dz
                 nodeItem = NodeItem(no, x, y, z)
                 if zdx==0:
                     self._nodegroup['structbase'].append(nodeItem)
                 self._nodes.append(nodeItem)
                 count += 1
Exemplo n.º 14
0
    def _GenerateSoilNode(self):
        count = self.node_count_accumulated + 1
        soiltop = []
        dx = self._soil_size_x/self._soil_module_x
        dy = self._soil_size_y/self._soil_module_y
        dz = self._soil_size_z/self._soil_module_z
        # structx = self._struct_size_x * 0.5
        # structy = self._struct_size_y * 0.5
        for kdx in range(0, self._soil_module_z+1):
            for jdx in range(0, self._soil_module_y+1):
                for idx in range(0, self._soil_module_x+1):
                    no = count
                    x = idx * dx - 0.5 * self._soil_size_x
                    y = jdx * dy - 0.5 * self._soil_size_y
                    z = - kdx * dz
                    node_item = NodeItem(no, x, y, z)

                    # if abs(x)<=structx and abs(y)<=structy and kdx == 0:
                    if kdx == 0:
                        soiltop.append(node_item)

                    if idx == self._soil_module_x or idx == 0:
                        if not self.soilCons.has_key(no):
                            self.soilCons.setdefault(no, [])
                        self.soilCons[no].append('kx')
                    if jdx == self._soil_module_y or jdx == 0:
                        if not self.soilCons.has_key(no):
                            self.soilCons.setdefault(no, [])
                        self.soilCons[no].append('ky')
                    if kdx == self._soil_module_z:
                        if not self.soilCons.has_key(no):
                            self.soilCons.setdefault(no, [])
                        self.soilCons[no].append('z')

                    self._nodes.append(node_item)
                    count += 1

        self._nodegroup['soiltop'] = soiltop
Exemplo n.º 15
0
 def _GenerateNode(self):
     count = 1
     side = []
     bottom = []
     dx = self._size_x/self._module_x
     dy = self._size_y/self._module_y
     dz = self._size_z/self._module_z
     for kdx in range(0, self._module_z+1):
         for jdx in range(0, self._module_y+1):
             for idx in range(0, self._module_x+1):
                 no = count
                 x = idx * dx - 0.5 * self._size_x
                 y = jdx * dy - 0.5 * self._size_y
                 z = kdx * dz - 0.5 * self._size_z
                 node = NodeItem(no, x, y, z)
                 if (idx == self._module_x or idx == 0 or jdx == self._module_y or jdx == 0) and kdx != self._module_z:
                     side.append(node)
                 if kdx == 0:
                     bottom.append(node)
                 self._nodes.append(node)
                 count += 1
     self._nodegroup['side'] = side
     self._nodegroup['bottom'] = bottom