コード例 #1
0
def gen_lagrangle_shape_function():
    lagrangle_shape_func_nodes_num = rand.randint(1, all_lagrangle_nodes_size)
    lagrangle_shape_function = common_tools.gen_matrix(
        (1, lagrangle_shape_func_nodes_num), rand)
    lagrangle_assemble_indes = common_tools.gen_nodes_indes(
        lagrangle_shape_func_nodes_num, all_nodes_size,
        all_nodes_size + all_lagrangle_nodes_size, rand)
    return (lagrangle_assemble_indes, lagrangle_shape_function)
コード例 #2
0
def gen_test_trial_shape_function():
    shape_func_nodes_num = rand.randint(1, all_nodes_size // 2)
    test_shape_function = common_tools.gen_matrix((1, shape_func_nodes_num),
                                                  rand)
    trial_shape_function = common_tools.gen_matrix((1, shape_func_nodes_num),
                                                   rand)
    assembly_indes = common_tools.gen_nodes_indes(shape_func_nodes_num, 0,
                                                  all_nodes_size, rand)
    return (assembly_indes, test_shape_function, trial_shape_function)
コード例 #3
0
ファイル: neumann_assembler.py プロジェクト: epsilony/mf
def gen_test_data(value_dimension):
    data = {}
    data['allNodesSize'] = all_nodes_size
    data['valueDimension'] = value_dimension
    data['weight'] = rand.random()
    data['load'] = common_tools.gen_vector(value_dimension, rand)
    
    shape_func_nodes_num = rand.randint(1, all_nodes_size // 2)
    test_shape_function = common_tools.gen_matrix((1, shape_func_nodes_num), rand)
    nodes_assemble_indes = common_tools.gen_nodes_indes(shape_func_nodes_num, 0, all_nodes_size, rand)
    
    data['testShapeFunction'] = test_shape_function
    data['assemblyIndes'] = nodes_assemble_indes
    
    whole_test_shape_function_vector = common_tools.shape_func_to_whole_vector(test_shape_function, nodes_assemble_indes, all_nodes_size)
    data['mainVectorDifference'] = assemble_general_force(data['weight'], data['load'], whole_test_shape_function_vector)
    
    return data
コード例 #4
0
def gen_test_data(value_dimension):
    data = {}
    data['allNodesSize'] = all_nodes_size
    data['valueDimension'] = value_dimension
    data['weight'] = rand.random()
    data['load'] = common_tools.gen_vector(value_dimension, rand)

    shape_func_nodes_num = rand.randint(1, all_nodes_size // 2)
    test_shape_function = common_tools.gen_matrix((1, shape_func_nodes_num),
                                                  rand)
    nodes_assemble_indes = common_tools.gen_nodes_indes(
        shape_func_nodes_num, 0, all_nodes_size, rand)

    data['testShapeFunction'] = test_shape_function
    data['assemblyIndes'] = nodes_assemble_indes

    whole_test_shape_function_vector = common_tools.shape_func_to_whole_vector(
        test_shape_function, nodes_assemble_indes, all_nodes_size)
    data['mainVectorDifference'] = assemble_general_force(
        data['weight'], data['load'], whole_test_shape_function_vector)

    return data
コード例 #5
0
def gen_test_trial_shape_function(spatial_dimension):
    shape_func_nodes_num = rand.randint(1, all_nodes_size // 2)
    test_shape_function = common_tools.gen_matrix((1 + spatial_dimension, shape_func_nodes_num), rand)
    trial_shape_function = common_tools.gen_matrix((1 + spatial_dimension, shape_func_nodes_num), rand)
    assembly_indes = common_tools.gen_nodes_indes(shape_func_nodes_num, 0, all_nodes_size, rand)
    return (assembly_indes, test_shape_function, trial_shape_function)
コード例 #6
0
def gen_lagrangle_shape_function():
    lagrangle_shape_func_nodes_num = rand.randint(1, all_lagrangle_nodes_size)
    lagrangle_shape_function = common_tools.gen_matrix((1, lagrangle_shape_func_nodes_num), rand)
    lagrangle_assemble_indes = common_tools.gen_nodes_indes(lagrangle_shape_func_nodes_num, all_nodes_size, all_nodes_size + all_lagrangle_nodes_size, rand)
    return (lagrangle_assemble_indes, lagrangle_shape_function)