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


C++ oofegGraphicContext::getDefScale方法代码示例

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


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

示例1: drawDeformedGeometry

void LSpace :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type)
{
    int i;
    WCRec p [ 8 ];
    GraphicObj *go;
    double defScale = gc.getDefScale();

    if ( !gc.testElementGraphicActivity(this) ) {
        return;
    }

    EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
    EASValsSetColor( gc.getDeformedElementColor() );
    EASValsSetEdgeColor( gc.getElementEdgeColor() );
    EASValsSetEdgeFlag(true);
    EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);
    EASValsSetFillStyle(FILL_SOLID);
    for ( i = 0; i < 8; i++ ) {
        p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
        p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
        p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(3, tStep, defScale);
    }

    go =  CreateHexahedron(p);
    EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
    EMAddGraphicsToModel(ESIModel(), go);
}
开发者ID:rreissnerr,项目名称:oofem,代码行数:27,代码来源:lspace.C

示例2: drawDeformedGeometry

void QTrPlaneStrain :: drawDeformedGeometry(oofegGraphicContext &gc, UnknownType type)
{
    WCRec p [ 3 ];
    GraphicObj *go;
    TimeStep *tStep = domain->giveEngngModel()->giveCurrentStep();
    double defScale = gc.getDefScale();

    if ( !gc.testElementGraphicActivity(this) ) {
        return;
    }

    EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
    EASValsSetColor( gc.getDeformedElementColor() );
    EASValsSetEdgeColor( gc.getElementEdgeColor() );
    EASValsSetEdgeFlag(true);
    EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);
    p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, EID_MomentumBalance, defScale);
    p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, EID_MomentumBalance, defScale);
    p [ 0 ].z = 0.;
    p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, EID_MomentumBalance, defScale);
    p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, EID_MomentumBalance, defScale);
    p [ 1 ].z = 0.;
    p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(1, tStep, EID_MomentumBalance, defScale);
    p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(2, tStep, EID_MomentumBalance, defScale);
    p [ 2 ].z = 0.;

    go =  CreateTriangle3D(p);
    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
    EMAddGraphicsToModel(ESIModel(), go);
}
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:30,代码来源:qtrplanestrain.C

示例3: drawDeformedGeometry

void
TR_SHELL02 :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type)
{
    WCRec p [ 3 ];
    GraphicObj *go;
    double defScale = gc.getDefScale();

    if ( !gc.testElementGraphicActivity(this) ) {
        return;
    }

    if ( this->giveMaterial()->isActivated(tStep) ) {
        EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
        EASValsSetColor( gc.getDeformedElementColor() );
        EASValsSetEdgeColor( gc.getElementEdgeColor() );
        EASValsSetEdgeFlag(true);
        EASValsSetFillStyle(FILL_SOLID);
        EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);
        p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);
        p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);
        p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(3, tStep, defScale);
        p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);
        p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);
        p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(3, tStep, defScale);
        p [ 2 ].x = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(1, tStep, defScale);
        p [ 2 ].y = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(2, tStep, defScale);
        p [ 2 ].z = ( FPNum ) this->giveNode(3)->giveUpdatedCoordinate(3, tStep, defScale);

        go =  CreateTriangle3D(p);
        EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK | LAYER_MASK, go);
        EMAddGraphicsToModel(ESIModel(), go);
    }
}
开发者ID:rainbowlqs,项目名称:oofem,代码行数:33,代码来源:tr_shell02.C

示例4: drawDeformedGeometry

void InterfaceElem2dQuad :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type)
{
    GraphicObj *go;
    //  if (!go) { // create new one
    WCRec p [ 2 ]; /* poin */
    if ( !gc.testElementGraphicActivity(this) ) {
        return;
    }

    double defScale = gc.getDefScale();

    EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
    EASValsSetColor( gc.getDeformedElementColor() );
    EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER + 1);
    p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);
    p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);
    p [ 0 ].z = 0.0;
    p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale);
    p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale);
    p [ 1 ].z = 0.0;
    go = CreateLine3D(p);
    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
    EMAddGraphicsToModel(ESIModel(), go);

    p [ 0 ].x = ( FPNum ) this->giveNode(4)->giveUpdatedCoordinate(1, tStep, defScale);
    p [ 0 ].y = ( FPNum ) this->giveNode(4)->giveUpdatedCoordinate(2, tStep, defScale);
    p [ 0 ].z = 0.0;
    p [ 1 ].x = ( FPNum ) this->giveNode(5)->giveUpdatedCoordinate(1, tStep, defScale);
    p [ 1 ].y = ( FPNum ) this->giveNode(5)->giveUpdatedCoordinate(2, tStep, defScale);
    p [ 1 ].z = 0.0;
    go = CreateLine3D(p);
    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
    EMAddGraphicsToModel(ESIModel(), go);
}
开发者ID:rreissnerr,项目名称:oofem,代码行数:34,代码来源:interfaceelem2dquad.C

