• 大小: 93KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-11
  • 语言: Matlab
  • 标签: matlab  

资源简介

stokes(matlab) 一维和二维 有限元程序,自己初学时写的,相对比较简单,适用于初学者.

资源截图

代码片段和文件信息

function A = assemble_matrix_volume_in_2D(function_cmatrix_sizePTTb_trialTb_test...
                       trial_basis_index_length test_basis_index_length...
                       Gauss_coefficient_reference_2DGauss_point_reference_2D...
                       number_of_elements...
                       basis_type_trialtrial_der_xtrial_der_y...
                       basis_type_testtest_der_xtest_der_y)
% PPT Chap3 P32 
                       
% [Gauss_coefficient_reference_2DGauss_point_reference_2D]=generate_Gauss_reference_2D(Gauss_point_number);

A=sparse(matrix_size(1)matrix_size(2));
% number_of_elements = size(Tb2);
% number_of_local_basis_trial  = generate_local_basis_number_2D(basis_type_trial);
% number_of_local_basis_test  = generate_local_basis_number_2D(basis_type_test);
for n=1:number_of_elements 
    vertices=P(:T(:n));%第n个单元的网格节点坐标
    
[Gauss_weightGauss_point] = generate_Gauss_local_2D(Gauss_coefficient_reference_2DGauss_point_reference_2Dvertices);  
                        
    %或者(verticetype)
    %生成局部高斯节点及其相应权重
    
    for alpha = 1:trial_basis_index_length
        for beta = 1:test_basis_index_length
           
           int_value=Gauss_vol_int_trial_test_2D(function_cGauss_weightGauss_pointvertices...
                basis_type_trialalphatrial_der_xtrial_der_y...
                basis_type_testbetatest_der_xtest_der_y);
           
           A(Tb_test(betan)Tb_trial(alphan))=A(Tb_test(betan)Tb_trial(alphan))+int_value;
        
        end
    end
end                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-11-01 10:48  Stokes\
     目录           0  2018-11-01 10:48  Stokes\stokes_2D\
     文件          31  2018-01-07 05:16  Stokes\stokes_2D\read me.txt
     文件          62  2018-01-07 07:56  Stokes\stokes_2D\function_nu.m
     文件          86  2018-01-06 06:43  Stokes\stokes_2D\exact_p_x.m
     文件          69  2018-01-06 06:44  Stokes\stokes_2D\exact_u1_x.m
     文件          70  2018-01-06 06:44  Stokes\stokes_2D\exact_u2_y.m
     文件          70  2018-01-07 07:56  Stokes\stokes_2D\function_nagativeone.m
     文件          76  2018-01-06 06:43  Stokes\stokes_2D\exact_u1.m
     文件          77  2018-01-06 06:44  Stokes\stokes_2D\exact_u1_y.m
     文件          78  2018-01-06 06:48  Stokes\stokes_2D\function_fix_p.m
     文件          84  2018-01-06 06:44  Stokes\stokes_2D\exact_u2_x.m
     文件          85  2018-01-06 06:44  Stokes\stokes_2D\exact_u2.m
     文件          87  2018-01-06 06:43  Stokes\stokes_2D\exact_p.m
     文件          93  2018-01-06 06:43  Stokes\stokes_2D\exact_p_y.m
     文件         126  2018-01-05 09:09  Stokes\stokes_2D\function_g1.m
     文件         135  2018-01-05 09:09  Stokes\stokes_2D\function_g2.m
     文件         182  2017-12-29 08:04  Stokes\stokes_2D\generate_initial_u0.m
     文件         276  2017-12-27 09:23  Stokes\stokes_2D\generate_local_basis_number_2D.m
     文件         304  2017-12-26 12:27  Stokes\stokes_2D\FE_function_1D.m
     文件         324  2018-01-06 07:08  Stokes\stokes_2D\FE_function_2D.m
     文件         489  2017-12-27 13:14  Stokes\stokes_2D\treat_Dirichlet_boundary_2D.m
     文件         575  2017-12-27 08:17  Stokes\stokes_2D\Gauss_vol_int_test_2D.m
     文件         661  2017-12-27 09:52  Stokes\stokes_2D\generate_Gauss_local_2D.m
     文件         737  2017-12-13 07:55  Stokes\stokes_2D\generate_Gauss_local_1D.m
     文件         763  2017-12-19 09:15  Stokes\stokes_2D\generate_PT_2D.m
     文件         968  2018-01-06 07:05  Stokes\stokes_2D\compute_inf_error_2D.m
     文件         969  2018-01-05 14:26  Stokes\stokes_2D\compute_Hs_error_2D.m
     文件        1079  2017-12-20 12:45  Stokes\stokes_2D\generate_PbTb_2D.m
     文件        1103  2017-12-13 07:11  Stokes\stokes_2D\generate_Gauss_reference_1D.m
     文件        1323  2018-01-05 13:50  Stokes\stokes_2D\fix_pressure_Stokes.m
............此处省略107个文件信息

评论

共有 条评论