Пример #1
0
    def init_mesh(self, n=1, meshtype='tet'):
        """L-shape domain
        \Omega = [-5.5, 5.5]*[-5.5, 5.5]*[-5.5, 5.5]\[-5.5, 0)*[-5.5, 0)*[-5.5,
        5.5]
        """
        node = np.array([
            [-5.5, -5.5, -5.5],
            [5.5, -5.5, -5.5],
            [5.5, 5.5, -5.5],
            [-5.5, 5.5, -5.5],
            [-5.5, -5.5, 5.5],
            [5.5, -5.5, 5.5],
            [5.5, 5.5, 5.5],
            [-5.5, 5.5, 5.5]], dtype=np.float)

        cell = np.array([
            [0, 1, 2, 6],
            [0, 5, 1, 6],
            [0, 4, 5, 6],
            [0, 7, 4, 6],
            [0, 3, 7, 6],
            [0, 2, 3, 6]], dtype=np.int)
        mesh = TetrahedronMesh(node, cell)
        mesh.uniform_bisect(n)
        return mesh
Пример #2
0
    def init_mesh(self, n=1, meshtype='tet'):
        node = np.array([
            [-20, -20, -20],
            [20, -20, -20],
            [20, 20, -20],
            [-20, 20, -20],
            [-20, -20, 20],
            [20, -20, 20],
            [20, 20, 20],
            [-20, 20, 20]], dtype=np.float)

        cell = np.array([
            [0, 1, 2, 6],
            [0, 5, 1, 6],
            [0, 4, 5, 6],
            [0, 7, 4, 6],
            [0, 3, 7, 6],
            [0, 2, 3, 6]], dtype=np.int)
        mesh = TetrahedronMesh(node, cell)
        mesh.uniform_bisect(n)
        return mesh
Пример #3
0
    def init_mesh(self, n=1, meshtype='tet'):
        node = np.array([
            [0, 0, 0],
            [1, 0, 0],
            [1, 1, 0],
            [0, 1, 0],
            [0, 0, 1],
            [1, 0, 1],
            [1, 1, 1],
            [0, 1, 1]], dtype=np.float)

        cell = np.array([
            [0, 1, 2, 6],
            [0, 5, 1, 6],
            [0, 4, 5, 6],
            [0, 7, 4, 6],
            [0, 3, 7, 6],
            [0, 2, 3, 6]], dtype=np.int)
        mesh = TetrahedronMesh(node, cell)
        mesh.uniform_bisect(n)
        mesh.delete_cell(lambda bc: (bc[:, 0] < 0.5) & (bc[:, 1] < 0.5))
        return mesh