示例5: drawDeformedGeometry

void LIBeam3dNL :: drawDeformedGeometry(oofegGraphicContext &gc, UnknownType type)
{
    GraphicObj *go;

    if ( !gc.testElementGraphicActivity(this) ) {
        return;
    }

    TimeStep *tStep = domain->giveEngngModel()->giveCurrentStep();
    double defScale = gc.getDefScale();
    //  if (!go) { // create new one
    WCRec p [ 2 ]; /* poin */
    EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
    EASValsSetColor( gc.getDeformedElementColor() );
    EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);
    p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, EID_MomentumBalance, defScale);
    p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, EID_MomentumBalance, defScale);
    p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(3, tStep, EID_MomentumBalance, defScale);

    p [ 1 ].x = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(1, tStep, EID_MomentumBalance, defScale);
    p [ 1 ].y = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(2, tStep, EID_MomentumBalance, defScale);
    p [ 1 ].z = ( FPNum ) this->giveNode(2)->giveUpdatedCoordinate(3, tStep, EID_MomentumBalance, defScale);
    go = CreateLine3D(p);
    EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
    EMAddGraphicsToModel(ESIModel(), go);
}
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:26,代码来源:libeam3dnl.C

示例6: gcoord

void InterfaceElem1d :: drawScalar(oofegGraphicContext &context)
{
    int i, indx, result = 0;
    GaussPoint *gp;
    IntegrationRule *iRule = integrationRulesArray [ giveDefaultIntegrationRule() ];
    TimeStep *tStep = this->giveDomain()->giveEngngModel()->giveCurrentStep();
    FloatArray gcoord(3), v1;
    WCRec p [ 1 ];
    IntArray map;
    GraphicObj *go;
    double val [ 1 ];

    if ( !context.testElementGraphicActivity(this) ) {
        return;
    }

    if ( context.getInternalVarsDefGeoFlag() ) {
        double defScale = context.getDefScale();
        p [ 0 ].x = ( FPNum ) 0.5 * ( this->giveNode(1)->giveUpdatedCoordinate(1, tStep, EID_MomentumBalance, defScale) +
                                     this->giveNode(2)->giveUpdatedCoordinate(1, tStep, EID_MomentumBalance, defScale) );
        p [ 0 ].y = ( FPNum ) 0.5 * ( this->giveNode(1)->giveUpdatedCoordinate(2, tStep, EID_MomentumBalance, defScale) +
                                     this->giveNode(2)->giveUpdatedCoordinate(2, tStep, EID_MomentumBalance, defScale) );
        p [ 0 ].z = ( FPNum ) 0.5 * ( this->giveNode(1)->giveUpdatedCoordinate(3, tStep, EID_MomentumBalance, defScale) +
                                     this->giveNode(2)->giveUpdatedCoordinate(3, tStep, EID_MomentumBalance, defScale) );
    } else {
        p [ 0 ].x = ( FPNum )( this->giveNode(1)->giveCoordinate(1) );
        p [ 0 ].y = ( FPNum )( this->giveNode(1)->giveCoordinate(2) );
        p [ 0 ].z = ( FPNum )( this->giveNode(1)->giveCoordinate(3) );
    }

    result += giveIPValue(v1, iRule->getIntegrationPoint(0), context.giveIntVarType(), tStep);


    for ( i = 0; i < iRule->getNumberOfIntegrationPoints(); i++ ) {
        result = 0;
        gp  = iRule->getIntegrationPoint(i);
        result += giveIPValue(v1, gp, context.giveIntVarType(), tStep);
        result += this->giveIntVarCompFullIndx( map, context.giveIntVarType() );
        if ( result != 2 ) {
            continue;
        }

        if ( ( indx = map.at( context.giveIntVarIndx() ) ) == 0 ) {
            return;
        }

        val [ 0 ] = v1.at(indx);
        context.updateFringeTableMinMax(val, 1);

        EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
        EASValsSetMType(FILLED_CIRCLE_MARKER);
        go = CreateMarkerWD3D(p, val [ 0 ]);
        EGWithMaskChangeAttributes(LAYER_MASK | FILL_MASK | MTYPE_MASK, go);
        EMAddGraphicsToModel(ESIModel(), go);
        //}
    }
}
开发者ID:MartinFagerstrom,项目名称:oofem,代码行数:57,代码来源:interfaceelement1d.C

示例7: drawScalar

