Пример #1
0
    def face_normals_and_jacobians(cls, vertices, affine_map):
        """Compute the normals and face jacobians of the unit element
        transformed according to `affine_map'.

        Returns a pair of lists [normals], [jacobians].
        """
        from hedge._internal import tetrahedron_fj_and_normal
        from hedge.tools import sign

        return tetrahedron_fj_and_normal(sign(affine_map.jacobian()),
                                         cls.face_vertex_numbers, vertices)
Пример #2
0
    def face_normals_and_jacobians(cls, vertices, affine_map):
        """Compute the normals and face jacobians of the unit element
        transformed according to `affine_map'.

        Returns a pair of lists [normals], [jacobians].
        """
        from hedge._internal import tetrahedron_fj_and_normal
        from hedge.tools import sign

        return tetrahedron_fj_and_normal(
                sign(affine_map.jacobian()),
                cls.face_vertex_numbers,
                vertices)
Пример #3
0
    def face_normals_and_jacobians(vertices, affine_map):
        """Compute the normals and face jacobians of the unit element
        transformed according to `affine_map'.

        Returns a pair of lists [normals], [jacobians].
        """
        from hedge.tools import sign

        m = affine_map.matrix
        orient = sign(affine_map.jacobian())
        face1 = m[:, 1] - m[:, 0]
        raw_normals = [
                orient*numpy.array([m[1, 0], -m[0, 0]]),
                orient*numpy.array([face1[1], -face1[0]]),
                orient*numpy.array([-m[1, 1], m[0, 1]]),
                ]

        face_lengths = [numpy.linalg.norm(fn) for fn in raw_normals]
        return [n/fl for n, fl in zip(raw_normals, face_lengths)], \
                face_lengths
Пример #4
0
    def face_normals_and_jacobians(vertices, affine_map):
        """Compute the normals and face jacobians of the unit element
        transformed according to `affine_map'.

        Returns a pair of lists [normals], [jacobians].
        """
        from hedge.tools import sign

        m = affine_map.matrix
        orient = sign(affine_map.jacobian())
        face1 = m[:, 1] - m[:, 0]
        raw_normals = [
            orient * numpy.array([m[1, 0], -m[0, 0]]),
            orient * numpy.array([face1[1], -face1[0]]),
            orient * numpy.array([-m[1, 1], m[0, 1]]),
        ]

        face_lengths = [numpy.linalg.norm(fn) for fn in raw_normals]
        return [n/fl for n, fl in zip(raw_normals, face_lengths)], \
                face_lengths