void Quad1MindlinShell3D :: computeSurfaceLoadVectorAt(FloatArray &answer, Load *load, int iSurf, TimeStep *tStep, ValueModeType mode) { BoundaryLoad *surfLoad = static_cast< BoundaryLoad * >(load); if ( dynamic_cast< ConstantPressureLoad * >(surfLoad) ) { // Just checking the type of b.c. // EXPERIMENTAL CODE: FloatArray n, gcoords, pressure; answer.resize(24); answer.zero(); for ( GaussPoint *gp: *integrationRulesArray [ 0 ] ) { double dV = this->computeVolumeAround(gp); this->interp.evalN( n, * gp->giveNaturalCoordinates(), FEIVoidCellGeometry() ); this->interp.local2global( gcoords, * gp->giveNaturalCoordinates(), FEIElementGeometryWrapper(this) ); surfLoad->computeValueAt(pressure, tStep, gcoords, mode); answer.at(3) += n.at(1) * pressure.at(1) * dV; answer.at(9) += n.at(2) * pressure.at(1) * dV; answer.at(15) += n.at(3) * pressure.at(1) * dV; answer.at(21) += n.at(4) * pressure.at(1) * dV; } // Second surface is the outside; if ( iSurf == 2 ) { answer.negated(); } } else { OOFEM_ERROR("only supports constant pressure boundary load."); } }
void Tr1Darcy :: computeEdgeBCSubVectorAt(FloatArray &answer, Load *load, int iEdge, TimeStep *tStep) { /* * Given the load *load, return it's contribution. * */ answer.resize(3); answer.zero(); if ( load->giveType() == TransmissionBC ) { // Neumann boundary conditions (traction) BoundaryLoad *boundaryLoad; boundaryLoad = ( BoundaryLoad * ) load; int numberOfEdgeIPs; numberOfEdgeIPs = ( int ) ceil( ( boundaryLoad->giveApproxOrder() + 1. ) / 2. ) * 2; GaussIntegrationRule iRule(1, this, 1, 1); GaussPoint *gp; FloatArray N, loadValue, reducedAnswer; reducedAnswer.resize(3); reducedAnswer.zero(); IntArray mask; iRule.setUpIntegrationPoints(_Line, numberOfEdgeIPs, _Unknown); for ( int i = 0; i < iRule.getNumberOfIntegrationPoints(); i++ ) { gp = iRule.getIntegrationPoint(i); FloatArray *lcoords = gp->giveCoordinates(); this->interpolation_lin.edgeEvalN(N, *lcoords, FEIElementGeometryWrapper(this)); double dV = this->computeEdgeVolumeAround(gp, iEdge); if ( boundaryLoad->giveFormulationType() == BoundaryLoad :: BL_EntityFormulation ) { // Edge load in xi-eta system boundaryLoad->computeValueAt(loadValue, tStep, *lcoords, VM_Total); } else { // Edge load in x-y system FloatArray gcoords; this->interpolation_lin.edgeLocal2global(gcoords, iEdge, *lcoords, FEIElementGeometryWrapper(this)); boundaryLoad->computeValueAt(loadValue, tStep, gcoords, VM_Total); } reducedAnswer.add(loadValue.at(1) * dV, N); } this->interpolation_lin.computeLocalEdgeMapping(mask, iEdge); answer.assemble(reducedAnswer, mask); } }
void Tr21Stokes :: computeEdgeBCSubVectorAt(FloatArray &answer, Load *load, int iEdge, TimeStep *tStep) { answer.resize(15); answer.zero(); if ( load->giveType() == TransmissionBC ) { // Neumann boundary conditions (traction) BoundaryLoad *boundaryLoad = ( BoundaryLoad * ) load; int numberOfEdgeIPs = ( int ) ceil( ( boundaryLoad->giveApproxOrder() + 1. ) / 2. ) * 2; GaussIntegrationRule iRule(1, this, 1, 1); GaussPoint *gp; FloatArray N, t, f(6); IntArray edge_mapping; f.zero(); iRule.setUpIntegrationPoints(_Line, numberOfEdgeIPs, _Unknown); for ( int i = 0; i < iRule.getNumberOfIntegrationPoints(); i++ ) { gp = iRule.getIntegrationPoint(i); FloatArray *lcoords = gp->giveCoordinates(); this->interpolation_quad.edgeEvalN(N, * lcoords, FEIElementGeometryWrapper(this)); double detJ = fabs(this->interpolation_quad.edgeGiveTransformationJacobian(iEdge, * lcoords, FEIElementGeometryWrapper(this))); double dS = gp->giveWeight() * detJ; if ( boundaryLoad->giveFormulationType() == BoundaryLoad :: BL_EntityFormulation ) { // Edge load in xi-eta system boundaryLoad->computeValueAt(t, tStep, * lcoords, VM_Total); } else { // Edge load in x-y system FloatArray gcoords; this->interpolation_quad.edgeLocal2global(gcoords, iEdge, * lcoords, FEIElementGeometryWrapper(this)); boundaryLoad->computeValueAt(t, tStep, gcoords, VM_Total); } // Reshape the vector for ( int j = 0; j < 3; j++ ) { f(2 * j) += N(j) * t(0) * dS; f(2 * j + 1) += N(j) * t(1) * dS; } } answer.assemble(f, this->edge_ordering [ iEdge - 1 ]); } else { OOFEM_ERROR("Tr21Stokes :: computeEdgeBCSubVectorAt - Strange boundary condition type"); } }
void Beam3d :: computeEdgeLoadVectorAt(FloatArray &answer, Load *load, int iedge, TimeStep *tStep, ValueModeType mode) { FloatArray coords, components, endComponents; FloatMatrix T; double l = this->computeLength(); double kappay = this->giveKappayCoeff(tStep); double kappaz = this->giveKappazCoeff(tStep); double fx, fy, fz, fmx, fmy, fmz, dfx, dfy, dfz, dfmx, dfmy, dfmz; // evaluates the receivers edge load vector // for clamped beam // BoundaryLoad *edgeLoad = dynamic_cast< BoundaryLoad * >( load ); if ( edgeLoad ) { answer.resize(12); answer.zero(); switch ( edgeLoad->giveApproxOrder() ) { case 0: if ( edgeLoad->giveFormulationType() == Load :: FT_Entity ) { coords.resize(1); coords.at(1) = 0.0; } else { coords = * ( this->giveNode(1)->giveCoordinates() ); } edgeLoad->computeValues(components, tStep, coords, {D_u, D_v, D_w, R_u, R_v, R_w}, mode); // prepare transformation coeffs if ( edgeLoad->giveCoordSystMode() == Load :: CST_Global ) { if ( this->computeLoadGToLRotationMtrx(T) ) { components.rotatedWith(T, 'n'); } } fx = components.at(1); fy = components.at(2); fz = components.at(3); fmx = components.at(4); fmy = components.at(5); fmz = components.at(6); answer.at(1) = fx * l / 2.; answer.at(2) = fy * l / 2. + fmz / ( 1. + 2. * kappaz ); answer.at(3) = fz * l / 2. + fmy / ( 1. + 2. * kappay ); answer.at(4) = fmx * l / 2.; answer.at(5) = ( -1. ) * fz * l * l / 12. + fmy * l * kappay / ( 1. + 2. * kappay ); answer.at(6) = ( 1. ) * fy * l * l / 12. + fmz * l * kappaz / ( 1. + 2. * kappaz ); answer.at(7) = fx * l / 2.; answer.at(8) = fy * l / 2. - fmz / ( 1. + 2. * kappaz ); answer.at(9) = fz * l / 2. - fmy / ( 1. + 2. * kappay ); answer.at(10) = fmx * l / 2.; answer.at(11) = ( 1. ) * fz * l * l / 12. + fmy * l * kappay / ( 1. + 2. * kappay ); answer.at(12) = ( -1. ) * fy * l * l / 12. + fmz * l * kappaz / ( 1. + 2. * kappaz ); break; case 1: if ( edgeLoad->giveFormulationType() == Load :: FT_Entity ) { coords.resize(1); coords.at(1) = -1.0; } else { coords = * ( this->giveNode(1)->giveCoordinates() ); } edgeLoad->computeValues(components, tStep, coords, {D_u, D_v, D_w, R_u, R_v, R_w}, mode); // prepare transformation coeffs if ( edgeLoad->giveCoordSystMode() == Load :: CST_Global ) { if ( this->computeLoadGToLRotationMtrx(T) ) { components.rotatedWith(T, 'n'); } } fx = components.at(1); fy = components.at(2); fz = components.at(3); fmx = components.at(4); fmy = components.at(5); fmz = components.at(6); if ( edgeLoad->giveFormulationType() == Load :: FT_Entity ) { coords.resize(1); coords.at(1) = 1.0; } else { coords = * ( this->giveNode(2)->giveCoordinates() ); } edgeLoad->computeValues(endComponents, tStep, coords, {D_u, D_v, D_w, R_u, R_v, R_w}, mode); // prepare transformation coeffs if ( edgeLoad->giveCoordSystMode() == Load :: CST_Global ) { if ( T.isNotEmpty() ) { endComponents.rotatedWith(T, 'n'); } } // compute differences endComponents.subtract(components); dfx = endComponents.at(1); dfy = endComponents.at(2); dfz = endComponents.at(3); dfmx = endComponents.at(4); dfmy = endComponents.at(5); dfmz = endComponents.at(6); answer.at(1) = fx * l / 2. + dfx * l / 6.; answer.at(2) = fy * l / 2. + dfy * l * ( 20. * kappaz + 9 ) / ( 60. * ( 1. + 2. * kappaz ) ) + fmz / ( 1. + 2. * kappaz ) + dfmz * ( 1. / 2. ) / ( 1. + 2. * kappaz ); answer.at(3) = fz * l / 2. + dfz * l * ( 20. * kappay + 9 ) / ( 60. * ( 1. + 2. * kappay ) ) + fmy / ( 1. + 2. * kappay ) + dfmy * ( 1. / 2. ) / ( 1. + 2. * kappay ); answer.at(4) = fmx * l / 2. + dfmx * l / 6.; answer.at(5) = ( -1. ) * fz * l * l / 12. - dfz * l * l * ( 5. * kappay + 2. ) / ( 60. * ( 1. + 2. * kappay ) ) + fmy * l * kappay / ( 1. + 2. * kappay ) + dfmy * l * ( 4. * kappay - 1. ) / ( 12. * ( 1. + 2. * kappay ) ); answer.at(6) = ( 1. ) * fy * l * l / 12. + dfy * l * l * ( 5. * kappaz + 2. ) / ( 60. * ( 1. + 2. * kappaz ) ) + fmz * l * kappaz / ( 1. + 2. * kappaz ) + dfmz * l * ( 4. * kappaz - 1. ) / ( 12. * ( 1. + 2. * kappaz ) ); answer.at(7) = fx * l / 2. + dfx * l / 3.; answer.at(8) = fy * l / 2. + dfy * l * ( 40. * kappaz + 21 ) / ( 60. * ( 1. + 2. * kappaz ) ) - fmz / ( 1. + 2. * kappaz ) - dfmz * ( 1. / 2. ) / ( ( 1. + 2. * kappaz ) ); answer.at(9) = fz * l / 2. + dfz * l * ( 40. * kappay + 21 ) / ( 60. * ( 1. + 2. * kappay ) ) - fmy / ( 1. + 2. * kappay ) - dfmy * ( 1. / 2. ) / ( ( 1. + 2. * kappay ) ); answer.at(10) = fmx * l / 2. + dfmx * l / 3.; answer.at(11) = ( 1. ) * fz * l * l / 12. + dfz * l * l * ( 5. * kappay + 3. ) / ( 60. * ( 1. + 2. * kappay ) ) + fmy * l * kappay / ( 1. + 2. * kappay ) + dfmy * l * ( 8. * kappay + 1. ) / ( 12. * ( 1. + 2. * kappay ) ); answer.at(12) = ( -1. ) * fy * l * l / 12. - dfy * l * l * ( 5. * kappaz + 3. ) / ( 60. * ( 1. + 2. * kappaz ) ) + fmz * l * kappaz / ( 1. + 2. * kappaz ) + dfmz * l * ( 8. * kappaz + 1. ) / ( 12. * ( 1. + 2. * kappaz ) ); break; default: OOFEM_ERROR("unsupported load type"); } } }