void LSpace :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
{
    int i, indx, result = 0;
    WCRec p [ 8 ];
    GraphicObj *tr;
    FloatArray v [ 8 ];
    double s [ 8 ], defScale = 0.0;

    if ( !gc.testElementGraphicActivity(this) ) {
        return;
    }

    if ( gc.giveIntVarMode() == ISM_recovered ) {
        for ( i = 1; i <= 8; i++ ) {
            result += this->giveInternalStateAtNode(v [ i - 1 ], gc.giveIntVarType(), gc.giveIntVarMode(), i, tStep);
        }

        if ( result != 8 ) {
            return;
        }
    } else if ( gc.giveIntVarMode() == ISM_local ) {
        return;
    }

    indx = gc.giveIntVarIndx();

    for ( i = 1; i <= 8; i++ ) {
        s [ i - 1 ] = v [ i - 1 ].at(indx);
    }

    EASValsSetEdgeColor( gc.getElementEdgeColor() );
    EASValsSetEdgeFlag(true);
    EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
    if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
        for ( i = 0; i < 8; i++ ) {
            if ( gc.getInternalVarsDefGeoFlag() ) {
                // use deformed geometry
                defScale = gc.getDefScale();
                p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
                p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
                p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(3, tStep, defScale);
            } else {
                p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
                p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
                p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(3);
            }
        }

        gc.updateFringeTableMinMax(s, 8);
        tr = CreateHexahedronWD(p, s);
        EGWithMaskChangeAttributes(LAYER_MASK | EDGE_COLOR_MASK | EDGE_FLAG_MASK, tr);
        EMAddGraphicsToModel(ESIModel(), tr);
    }
}
开发者ID:rreissnerr,项目名称:oofem,代码行数:54,代码来源:lspace.C

示例8: gcoord

void IntElPoint :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
{
    int indx, result = 0;
    IntegrationRule *iRule = this->giveDefaultIntegrationRulePtr();
    FloatArray gcoord(3), v1;
    WCRec p [ 1 ];
    GraphicObj *go;
    double val [ 1 ];

    if ( !gc.testElementGraphicActivity(this) ) {
        return;
    }

    if ( gc.getInternalVarsDefGeoFlag() ) {
        double defScale = gc.getDefScale();
        p [ 0 ].x = ( FPNum ) 0.5 * ( this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale) +
                                     this->giveNode(2)->giveUpdatedCoordinate(1, tStep, defScale) );
        p [ 0 ].y = ( FPNum ) 0.5 * ( this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale) +
                                     this->giveNode(2)->giveUpdatedCoordinate(2, tStep, defScale) );
        p [ 0 ].z = ( FPNum ) 0.5 * ( this->giveNode(1)->giveUpdatedCoordinate(3, tStep,  defScale) +
                                     this->giveNode(2)->giveUpdatedCoordinate(3, tStep, defScale) );
    } else {
        p [ 0 ].x = ( FPNum ) ( this->giveNode(1)->giveCoordinate(1) );
        p [ 0 ].y = ( FPNum ) ( this->giveNode(1)->giveCoordinate(2) );
        p [ 0 ].z = ( FPNum ) ( this->giveNode(1)->giveCoordinate(3) );
    }

    result += giveIPValue(v1, iRule->getIntegrationPoint(0), gc.giveIntVarType(), tStep);


    for ( GaussPoint *gp: *iRule ) {
        result = 0;
        result += giveIPValue(v1, gp, gc.giveIntVarType(), tStep);
        if ( result != 1 ) {
            continue;
        }

        indx = gc.giveIntVarIndx();

        val [ 0 ] = v1.at(indx);
        gc.updateFringeTableMinMax(val, 1);

        EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
        EASValsSetMType(FILLED_CIRCLE_MARKER);
        go = CreateMarkerWD3D(p, val [ 0 ]);
        EGWithMaskChangeAttributes(LAYER_MASK | FILL_MASK | MTYPE_MASK, go);
        EMAddGraphicsToModel(ESIModel(), go);
        //}
    }
}
开发者ID:erisve,项目名称:oofem,代码行数:50,代码来源:intelpoint.C

示例9: drawDeformedGeometry

