本文整理汇总了C++中GaussPoint::giveCoordinate方法的典型用法代码示例。如果您正苦于以下问题:C++ GaussPoint::giveCoordinate方法的具体用法?C++ GaussPoint::giveCoordinate怎么用?C++ GaussPoint::giveCoordinate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GaussPoint
的用法示例。
在下文中一共展示了GaussPoint::giveCoordinate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
FiberedCrossSection :: giveGeneralizedStress_Beam3d(FloatArray &answer, GaussPoint *gp, const FloatArray &strain, TimeStep *tStep)
{
double fiberThick, fiberWidth, fiberZCoord, fiberYCoord;
FloatArray fiberStrain, fullStressVect, 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->giveCoordinate(1);
fiberZCoord = fiberGp->giveCoordinate(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);
}
示例2: xy
void Line2SurfaceTension :: computeLoadVector(FloatArray &answer, ValueModeType mode, TimeStep *tStep)
{
///@todo Support axisymm.
//domainType dt = this->giveDomain()->giveDomainType();
IntegrationRule *iRule = this->integrationRulesArray [ 0 ];
double t = 1, gamma_s;
///@todo Should i use this? Not used in FM module (but perhaps it should?) / Mikael.
//t = this->giveDomain()->giveCrossSection(1)->give(CS_Thickness);
gamma_s = this->giveMaterial()->give('g', NULL);
FloatMatrix xy(2, 3);
Node *node;
for ( int i = 1; i <= 3; i++ ) {
node = giveNode(i);
xy.at(1, i) = node->giveCoordinate(1);
xy.at(2, i) = node->giveCoordinate(2);
}
FloatArray A;
FloatArray dNdxi(3);
FloatArray es(2); // tangent vector to curve
FloatMatrix BJ(2, 6);
BJ.zero();
answer.resize(6);
answer.zero();
for ( int k = 0; k < iRule->getNumberOfIntegrationPoints(); k++ ) {
GaussPoint *gp = iRule->getIntegrationPoint(k);
//interpolation.evaldNdx(dN, domain, dofManArray, * gp->giveCoordinates(), 0.0);
double xi = gp->giveCoordinate(1);
// Some simplifications can be performed, since the mapping J is a scalar.
dNdxi.at(1) = -0.5 + xi;
dNdxi.at(2) = 0.5 + xi;
dNdxi.at(3) = -2.0 * xi;
es.beProductOf(xy, dNdxi);
double J = es.computeNorm();
es.times(1 / J); //es.normalize();
// dNds = dNdxi/J
// B.at(1,1) = dNds.at(1); and so on.
BJ.at(1, 1) = BJ.at(2, 2) = dNdxi.at(1);
BJ.at(1, 3) = BJ.at(2, 4) = dNdxi.at(2);
BJ.at(1, 5) = BJ.at(2, 6) = dNdxi.at(3);
A.beTProductOf(BJ, es);
answer.add( - gamma_s * t * gp->giveWeight(), A); // Note! Negative sign!
}
}