void SimpleInterfaceMaterial :: giveStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) // // Returns characteristic material stiffness matrix of the receiver // { MaterialMode mMode = gp->giveElement()->giveMaterialMode(); FloatArray strainVector; StructuralElement *el = static_cast< StructuralElement * >( gp->giveElement() ); double normalStrain; el->computeStrainVector(strainVector, gp, tStep); normalStrain = strainVector.at(1); answer.zero(); switch ( mMode ) { case _1dInterface: answer.resize(1, 1); if ( rMode == SecantStiffness || rMode == TangentStiffness ) { if ( normalStrain + normalClearance <= 0 ) { answer.at(1, 1) = this->kn; //in compression and after the clearance gap closed } else { answer.at(1, 1) = this->kn * this->stiffCoeff; } } else { if ( rMode == ElasticStiffness ) { answer.at(1, 1) = this->kn; } else { OOFEM_ERROR("unknown MatResponseMode (%s)", __MatResponseModeToString(rMode) ); } } return; case _2dInterface: answer.resize(2, 2); if ( rMode == SecantStiffness || rMode == TangentStiffness ) { if ( normalStrain + normalClearance <= 0. ) { answer.at(1, 1) = answer.at(2, 2) = this->kn; //in compression and after the clearance gap closed } else { answer.at(1, 1) = answer.at(2, 2) = this->kn * this->stiffCoeff; } } else { if ( rMode == ElasticStiffness ) { answer.at(1, 1) = answer.at(2, 2) = this->kn; } else { OOFEM_ERROR("unknown MatResponseMode (%s)", __MatResponseModeToString(rMode) ); } } return; case _3dInterface: answer.resize(3, 3); if ( rMode == SecantStiffness || rMode == TangentStiffness ) { if ( normalStrain + normalClearance <= 0. ) { answer.at(1, 1) = answer.at(2, 2) = answer.at(3, 3) = this->kn; //in compression and after the clearance gap closed } else { answer.at(1, 1) = answer.at(2, 2) = answer.at(3, 3) = this->kn * this->stiffCoeff; } } else { if ( rMode == ElasticStiffness ) { answer.at(1, 1) = answer.at(2, 2) = answer.at(3, 3) = this->kn; } else { OOFEM_ERROR("unknown MatResponseMode (%s)", __MatResponseModeToString(rMode) ); } } return; default: StructuralMaterial :: giveStiffnessMatrix(answer, rMode, gp, tStep); } }