void CohesiveSurface3d :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type)
{
    GraphicObj *go1, *go2;

    if ( !gc.testElementGraphicActivity(this) ) {
        return;
    }

    double defScale = gc.getDefScale();
    WCRec p [ 2 ];
    EASValsSetLineWidth(OOFEG_DEFORMED_GEOMETRY_WIDTH);
    EASValsSetColor( gc.getDeformedElementColor() );
    EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);

    //  get the displaced particle coordinates
    Particle *nodeA = ( Particle * ) giveNode(1);
    Particle *nodeB = ( Particle * ) giveNode(2);
    p [ 0 ].x = nodeA->giveUpdatedCoordinate(1, tStep, defScale);
    p [ 0 ].y = nodeA->giveUpdatedCoordinate(2, tStep, defScale);
    p [ 0 ].z = nodeA->giveUpdatedCoordinate(3, tStep, defScale);

    p [ 1 ].x = nodeB->giveUpdatedCoordinate(1, tStep, defScale);
    p [ 1 ].y = nodeB->giveUpdatedCoordinate(2, tStep, defScale);
    p [ 1 ].z = nodeB->giveUpdatedCoordinate(3, tStep, defScale);

    // plot the displaced particles
    EASValsSetMType(FILLED_CIRCLE_MARKER);
    EASValsSetColor( gc.getNodeColor() );
    EASValsSetMSize(6);

    // plot the first particle
    go1 = CreateMarker3D(p);
    EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | MTYPE_MASK | MSIZE_MASK, go1);
    EMAddGraphicsToModel(ESIModel(), go1);

    // take into account periodic conditions
    if ( giveNumberOfNodes() == 3 ) {
        Node *nodeC = ( Particle * ) giveNode(3);
        p [ 1 ].x += kxa + kxa * defScale * ( nodeC->giveDofWithID(D_u)->giveUnknown(VM_Total, tStep) ) + kyb * defScale * ( nodeC->giveDofWithID(R_u)->giveUnknown(VM_Total, tStep) );
        p [ 1 ].y += kyb + kyb * defScale * ( nodeC->giveDofWithID(D_v)->giveUnknown(VM_Total, tStep) ) + kzc * defScale * ( nodeC->giveDofWithID(R_v)->giveUnknown(VM_Total, tStep) );
        p [ 1 ].z += kzc + kzc * defScale * ( nodeC->giveDofWithID(D_w)->giveUnknown(VM_Total, tStep) ) + kxa * defScale * ( nodeC->giveDofWithID(R_w)->giveUnknown(VM_Total, tStep) );
        EASValsSetMType(CIRCLE_MARKER);
    }

    // plot the second particle
    go2 = CreateMarker3D(p + 1);
    EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | MTYPE_MASK | MSIZE_MASK, go2);
    EMAddGraphicsToModel(ESIModel(), go2);
}
开发者ID:Benjamin-git,项目名称:OOFEM_Jim,代码行数:49,代码来源:cohsur3d.C

示例10: drawDeformedGeometry

void LumpedMassElement :: drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType type)
{
    GraphicObj *go;
    double defScale = gc.getDefScale();
    WCRec p [ 1 ]; /* point */
    if ( !gc.testElementGraphicActivity(this) ) {
        return;
    }

    EASValsSetColor( gc.getDeformedElementColor() );
    EASValsSetLayer(OOFEG_DEFORMED_GEOMETRY_LAYER);
    EASValsSetMType(SQUARE_MARKER);
    EASValsSetMSize(8);
    p [ 0 ].x = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(1, tStep, defScale);
    p [ 0 ].y = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(2, tStep, defScale);
    p [ 0 ].z = ( FPNum ) this->giveNode(1)->giveUpdatedCoordinate(3, tStep, defScale);
    go = CreateMarker3D(p);
    EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | MTYPE_MASK | MSIZE_MASK, go);
    EGAttachObject(go, ( EObjectP ) this);
    EMAddGraphicsToModel(ESIModel(), go);
}
开发者ID:aishugang,项目名称:oofem,代码行数:21,代码来源:lumpedmasselement.C

示例11: drawScalar

