void SUPGElement2 :: computeBCRhsTerm_MB(FloatArray &answer, TimeStep *tStep) { int nLoads; answer.clear(); int rule = 0; IntegrationRule *iRule = this->integrationRulesArray [ rule ]; FloatArray un, gVector, s, helpLoadVector; FloatMatrix b, nu; // add body load (gravity) termms nLoads = this->giveBodyLoadArray()->giveSize(); for ( int i = 1; i <= nLoads; i++ ) { Load *load = domain->giveLoad( bodyLoadArray.at(i) ); bcGeomType ltype = load->giveBCGeoType(); if ( ( ltype == BodyLoadBGT ) && ( load->giveBCValType() == ForceLoadBVT ) ) { load->computeComponentArrayAt(gVector, tStep, VM_Total); if ( gVector.giveSize() ) { for ( GaussPoint *gp: *iRule ) { this->computeUDotGradUMatrix( b, gp, tStep->givePreviousStep() ); this->computeNuMatrix(nu, gp); double dV = this->computeVolumeAround(gp); double rho = this->giveMaterial()->give('d', gp); answer.plusProduct(b, gVector, t_supg * rho * dV); answer.plusProduct(nu, gVector, rho * dV); } } } } // integrate tractions // if no traction bc applied but side marked as with traction load // then zero traction is assumed !!! // loop over boundary load array nLoads = this->giveBoundaryLoadArray()->giveSize() / 2; for ( int i = 1; i <= nLoads; i++ ) { int n = boundaryLoadArray.at(1 + ( i - 1 ) * 2); int id = boundaryLoadArray.at(i * 2); Load *load = domain->giveLoad(n); bcGeomType ltype = load->giveBCGeoType(); if ( ltype == EdgeLoadBGT ) { this->computeEdgeLoadVector_MB(helpLoadVector, load, id, tStep); if ( helpLoadVector.giveSize() ) { answer.add(helpLoadVector); } } else if ( ltype == SurfaceLoadBGT ) { this->computeSurfaceLoadVector_MB(helpLoadVector, load, id, tStep); if ( helpLoadVector.giveSize() ) { answer.add(helpLoadVector); } } else { OOFEM_ERROR("unsupported load type class"); } } }
void SUPGElement2 :: computeBCRhsTerm_MC(FloatArray &answer, TimeStep *tStep) { int nLoads; FloatArray s, gVector, helpLoadVector; FloatMatrix g; int rule = 1; answer.clear(); nLoads = this->giveBodyLoadArray()->giveSize(); for ( int i = 1; i <= nLoads; i++ ) { Load *load = domain->giveLoad( bodyLoadArray.at(i) ); bcGeomType ltype = load->giveBCGeoType(); if ( ( ltype == BodyLoadBGT ) && ( load->giveBCValType() == ForceLoadBVT ) ) { load->computeComponentArrayAt(gVector, tStep, VM_Total); if ( gVector.giveSize() ) { for ( GaussPoint *gp: *this->integrationRulesArray [ rule ] ) { this->computeGradPMatrix(g, gp); double dV = this->computeVolumeAround(gp); answer.plusProduct(g, gVector, t_pspg * dV); } } } } // integrate tractions // if no traction bc applied but side marked as with traction load // then zero traction is assumed !!! // loop over boundary load array nLoads = this->giveBoundaryLoadArray()->giveSize() / 2; for ( int i = 1; i <= nLoads; i++ ) { int n = boundaryLoadArray.at(1 + ( i - 1 ) * 2); int id = boundaryLoadArray.at(i * 2); Load *load = domain->giveLoad(n); bcGeomType ltype = load->giveBCGeoType(); if ( ltype == EdgeLoadBGT ) { this->computeEdgeLoadVector_MC(helpLoadVector, load, id, tStep); if ( helpLoadVector.giveSize() ) { answer.add(helpLoadVector); } } else if ( ltype == SurfaceLoadBGT ) { this->computeSurfaceLoadVector_MC(helpLoadVector, load, id, tStep); if ( helpLoadVector.giveSize() ) { answer.add(helpLoadVector); } } else { OOFEM_ERROR("unsupported load type class"); } } }