void
SimpleCrossSection :: give3dBeamStiffMtrx(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
{
    StructuralMaterial *mat = dynamic_cast< StructuralMaterial * >( this->giveMaterial(gp) );

    FloatMatrix mat3d;
    double area, E, G, Iy, Iz, Ik;
    double shearAreay, shearAreaz;

    mat->give1dStressStiffMtrx(mat3d, rMode, gp, tStep);
    E    = mat3d.at(1, 1);
    G    = mat->give('G', gp);
    area = this->give(CS_Area, gp);
    Iy   = this->give(CS_InertiaMomentY, gp);
    Iz   = this->give(CS_InertiaMomentZ, gp);
    Ik   = this->give(CS_TorsionMomentX, gp);

    //shearCoeff = this->give(CS_BeamShearCoeff);
    shearAreay = this->give(CS_ShearAreaY, gp);
    shearAreaz = this->give(CS_ShearAreaZ, gp);

    answer.resize(6, 6);
    answer.zero();

    answer.at(1, 1) = E * area;
    ///@todo Do this by using the general 3d tangent matrix instead somehow!!!
    answer.at(2, 2) = shearAreay * G;
    answer.at(3, 3) = shearAreaz * G;
    //answer.at(2, 2) = shearCoeff * G * area;
    //answer.at(3, 3) = shearCoeff * G * area;
    answer.at(4, 4) = G * Ik;
    answer.at(5, 5) = E * Iy;
    answer.at(6, 6) = E * Iz;
}
void
SimpleCrossSection :: give2dBeamStiffMtrx(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
{
    StructuralMaterial *mat = dynamic_cast< StructuralMaterial * >( this->giveMaterial(gp) );

    FloatMatrix mat3d;
    double area, Iy, shearAreaz;

    mat->give1dStressStiffMtrx(mat3d, rMode, gp, tStep);
    area = this->give(CS_Area, gp);
    Iy   = this->give(CS_InertiaMomentY, gp);
    shearAreaz = this->give(CS_ShearAreaZ, gp);

    answer.resize(3, 3);
    answer.zero();

    answer.at(1, 1) = mat3d.at(1, 1) * area;
    answer.at(2, 2) = mat3d.at(1, 1) * Iy;
    answer.at(3, 3) = shearAreaz * mat->give('G', gp);
}