void
CohesiveSurface3d :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
{
    if ( !gc.testElementGraphicActivity(this) ) {
        return;
    }

    FloatArray val;
    GaussPoint *gp = integrationRulesArray [ 0 ]->getIntegrationPoint(0);
    if ( !giveIPValue(val, gp, gc.giveIntVarType(), tStep) ) {
        return;
    }

    int indx = gc.giveIntVarIndx();

    double s [ 8 ];
    for ( int i = 0; i < 8; i++ ) {
        s [ i ] = val.at(indx);
    }

    gc.updateFringeTableMinMax(s, 1);

    WCRec p [ 8 ];
    Particle *nodeA = ( Particle * ) giveNode(1);
    Particle *nodeB = ( Particle * ) giveNode(2);
    if ( gc.getInternalVarsDefGeoFlag() ) {
        // use deformed geometry
        double defScale = gc.getDefScale();
        p [ 0 ].x = nodeA->giveUpdatedCoordinate(1, tStep, defScale);
        p [ 0 ].y = nodeA->giveUpdatedCoordinate(2, tStep, defScale);
        p [ 0 ].z = nodeA->giveUpdatedCoordinate(3, tStep, defScale);
        p [ 2 ].x = nodeB->giveUpdatedCoordinate(1, tStep, defScale);
        p [ 2 ].y = nodeB->giveUpdatedCoordinate(2, tStep, defScale);
        p [ 2 ].z = nodeB->giveUpdatedCoordinate(3, tStep, defScale);
        // handle special elements crossing the boundary of the periodic cell
        if ( giveNumberOfNodes() == 3 ) {
            Node *nodeC = ( Particle * ) giveNode(3);
            p [ 2 ].x += kxa + kxa * defScale * ( nodeC->giveDofWithID(D_u)->giveUnknown(VM_Total, tStep) ) + kyb * defScale * ( nodeC->giveDofWithID(R_u)->giveUnknown(VM_Total, tStep) );
            p [ 2 ].y += kyb + kyb * defScale * ( nodeC->giveDofWithID(D_v)->giveUnknown(VM_Total, tStep) ) + kzc * defScale * ( nodeC->giveDofWithID(R_v)->giveUnknown(VM_Total, tStep) );
            p [ 2 ].z += kzc + kzc * defScale * ( nodeC->giveDofWithID(D_w)->giveUnknown(VM_Total, tStep) ) + kxa * defScale * ( nodeC->giveDofWithID(R_w)->giveUnknown(VM_Total, tStep) );
        }
    } else {
        // use initial geometry
        p [ 0 ].x = nodeA->giveCoordinate(1);
        p [ 0 ].y = nodeA->giveCoordinate(2);
        p [ 0 ].z = nodeA->giveCoordinate(3);
        p [ 2 ].x = nodeB->giveCoordinate(1);
        p [ 2 ].y = nodeB->giveCoordinate(2);
        p [ 2 ].z = nodeB->giveCoordinate(3);
        // handle special elements crossing the boundary of the periodic cell
        if ( giveNumberOfNodes() == 3 ) {
            p [ 2 ].x += kxa;
            p [ 2 ].y += kyb;
            p [ 2 ].z += kzc;
        }
    }


    double r1 = nodeA->giveRadius();
    double r2 = nodeB->giveRadius();
    double d = 0.1 * ( r1 + r2 );
    p [ 1 ].x = 0.5 * ( p [ 0 ].x + p [ 2 ].x - d * lcs.at(2, 1) - d * lcs.at(3, 1) );
    p [ 1 ].y = 0.5 * ( p [ 0 ].y + p [ 2 ].y - d * lcs.at(2, 2) - d * lcs.at(3, 2) );
    p [ 1 ].z = 0.5 * ( p [ 0 ].z + p [ 2 ].z - d * lcs.at(2, 3) - d * lcs.at(3, 3) );
    p [ 3 ].x = p [ 1 ].x + d *lcs.at(2, 1);
    p [ 3 ].y = p [ 1 ].y + d *lcs.at(2, 2);
    p [ 3 ].z = p [ 1 ].z + d *lcs.at(2, 3);

    for ( int i = 5; i < 8; i += 2 ) {
        p [ i ].x = p [ i - 4 ].x + d *lcs.at(3, 1);
        p [ i ].y = p [ i - 4 ].y + d *lcs.at(3, 2);
        p [ i ].z = p [ i - 4 ].z + d *lcs.at(3, 3);
    }

    p [ 4 ] = p [ 0 ];
    p [ 6 ] = p [ 2 ];

    GraphicObj *go = CreateHexahedronWD(p, s);

    EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
    EASValsSetLineWidth(2 * OOFEG_DEFORMED_GEOMETRY_WIDTH);
    EASValsSetFillStyle(FILL_SOLID);

    //EGWithMaskChangeAttributes(WIDTH_MASK | COLOR_MASK | LAYER_MASK, go);
    EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | LAYER_MASK, go);
    EMAddGraphicsToModel(ESIModel(), go);
}
开发者ID:Benjamin-git,项目名称:OOFEM_Jim,代码行数:87,代码来源:cohsur3d.C

示例12: ind

