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); }
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! } }
void Line2SurfaceTension :: computeTangent(FloatMatrix &answer, TimeStep *tStep) { #if 1 answer.resize(6, 6); answer.zero(); #else ///@todo Support axisymm. domainType dt = this->giveDomain()->giveDomainType(); if (dt == _3dAxisymmMode) { OOFEM_ERROR("Line2SurfaceTension :: computeTangent - Axisymm not implemented"); } IntegrationRule *iRule = this->integrationRulesArray [ 0 ]; double t = 1, gamma_s; ///@todo Should i use this? Not that meaningful for flow problems. //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(); FloatMatrix temp1,temp2; answer.resize(6,6); answer.zero(); for (int k = 0; k < iRule->getNumberOfIntegrationPoints(); k++ ) { GaussPoint *gp = iRule->getIntegrationPoint(k); double xi = gp->giveCoordinate(1); 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(); 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); temp1.beTProductOf(BJ,BJ); temp2.beDyadicProductOf(A,A); temp1.subtract(temp2); temp1.times(t*gp->giveWeight()/J*(tStep->giveTimeIncrement())); answer.add(temp1); } answer.times(gamma_s); #endif }