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


C++ dataPtr_Type::mu方法代码示例

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


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

示例1: dk_loc

void NeoHookeanMaterialNonLinear<Mesh>::updateNonLinearJacobianTerms ( matrixPtr_Type&       jacobian,
                                                                       const vector_Type&    disp,
                                                                       const dataPtr_Type&   dataMaterial,
                                                                       const mapMarkerVolumesPtr_Type mapsMarkerVolumes,
                                                                       const displayerPtr_Type&  displayer )
{
    displayer->leaderPrint ("   Non-Linear S-  updating non linear terms in the Jacobian Matrix (Neo-Hookean)");

    UInt totalDof = this->M_FESpace->dof().numTotalDof();
    VectorElemental dk_loc (this->M_FESpace->fe().nbFEDof(), nDimensions);

    vector_Type dRep (disp, Repeated);

    //! Number of displacement components
    UInt nc = nDimensions;

    //! Nonlinear part of jacobian
    //! loop on volumes: assembling source term

    mapIterator_Type it;

    for ( it = (*mapsMarkerVolumes).begin(); it != (*mapsMarkerVolumes).end(); it++ )
    {

        //Given the marker pointed by the iterator, let's extract the material parameters
        UInt marker = it->first;

        Real mu     = dataMaterial->mu (marker);
        Real bulk   = dataMaterial->bulk (marker);

        for ( UInt j (0); j < it->second.size(); j++ )
        {
            this->M_FESpace->fe().updateFirstDerivQuadPt ( * (it->second[j]) );

            UInt eleID = this->M_FESpace->fe().currentLocalId();

            for ( UInt iNode = 0; iNode < ( UInt ) this->M_FESpace->fe().nbFEDof(); iNode++ )
            {
                UInt  iloc = this->M_FESpace->fe().patternFirst ( iNode );

                for ( UInt iComp = 0; iComp < nDimensions; ++iComp )
                {
                    UInt ig = this->M_FESpace->dof().localToGlobalMap ( eleID, iloc ) + iComp * this->M_FESpace->dim() + this->M_offset;
                    dk_loc[iloc + iComp * this->M_FESpace->fe().nbFEDof()] = dRep[ig];
                }
            }

            this->M_elmatK->zero();

            //! Computes F, Cof(F), J = det(F), Tr(C)
            computeKinematicsVariables ( dk_loc );

            //! Stiffness for non-linear terms of the Neo-Hookean model
            /*!
              The results of the integrals are stored at each step into elmatK, until to build K matrix of the bilinear form
            */

            //! VOLUMETRIC PART
            //! 1. Stiffness matrix: int { 1/2 * bulk * ( 2 - 1/J + 1/J^2 ) * ( CofF : \nabla \delta ) (CofF : \nabla v) }
            AssemblyElementalStructure::stiff_Jac_Pvol_1term ( 0.5 * bulk, (*M_CofFk), (*M_Jack),
                                                               *this->M_elmatK, this->M_FESpace->fe() );

            //! 2. Stiffness matrix: int { 1/2 * bulk * ( 1/J- 1 - log(J)/J^2 ) * ( CofF [\nabla \delta]^t CofF ) : \nabla v }
            AssemblyElementalStructure::stiff_Jac_Pvol_2term ( 0.5 * bulk, (*M_CofFk), (*M_Jack),
                                                               *this->M_elmatK, this->M_FESpace->fe() );

            //! ISOCHORIC PART
            //! 1. Stiffness matrix : int { -2/3 * mu * J^(-5/3) *( CofF : \nabla \delta ) ( F : \nabla \v ) }
            AssemblyElementalStructure::stiff_Jac_P1iso_NH_1term ( (-2.0 / 3.0) * mu, (*M_CofFk), (*M_Fk), (*M_Jack),
                                                                   *this->M_elmatK, this->M_FESpace->fe() );

            //! 2. Stiffness matrix : int { 2/9 * mu * ( Ic_iso / J^2 )( CofF : \nabla \delta ) ( CofF : \nabla \v ) }
            AssemblyElementalStructure::stiff_Jac_P1iso_NH_2term ( (2.0 / 9.0) * mu, (*M_CofFk), (*M_Jack), (*M_trCisok),
                                                                   *this->M_elmatK, this->M_FESpace->fe() );

            //! 3. Stiffness matrix : int { mu * J^(-2/3) (\nabla \delta : \nabla \v)}
            AssemblyElementalStructure::stiff_Jac_P1iso_NH_3term ( mu, (*M_Jack), *this->M_elmatK, this->M_FESpace->fe() );

            //! 4. Stiffness matrix : int { -2/3 * mu * J^(-5/3) ( F : \nabla \delta ) ( CofF : \nabla \v ) }
            AssemblyElementalStructure::stiff_Jac_P1iso_NH_4term ( (-2.0 / 3.0) * mu, (*M_CofFk), (*M_Fk), (*M_Jack),
                                                                   *this->M_elmatK, this->M_FESpace->fe() );

            //! 5. Stiffness matrix : int { 1/3 * mu * J^(-2) * Ic_iso * (CofF [\nabla \delta]^t CofF ) : \nabla \v }
            AssemblyElementalStructure::stiff_Jac_P1iso_NH_5term ( (1.0 / 3.0) * mu, (*M_CofFk), (*M_Jack), (*M_trCisok),
                                                                   *this->M_elmatK, this->M_FESpace->fe() );

            //! assembling
            for ( UInt ic = 0; ic < nc; ++ic )
            {
                for ( UInt jc = 0; jc < nc; jc++ )
                {
                    assembleMatrix ( *jacobian,
                                     *this->M_elmatK,
                                     this->M_FESpace->fe(),
                                     this->M_FESpace->dof(),
                                     ic, jc,
                                     this->M_offset +  ic * totalDof, this->M_offset +  jc * totalDof );
                }
            }
        }
//.........这里部分代码省略.........
开发者ID:erianthus,项目名称:lifev,代码行数:101,代码来源:NeoHookeanMaterialNonLinear.hpp

示例2: assembleMatrix

void VenantKirchhoffMaterialLinear<Mesh>::computeLinearStiff(dataPtr_Type& dataMaterial,
                                                             const mapMarkerVolumesPtr_Type mapsMarkerVolumes)
{
    //  std::cout<<"compute LinearStiff Matrix start\n";

    UInt totalDof = this->M_FESpace->dof().numTotalDof();
    // Number of displacement components
    UInt nc = nDimensions;

    //Compute the linear part of the Stiffness Matrix.
    //In the case of Linear Material it is the Stiffness Matrix.
    //In the case of NonLinear Materials it must be added of the non linear part.

    mapIterator_Type it;

    for( it = (*mapsMarkerVolumes).begin(); it != (*mapsMarkerVolumes).end(); it++ )
    {

        //Given the marker pointed by the iterator, let's extract the material parameters
        UInt marker = it->first;

        Real mu = dataMaterial->mu(marker);
        Real lambda = dataMaterial->lambda(marker);

        //Given the parameters I loop over the volumes with that marker
        for ( UInt j(0); j < it->second.size(); j++ )
        {
            this->M_FESpace->fe().updateFirstDerivQuadPt( *(it->second[j]) );

            this->M_elmatK->zero();

            //These methods are implemented in AssemblyElemental.cpp
            //They have been kept in AssemblyElemental in order to avoid repetitions
            stiff_strain( 2*mu, *this->M_elmatK, this->M_FESpace->fe() );// here in the previous version was 1. (instead of 2.)
            stiff_div   ( lambda, *this->M_elmatK, this->M_FESpace->fe() );// here in the previous version was 0.5 (instead of 1.)

            //this->M_elmatK->showMe();

            // assembling
            for ( UInt ic = 0; ic < nc; ic++ )
            {
                for ( UInt jc = 0; jc < nc; jc++ )
                {
                    assembleMatrix( *this->M_linearStiff,
                                    *this->M_elmatK,
                                    this->M_FESpace->fe(),
                                    this->M_FESpace->fe(),
                                    this->M_FESpace->dof(),
                                    this->M_FESpace->dof(),
                                    ic,  jc,
                                    this->M_offset +ic*totalDof, this->M_offset + jc*totalDof );

                }
            }


        }

    }

    this->M_linearStiff->globalAssemble();

    //Initialization of the pointer M_stiff to what is pointed by M_linearStiff
    this->M_stiff = this->M_linearStiff;
    //   std::cout<<"compute LinearStiff Matrix end\n";
    this->M_jacobian = this->M_linearStiff;
}
开发者ID:xyuan,项目名称:lifev,代码行数:67,代码来源:VenantKirchhoffMaterialLinear.hpp


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