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


C++ StructuralElement::giveLocalCoordinateSystem方法代码示例

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


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

示例1: giveTensorRotationMatrix

void
OrthotropicLinearElasticMaterial :: giveTensorRotationMatrix(FloatMatrix &answer, GaussPoint *gp)
//
// returns [3,3] rotation matrix from local principal axes of material
// to local axes used at gp (element) level
//
{
    int elementCsFlag;
    FloatMatrix elementCs;
    StructuralElement *element = static_cast< StructuralElement * >( gp->giveElement() );

    if ( gp->giveMaterialMode() == _1dMat ) { //do not rotate 1D materials on trusses and beams
        answer.resize(3, 3);
        answer.beUnitMatrix();
        return;
    }

    elementCsFlag = element->giveLocalCoordinateSystem(elementCs);
    //
    // in localCoordinateSystem the directional cosines are stored columwise (exception)
    // in elementCs rowwise.
    //
    if ( this->cs_type == localCS ) {
        //
        // in localCoordinateSystem are stored directional cosines
        //
        if ( elementCsFlag ) {
            answer.beProductOf(elementCs, * this->localCoordinateSystem);
        } else {
            answer = * this->localCoordinateSystem;
        }
    } else if ( this->cs_type == shellCS ) {
        FloatArray elementNormal, helpx, helpy;
        localCoordinateSystem = new FloatMatrix(3, 3);

        element->computeMidPlaneNormal(elementNormal, gp);
        helpx.beVectorProductOf(* ( this->helpPlaneNormal ), elementNormal);
        // test if localCoordinateSystem is uniquely
        // defined by elementNormal and helpPlaneNormal
        if ( helpx.computeNorm() < ZERO_LENGTH ) {
            OOFEM_ERROR("element normal parallel to plane normal encountered");
        }

        helpy.beVectorProductOf(elementNormal, helpx);
        for ( int i = 1; i < 4; i++ ) {
            localCoordinateSystem->at(i, 1) = helpx.at(i);
            localCoordinateSystem->at(i, 2) = helpy.at(i);
            localCoordinateSystem->at(i, 3) = elementNormal.at(i);
        }

        //
        // possible rotation about local z-axis should be considered in future
        //
        /*
         * //
         * // GiveZRotationMtrx assembles rotMtrx from cs rotated from curent about rotAngle
         * // to current cs
         * //
         * zRotMtrx = GiveZRotationMtrx (rotAngle); // rotAngle supplied by user
         * rotatedLocalCoordinateSystem = localCoordinateSystem->Times (zRotMtrx);
         * delete localCoordinateSystem;
         * localCoordinateSystem = rotatedLocalCoordinateSystem;
         */
        if ( elementCsFlag ) {
            answer.beProductOf(elementCs, * this->localCoordinateSystem);
        } else {
            answer = * this->localCoordinateSystem;
        }

        delete localCoordinateSystem;
        localCoordinateSystem = NULL;
    } else {
        OOFEM_ERROR("internal error no cs defined");
    }
    // t at (i,j) contains cosine of angle between elementAxis(i) and localMaterialAxis(j).
}
开发者ID:framby,项目名称:OOFEM_Johannes,代码行数:76,代码来源:ortholinearelasticmaterial.C


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