Пример #1
0
def test_reduced_mesh_save_collapsed_vector(mesh, save_tempdir):
    test_logger.log(DEBUG, "*** Collapsed case, vector, offline computation ***")
    (V, _) = CollapsedFunctionSpaces(mesh)
    reduced_mesh = ReducedMesh((V, ))
    dofs = [(2, ), (48, ), (40, ), (11, )]

    for pair in dofs:
        test_logger.log(DEBUG, "Adding " + str(pair))
        reduced_mesh.append(pair)

        reduced_mesh.save(save_tempdir, "test_reduced_mesh_collapsed_vector")

    _test_reduced_mesh_collapsed_vector(V, reduced_mesh)
Пример #2
0
def test_reduced_mesh_save_elliptic_matrix(mesh, save_tempdir):
    test_logger.log(DEBUG, "*** Elliptic case, matrix, offline computation ***")
    V = EllipticFunctionSpace(mesh)
    reduced_mesh = ReducedMesh((V, V))
    dofs = [(1, 2), (11, 12), (48, 12), (41, 41)]

    for pair in dofs:
        test_logger.log(DEBUG, "Adding " + str(pair))
        reduced_mesh.append(pair)

        reduced_mesh.save(save_tempdir, "test_reduced_mesh_elliptic_matrix")

    _test_reduced_mesh_elliptic_matrix(V, reduced_mesh)
Пример #3
0
def test_reduced_mesh_save_collapsed_matrix(mesh, save_tempdir):
    test_logger.log(DEBUG, "*** Collapsed case, matrix, offline computation ***")
    (V, U) = CollapsedFunctionSpaces(mesh)
    reduced_mesh = ReducedMesh((V, U))
    dofs = [(2, 1), (48, 33), (40, 12), (31, 39)]

    for pair in dofs:
        test_logger.log(DEBUG, "Adding " + str(pair))
        reduced_mesh.append(pair)

        reduced_mesh.save(save_tempdir, "test_reduced_mesh_collapsed_matrix")

    _test_reduced_mesh_collapsed_matrix(V, U, reduced_mesh)
Пример #4
0
def test_reduced_mesh_save_mixed_vector(mesh, save_tempdir):
    test_logger.log(DEBUG, "*** Mixed case, vector, offline computation ***")
    V = MixedFunctionSpace(mesh)
    reduced_mesh = ReducedMesh((V, ))
    dofs = [(2, ), (33, ), (48, ), (42, )]

    for pair in dofs:
        test_logger.log(DEBUG, "Adding " + str(pair))
        reduced_mesh.append(pair)

        reduced_mesh.save(save_tempdir, "test_reduced_mesh_mixed_vector")

    _test_reduced_mesh_mixed_vector(V, reduced_mesh)
Пример #5
0
def test_reduced_mesh_save_mixed_matrix(mesh, save_tempdir):
    test_logger.log(DEBUG, "*** Mixed case, matrix, offline computation ***")
    V = MixedFunctionSpace(mesh)
    reduced_mesh = ReducedMesh((V, V))
    dofs = [(1, 2), (31, 33), (48, 12), (42, 42)]

    for pair in dofs:
        test_logger.log(DEBUG, "Adding " + str(pair))
        reduced_mesh.append(pair)

        reduced_mesh.save(save_tempdir, "test_reduced_mesh_mixed_matrix")

    _test_reduced_mesh_mixed_matrix(V, reduced_mesh)
Пример #6
0
def test_reduced_mesh_save_elliptic_vector(mesh, save_tempdir):
    test_logger.log(DEBUG, "*** Elliptic case, vector, offline computation ***")
    V = EllipticFunctionSpace(mesh)
    reduced_mesh = ReducedMesh((V, ))
    dofs = [(1, ), (11, ), (48, ), (41, )]

    for pair in dofs:
        test_logger.log(DEBUG, "Adding " + str(pair))
        reduced_mesh.append(pair)

        reduced_mesh.save(save_tempdir, "test_reduced_mesh_elliptic_vector")

    _test_reduced_mesh_elliptic_vector(V, reduced_mesh)
Пример #7
0
def test_reduced_mesh_save_elliptic_function(mesh, save_tempdir):
    log(PROGRESS, "*** Elliptic case, function, offline computation ***")
    V = EllipticFunctionSpace(mesh)
    reduced_mesh = ReducedMesh((V, ))
    dofs = [(1, ), (11, ), (48, ), (41, )]

    for pair in dofs:
        log(PROGRESS, "Adding " + str(pair))
        reduced_mesh.append(pair)
        
        reduced_mesh.save(save_tempdir, "test_reduced_mesh_elliptic_function")
        
    _test_reduced_mesh_elliptic_function(V, reduced_mesh)