当前位置: 首页>>代码示例>>C#>>正文


C# DenseMatrix.FillZeros方法代码示例

本文整理汇总了C#中DenseMatrix.FillZeros方法的典型用法代码示例。如果您正苦于以下问题:C# DenseMatrix.FillZeros方法的具体用法?C# DenseMatrix.FillZeros怎么用?C# DenseMatrix.FillZeros使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DenseMatrix的用法示例。


在下文中一共展示了DenseMatrix.FillZeros方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ComputeDLoadRFEM

        private static void ComputeDLoadRFEM( ref DenseMatrix dload , DenseMatrix gdisp ,
                                                int n , double kappa , double acoef ,
                                                List<double> yg , List<double> hg ,
                                                List<double> alpha , List<double> blength ,
                                                List<double> K_nob , List<double> K_nos ,
                                                List<double> K_nrb , List<double> K_nrs ,
                                                List<double> K_trb , List<double> K_trs ,
                                                List<double> A_coefb , List<double> A_coefs ,
                                                List<double> Phi_b , List<double> Phi_s ,
                                                List<double> Coh_b , List<double> Coh_s )
        {
            dload.FillZeros();

            int iii , ii;
            double cos , sin ,
                A0 , A1 , Ab ,
                du , dv ,
                ubar , vbar ,
                Kx , Ky , Kn , Kt , F ,
                tau_n , sigma_n , denom ,
                Ns , Ts , Nb , Tb;

            // loop through nodes to compute ACTUAL loads
            for ( int i = 0 ; i < n ; i++ )
            {
                ii = 2 * i; iii = ii + 1;  // compute (x,y) dof indices

                // ----------------------------------------------------
                // COMPUTE LOAD COMPONENTS DUE TO INTERSLICE STIFFNESS
                // ----------------------------------------------------

                if ( i == 0 )    // FIRST slice only has interslice stiffness on LEADING side
                {
                    /*
                     *
                     * LEADING SLICE INTERFACE
                     * (note: for FIRST slice, there is zero stiffness on the trailing side)
                     *
                     */

                    A1 = hg[1] - yg[1];         // area of slice interface

                    du = gdisp[ii + 2 , 0] - gdisp[ii , 0];       // relative displacements
                    dv = gdisp[iii + 2 , 0] - gdisp[iii , 0];

                    // normal interslice stiffness
                    Kx = A1 * (du <= 0 ? K_nos[i + 1] : K_nrs[i + 1] + kappa / (du + A_coefs[i + 1]));

                    Ns = du * Kx;       // normal force between slices
                    dload[ii , 0] = Ns;

                    // shear interslice stiffness
                    //F = Math.Max(Coh_s[i + 1] - (Ns / A1) * Math.Tan(Phi_s[i + 1]), 0);
                    //Ky = A1 * (K_trs[i + 1] + F / (Math.Abs(dv) + acoef));

                    sigma_n = Ns / A1;
                    denom = Math.Abs( dv );
                    F = sigma_n * Math.Tan( Phi_s[i + 1] ) + Coh_s[i + 1];
                    tau_n = denom > 0.0 ? 0.5 * (K_trs[i + 1] * denom + F) : 0.0;
                    F = Math.Max( F - tau_n , 0 );
                    Ky = A1 * (K_trs[i + 1] + F / (denom + acoef));

                    Ts = dv * Ky;       // shear force between slices
                    dload[iii , 0] = Ts;
                }
                else if ( i == n - 1 ) // LAST slice only has interslice stiffness on TRAILING side
                {
                    /*
                     *
                     * TRAILING SLICE INTERFACE
                     * (note: for LAST slice, there is zero stiffness on the leading side)
                     *
                     */

                    A0 = hg[n - 1] - yg[n - 1];     // area of slice interface

                    du = gdisp[ii , 0] - gdisp[ii - 2 , 0];       // relative displacements
                    dv = gdisp[iii , 0] - gdisp[iii - 2 , 0];

                    // normal interslice stiffness
                    Kx = A0 * (du <= 0 ? K_nos[i] : K_nrs[i] + kappa / (du + A_coefs[i]));

                    Ns = -du * Kx;      // normal force between slices
                    dload[ii , 0] = Ns;

                    // shear interslice stiffness
                    //F = Math.Max(Coh_s[i] - (-Ns / A0) * Math.Tan(Phi_s[i]), 0);
                    //Ky = A0 * (K_trs[i] + F / (Math.Abs(dv) + acoef));

                    sigma_n = -Ns / A0;
                    denom = Math.Abs( dv );
                    F = sigma_n * Math.Tan( Phi_s[i] ) + Coh_s[i];
                    tau_n = denom > 0.0 ? 0.5 * (K_trs[i] * denom + F) : 0.0;
                    F = Math.Max( F - tau_n , 0 );
                    Ky = A0 * (K_trs[i] + F / (denom + acoef));

                    Ts = -dv * Ky;      // shear force between slices
                    dload[iii , 0] = Ts;
                }
                else
//.........这里部分代码省略.........
开发者ID:karcheba,项目名称:SlopeFEA,代码行数:101,代码来源:SlopeCanvasAnalysis.cs


注:本文中的DenseMatrix.FillZeros方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。