本文整理汇总了C++中StructuralElement::giveInterface方法的典型用法代码示例。如果您正苦于以下问题:C++ StructuralElement::giveInterface方法的具体用法?C++ StructuralElement::giveInterface怎么用?C++ StructuralElement::giveInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StructuralElement
的用法示例。
在下文中一共展示了StructuralElement::giveInterface方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
FiberedCrossSection :: giveGeneralizedStress_Beam3d(FloatArray &answer, GaussPoint *gp, const FloatArray &strain, TimeStep *tStep)
{
double fiberThick, fiberWidth, fiberZCoord, fiberYCoord;
FloatArray fiberStrain, reducedFiberStress;
StructuralElement *element = static_cast< StructuralElement * >( gp->giveElement() );
FiberedCrossSectionInterface *interface;
if ( ( interface = static_cast< FiberedCrossSectionInterface * >( element->giveInterface(FiberedCrossSectionInterfaceType) ) ) == NULL ) {
OOFEM_ERROR("element with no fiber support encountered");
}
answer.resize(6);
answer.zero();
for ( int i = 1; i <= numberOfFibers; i++ ) {
GaussPoint *fiberGp = this->giveSlaveGaussPoint(gp, i - 1);
StructuralMaterial *fiberMat = static_cast< StructuralMaterial * >( domain->giveMaterial( fiberMaterials.at(i) ) );
// the question is whether this function should exist ?
// if yes the element details will be hidden.
// good idea also should be existence of element::GiveBmatrixOfLayer
// and computing strains here - but first idea looks better
// but treating of geometric non-linearities may become more complicated
// another approach - use several functions with assumed kinematic constraints
// resolve current layer z-coordinate
fiberThick = this->fiberThicks.at(i);
fiberWidth = this->fiberWidths.at(i);
fiberYCoord = fiberGp->giveNaturalCoordinate(1);
fiberZCoord = fiberGp->giveNaturalCoordinate(2);
interface->FiberedCrossSectionInterface_computeStrainVectorInFiber(fiberStrain, strain, fiberGp, tStep);
fiberMat->giveRealStressVector_Fiber(reducedFiberStress, fiberGp, fiberStrain, tStep);
// perform integration
// 1) membrane terms N, Qz, Qy
answer.at(1) += reducedFiberStress.at(1) * fiberWidth * fiberThick;
answer.at(2) += reducedFiberStress.at(2) * fiberWidth * fiberThick;
answer.at(3) += reducedFiberStress.at(3) * fiberWidth * fiberThick;
// 2) bending terms mx, my, mxy
answer.at(4) += ( reducedFiberStress.at(2) * fiberWidth * fiberThick * fiberYCoord -
reducedFiberStress.at(3) * fiberWidth * fiberThick * fiberZCoord );
answer.at(5) += reducedFiberStress.at(1) * fiberWidth * fiberThick * fiberZCoord;
answer.at(6) -= reducedFiberStress.at(1) * fiberWidth * fiberThick * fiberYCoord;
}
// now we must update master gp ///@ todo simply chosen the first fiber material as master material /JB
StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >
( domain->giveMaterial( fiberMaterials.at(1) )->giveStatus(gp) );
status->letTempStrainVectorBe(strain);
status->letTempStressVectorBe(answer);
}