Ejemplo n.º 1
0
void
SimpleCrossSection :: giveReducedCharacteristicVector(FloatArray &answer, GaussPoint *gp,
                                                      const FloatArray &charVector3d)
//
// returns reduced stressVector or strainVector from full 3d vector reduced
// to vector required by gp->giveStressStrainMode()
//
{
    MaterialMode mode = gp->giveMaterialMode();
    StructuralMaterial *mat = static_cast< StructuralMaterial * >( gp->giveElement()->giveMaterial() );
    IntArray indx;
    int size = charVector3d.giveSize();
    int i, j;

    if ( ( mode == _3dShell ) || ( mode == _3dBeam ) || ( mode == _2dPlate ) || ( mode == _2dBeam ) ) {
        if ( size != 12 ) {
            OOFEM_ERROR("SimpleCrossSection :: giveReducedCharacteristicVector - charVector3d size mismatch");
        }

        mat->giveStressStrainMask( indx, ReducedForm, gp->giveMaterialMode() );
        answer.resize( indx.giveSize() );
        answer.zero();

        for ( i = 1; i <= indx.giveSize(); i++ ) {
            if ( ( j = indx.at(i) ) ) {
                answer.at(i) = charVector3d.at(j);
            }
        }

        return;
    } else if ( mode == _3dBeam ) {
        if ( size != 6 ) {
            OOFEM_ERROR("SimpleCrossSection :: giveReducedCharacteristicVector - charVector3d size mismatch");
        }

        answer =  charVector3d;
        return;
    } else if ( mode == _PlaneStressRot ) {
        if ( size != 7 ) {
            OOFEM_ERROR("SimpleCrossSection :: giveReducedCharacteristicVector - charVector3d size mismatch");
        }

        mat->giveStressStrainMask( indx, ReducedForm, gp->giveMaterialMode() );
        answer.resize( indx.giveSize() );
        answer.zero();

        for ( i = 1; i <= indx.giveSize(); i++ ) {
            if ( ( j = indx.at(i) ) ) {
                answer.at(i) = charVector3d.at(j);
            }
        }

        return;
    } else {
        StructuralCrossSection :: giveReducedCharacteristicVector(answer, gp, charVector3d);
        return;
    }
}
Ejemplo n.º 2
0
void
SimpleCrossSection :: giveFullCharacteristicVector(FloatArray &answer,
                                                   GaussPoint *gp,
                                                   const FloatArray &strainVector)
//
// returns full 3d strain vector from strainVector in reducedMode
// based on StressStrainMode in gp
// strainVector {eps_x,eps_y,eps_z,gamma_yz,gamma_zx,gamma_xy}
//
// enhaced method in order to support cases with integral bending (2dplate, 3dshell..)
// in such cases full strain vector has the form:
// strainVectorShell {eps_x,eps_y,eps_z,gamma_yz,gamma_zx,gamma_xy, kappa_x,kappa_y,kappa_y,kappa_yz,kappa_xz,kappa_xy}
//
// enhanced method in order to support 3dbeam elements
// in such cases full strain vector has the form:
// strainVector {eps_x, gamma_xz, gamma_xy, \der{phi_x}{x}, kappa_y, kappa_z}
//
// enhance support also for PlaneStressRot case with full strain vector of form
// {eps_x,eps_y,eps_z,gamma_yz,gamma_zx,gamma_xy,(omega_xy-(dv/dx-du/dy)*0.5)}
//
//
{
    MaterialMode mode = gp->giveMaterialMode();
    StructuralMaterial *mat = static_cast< StructuralMaterial * >( gp->giveMaterial() );
    IntArray indx;
    int i, j, answerSize = 0;

    //if (mode ==  _3dShell) {answer =  strainVector; return ;}
    //if (mode ==  _3dBeam)  {answer =  strainVector; return ;}
    if ( ( mode == _3dShell ) || ( mode ==  _3dBeam ) || ( mode == _2dPlate ) || ( mode == _2dBeam ) || ( mode == _PlaneStressRot ) ||(mode == _3dMatGrad)||(mode == _1dMatGrad)||(mode == _PlaneStrainGrad)||(mode == _PlaneStressGrad) ) {
        if ( ( mode == _3dShell ) || ( mode ==  _3dBeam ) || ( mode == _2dPlate ) || ( mode == _2dBeam ) ) {
            answerSize = 12;
        }

        if ( mode == _PlaneStressRot || (mode == _3dMatGrad) || (mode == _1dMatGrad) || (mode == _PlaneStrainGrad) || (mode == _PlaneStressGrad) ) {
            answerSize = 7;
        }

        answer.resize(answerSize);
        answer.zero();

        mat->giveStressStrainMask( indx, ReducedForm, gp->giveMaterialMode() );
        for ( i = 1; i <= indx.giveSize(); i++ ) {
            if ( ( j = indx.at(i) ) ) {
                answer.at(j) = strainVector.at(i);
            }
        }

        return;
    } else {
        StructuralCrossSection :: giveFullCharacteristicVector(answer, gp, strainVector);
        return;
    }
}