void L4Axisymm :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
{
    int i, indx, result = 0;
    WCRec p [ 4 ];
    GraphicObj *tr;
    FloatArray v [ 4 ];
    double s [ 4 ], defScale;

    if ( !gc.testElementGraphicActivity(this) ) {
        return;
    }

    EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
    if ( gc.giveIntVarMode() == ISM_recovered ) {
        for ( i = 1; i <= 4; i++ ) {
            result += this->giveInternalStateAtNode(v [ i - 1 ], gc.giveIntVarType(), gc.giveIntVarMode(), i, tStep);
        }

        if ( result != 4 ) {
            return;
        }

        indx = gc.giveIntVarIndx();

        for ( i = 1; i <= 4; i++ ) {
            s [ i - 1 ] = v [ i - 1 ].at(indx);
        }

        if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
            for ( i = 0; i < 4; i++ ) {
                if ( gc.getInternalVarsDefGeoFlag() ) {
                    // use deformed geometry
                    defScale = gc.getDefScale();
                    p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
                    p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
                    p [ i ].z = 0.;
                } else {
                    p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
                    p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
                    p [ i ].z = 0.;
                }
            }

            //EASValsSetColor(gc.getYieldPlotColor(ratio));
            gc.updateFringeTableMinMax(s, 4);
            tr =  CreateQuadWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ], s [ 3 ]);
            EGWithMaskChangeAttributes(LAYER_MASK, tr);
            EMAddGraphicsToModel(ESIModel(), tr);

            /*
             * } else if (gc.getScalarAlgo() == SA_ISO_LINE) {
             *
             * EASValsSetColor(context.getActiveCrackColor());
             * EASValsSetLineWidth(OOFEG_ISO_LINE_WIDTH);
             *
             * for (i=0; i< 4; i++) {
             * if (gc.getInternalVarsDefGeoFlag()) {
             * // use deformed geometry
             * defScale = gc.getDefScale();
             * p[i].x = (FPNum) this->giveNode(i+1)->giveUpdatedCoordinate(1,tStep,defScale);
             * p[i].y = (FPNum) this->giveNode(i+1)->giveUpdatedCoordinate(2,tStep,defScale);
             * p[i].z = 0.;
             *
             * } else {
             * p[i].x = (FPNum) this->giveNode(i+1)->giveCoordinate(1);
             * p[i].y = (FPNum) this->giveNode(i+1)->giveCoordinate(2);
             * p[i].z = 0.;
             * }
             * }
             *
             * // isoline implementation
             * oofeg_drawIsoLinesOnQuad (p, s);
             *
             */
        }
    } else if ( gc.giveIntVarMode() == ISM_local ) {
        if ( numberOfGaussPoints != 4 ) {
            return;
        }

        IntArray ind(4);
        FloatArray *gpCoords;
        WCRec pp [ 9 ];

        for ( i = 0; i < 4; i++ ) {
            if ( gc.getInternalVarsDefGeoFlag() ) {
                // use deformed geometry
                defScale = gc.getDefScale();
                pp [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
                pp [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
                pp [ i ].z = 0.;
            } else {
                pp [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
                pp [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
                pp [ i ].z = 0.;
            }
        }

        for ( i = 0; i < 3; i++ ) {
            pp [ i + 4 ].x = 0.5 * ( pp [ i ].x + pp [ i + 1 ].x );
//.........这里部分代码省略.........
开发者ID:Benjamin-git,项目名称:OOFEM_Jim,代码行数:101,代码来源:l4axisymm.C

示例13: drawScalar

void QTrPlaneStrain :: drawScalar(oofegGraphicContext &context)
{
    int t, n [ 3 ], i, indx, result = 0;
    WCRec p [ 3 ];
    GraphicObj *tr;
    TimeStep *tStep = this->giveDomain()->giveEngngModel()->giveCurrentStep();
    FloatArray v [ 6 ];
    double s [ 6 ], ss [ 3 ], defScale;
    IntArray map;

    if ( !context.testElementGraphicActivity(this) ) {
        return;
    }

    if ( context.giveIntVarMode() == ISM_recovered ) {
        for ( i = 1; i <= 6; i++ ) {
            result += this->giveInternalStateAtNode(v [ i - 1 ], context.giveIntVarType(), context.giveIntVarMode(), i, tStep);
        }
    } else if ( context.giveIntVarMode() == ISM_local ) {
        return;
    }

    if ( result != 6 ) {
        return;
    }

    result = this->giveIntVarCompFullIndx( map, context.giveIntVarType() );
    if ( ( !result ) || ( indx = map.at( context.giveIntVarIndx() ) ) == 0 ) {
        return;
    }

    for ( i = 1; i <= 6; i++ ) {
        s [ i - 1 ] = v [ i - 1 ].at(indx);
    }

    EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);

    if ( context.getScalarAlgo() == SA_ISO_SURF ) {
        for ( t = 1; t <= 4; t++ ) {
            if ( t == 1 ) {
                n [ 0 ] = 1;
                n [ 1 ] = 4;
                n [ 2 ] = 6;
            } else if ( t == 2 ) {
                n [ 0 ] = 2;
                n [ 1 ] = 5;
                n [ 2 ] = 4;
            } else if ( t == 3 ) {
                n [ 0 ] = 3;
                n [ 1 ] = 6;
                n [ 2 ] = 5;
            } else {
                n [ 0 ] = 4;
                n [ 1 ] = 5;
                n [ 2 ] = 6;
            }


            for ( i = 0; i < 3; i++ ) {
                if ( context.getInternalVarsDefGeoFlag() ) {
                    // use deformed geometry
                    defScale = context.getDefScale();
                    p [ i ].x = ( FPNum ) this->giveNode(n [ i ])->giveUpdatedCoordinate(1, tStep, EID_MomentumBalance, defScale);
                    p [ i ].y = ( FPNum ) this->giveNode(n [ i ])->giveUpdatedCoordinate(2, tStep, EID_MomentumBalance, defScale);
                    p [ i ].z = 0.;
                } else {
                    p [ i ].x = ( FPNum ) this->giveNode(n [ i ])->giveCoordinate(1);
                    p [ i ].y = ( FPNum ) this->giveNode(n [ i ])->giveCoordinate(2);
                    p [ i ].z = 0.;
                }
            }

            //EASValsSetColor(gc.getYieldPlotColor(ratio));
            ss [ 0 ] = s [ n [ 0 ] - 1 ];
            ss [ 1 ] = s [ n [ 1 ] - 1 ];
            ss [ 2 ] = s [ n [ 2 ] - 1 ];
            context.updateFringeTableMinMax(ss, 3);
            tr =  CreateTriangleWD3D(p, ss [ 0 ], ss [ 1 ], ss [ 2 ]);
            EGWithMaskChangeAttributes(LAYER_MASK, tr);
            EMAddGraphicsToModel(ESIModel(), tr);
        }

        /* } else if (context.getScalarAlgo() == SA_ISO_LINE) {
         *
         * EASValsSetColor(context.getActiveCrackColor());
         * EASValsSetLineWidth(OOFEG_ISO_LINE_WIDTH);
         *
         * for (t=1; t<=4; t++) {
         * if (t==1) {n[0] = 1; n[1]=4; n[2]=6;}
         * else if (t==2) {n[0]=2; n[1]=5; n[2]=4;}
         * else if (t==3) {n[0]=3; n[1]=6; n[2]=5;}
         * else {n[0]=4; n[1]=5; n[2]=6;}
         *
         *
         * for (i=0; i< 3; i++) {
         * if (context.getInternalVarsDefGeoFlag()) {
         * // use deformed geometry
         * defScale = context.getDefScale();
         * p[i].x = (FPNum) this->giveNode(n[i])->giveUpdatedCoordinate(1,tStep,EID_MomentumBalance,defScale);
         * p[i].y = (FPNum) this->giveNode(n[i])->giveUpdatedCoordinate(2,tStep,EID_MomentumBalance,defScale);
//.........这里部分代码省略.........
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:101,代码来源:qtrplanestrain.C

示例14: drawScalar

void
TR_SHELL01 :: drawScalar(oofegGraphicContext &context)
{
    int i, indx, result = 0;
    WCRec p [ 3 ];
    GraphicObj *tr;
    TimeStep *tStep = this->giveDomain()->giveEngngModel()->giveCurrentStep();
    FloatArray v1, v2, v3;
    double s [ 3 ], defScale;
    if ( !context.testElementGraphicActivity(this) ) {
        return;
    }
    
    if ( !this->giveMaterial()->isActivated(tStep) ) {
        return;
    }

    if ( context.giveIntVarMode() == ISM_recovered ) {
        result += this->giveInternalStateAtNode(v1, context.giveIntVarType(), context.giveIntVarMode(), 1, tStep);
        result += this->giveInternalStateAtNode(v2, context.giveIntVarType(), context.giveIntVarMode(), 2, tStep);
        result += this->giveInternalStateAtNode(v3, context.giveIntVarType(), context.giveIntVarMode(), 3, tStep);
    } else if ( context.giveIntVarMode() == ISM_local ) {
        int nip = plate->giveDefaultIntegrationRulePtr()->giveNumberOfIntegrationPoints();
        FloatArray a, v(12);
        v.zero();
        for (int _i=1; _i<= nip; _i++) {
            this->giveIPValue(a, plate->giveDefaultIntegrationRulePtr()->getIntegrationPoint(_i-1), IST_ShellForceMomentumTensor, tStep);
            v += a;
        }
        v.times(1./nip);
        v1 = v;
        v2 =v;
        v3 =v;
    }

    indx = context.giveIntVarIndx();

    s [ 0 ] = v1.at(indx);
    s [ 1 ] = v2.at(indx);
    s [ 2 ] = v3.at(indx);
    EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
    if ( context.getScalarAlgo() == SA_ISO_SURF ) {
        for ( i = 0; i < 3; i++ ) {
            if ( context.getInternalVarsDefGeoFlag() ) {
                // use deformed geometry
                defScale = context.getDefScale();
                p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(1, tStep, defScale);
                p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(2, tStep, defScale);
                p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveUpdatedCoordinate(3, tStep, defScale);
            } else {
                p [ i ].x = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(1);
                p [ i ].y = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(2);
                p [ i ].z = ( FPNum ) this->giveNode(i + 1)->giveCoordinate(3);
            }
        }
        //     //EASValsSetColor(gc.getYieldPlotColor(ratio));
        context.updateFringeTableMinMax(s, 3);
        tr =  CreateTriangleWD3D(p, s [ 0 ], s [ 1 ], s [ 2 ]);
        EGWithMaskChangeAttributes(LAYER_MASK, tr);
        EMAddGraphicsToModel(ESIModel(), tr);
    }
}
开发者ID:JimBrouzoulis,项目名称:OOFEM_LargeDef,代码行数:62,代码来源:tr_shell01.C

示例15: ind

void QTrPlaneStress2d :: drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
{
    int t, n [ 3 ], i, indx, result = 0;
    WCRec p [ 3 ];
    GraphicObj *tr;
    FloatArray v [ 6 ];
    double s [ 6 ], ss [ 3 ], defScale;

    if ( !gc.testElementGraphicActivity(this) ) {
        return;
    }

    if ( gc.giveIntVarMode() == ISM_recovered ) {
        // ========= plot recovered values =========
        for ( i = 1; i <= 6; i++ ) {
            result += this->giveInternalStateAtNode(v [ i - 1 ], gc.giveIntVarType(), gc.giveIntVarMode(), i, tStep);
        }

        if ( result != 6 ) {
            return;
        }

        indx = gc.giveIntVarIndx();

        for ( i = 1; i <= 6; i++ ) {
            s [ i - 1 ] = v [ i - 1 ].at(indx);
        }

        EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);

        if ( gc.getScalarAlgo() == SA_ISO_SURF ) {
            for ( t = 1; t <= 4; t++ ) {
                if ( t == 1 ) {
                    n [ 0 ] = 1;
                    n [ 1 ] = 4;
                    n [ 2 ] = 6;
                } else if ( t == 2 ) {
                    n [ 0 ] = 2;
                    n [ 1 ] = 5;
                    n [ 2 ] = 4;
                } else if ( t == 3 ) {
                    n [ 0 ] = 3;
                    n [ 1 ] = 6;
                    n [ 2 ] = 5;
                } else {
                    n [ 0 ] = 4;
                    n [ 1 ] = 5;
                    n [ 2 ] = 6;
                }


                for ( i = 0; i < 3; i++ ) {
                    if ( gc.getInternalVarsDefGeoFlag() ) {
                        // use deformed geometry
                        defScale = gc.getDefScale();
                        p [ i ].x = ( FPNum ) this->giveNode(n [ i ])->giveUpdatedCoordinate(1, tStep, defScale);
                        p [ i ].y = ( FPNum ) this->giveNode(n [ i ])->giveUpdatedCoordinate(2, tStep, defScale);
                        p [ i ].z = 0.;
                    } else {
                        // use initial geometry
                        p [ i ].x = ( FPNum ) this->giveNode(n [ i ])->giveCoordinate(1);
                        p [ i ].y = ( FPNum ) this->giveNode(n [ i ])->giveCoordinate(2);
                        p [ i ].z = 0.;
                    }
                }

                //EASValsSetColor(gc.getYieldPlotColor(ratio));
                ss [ 0 ] = s [ n [ 0 ] - 1 ];
                ss [ 1 ] = s [ n [ 1 ] - 1 ];
                ss [ 2 ] = s [ n [ 2 ] - 1 ];
                gc.updateFringeTableMinMax(ss, 3);
                tr =  CreateTriangleWD3D(p, ss [ 0 ], ss [ 1 ], ss [ 2 ]);
                EGWithMaskChangeAttributes(LAYER_MASK, tr);
                EMAddGraphicsToModel(ESIModel(), tr);
            }

            /* } else if (gc.getScalarAlgo() == SA_ISO_LINE) {
             *
             * EASValsSetColor(context.getActiveCrackColor());
             * EASValsSetLineWidth(OOFEG_ISO_LINE_WIDTH);
             *
             * for (t=1; t<=4; t++) {
             * if (t==1) {n[0] = 1; n[1]=4; n[2]=6;}
             * else if (t==2) {n[0]=2; n[1]=5; n[2]=4;}
             * else if (t==3) {n[0]=3; n[1]=6; n[2]=5;}
             * else {n[0]=4; n[1]=5; n[2]=6;}
             *
             *
             * for (i=0; i< 3; i++) {
             * if (gc.getInternalVarsDefGeoFlag()) {
             * // use deformed geometry
             * defScale = gc.getDefScale();
             * p[i].x = (FPNum) this->giveNode(n[i])->giveUpdatedCoordinate(1,tStep,defScale);
             * p[i].y = (FPNum) this->giveNode(n[i])->giveUpdatedCoordinate(2,tStep,defScale);
             * p[i].z = 0.;
             *
             * } else {
             * p[i].x = (FPNum) this->giveNode(n[i])->giveCoordinate(1);
             * p[i].y = (FPNum) this->giveNode(n[i])->giveCoordinate(2);
             * p[i].z = 0.;
//.........这里部分代码省略.........
开发者ID:aishugang,项目名称:oofem,代码行数:101,代码来源:qtrplstr.C


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