void SolutionbasedShapeFunction :: setLoads(EngngModel *myEngngModel, int d) { DynamicInputRecord ir; FloatArray gradP; gradP.resize( this->giveDomain()->giveNumberOfSpatialDimensions() ); gradP.zero(); gradP.at(d) = 1.0; ir.setRecordKeywordField("deadweight", 1); ir.setField(gradP, _IFT_Load_components); ir.setField(1, _IFT_GeneralBoundaryCondition_timeFunct); int bcID = myEngngModel->giveDomain(1)->giveNumberOfBoundaryConditions() + 1; GeneralBoundaryCondition *myBodyLoad; myBodyLoad = classFactory.createBoundaryCondition( "deadweight", bcID, myEngngModel->giveDomain(1) ); myBodyLoad->initializeFrom(& ir); myEngngModel->giveDomain(1)->setBoundaryCondition(bcID, myBodyLoad); for ( int i = 1; i <= myEngngModel->giveDomain(1)->giveNumberOfElements(); i++ ) { IntArray *blArray; blArray = myEngngModel->giveDomain(1)->giveElement(i)->giveBodyLoadArray(); blArray->resizeWithValues(blArray->giveSize() + 1); blArray->at( blArray->giveSize() ) = bcID; } }
void StructuralEngngModel :: buildReactionTable(IntArray &restrDofMans, IntArray &restrDofs, IntArray &eqn, TimeStep *tStep, int di) { // determine number of restrained dofs Domain *domain = this->giveDomain(di); int numRestrDofs = this->giveNumberOfDomainEquations( di, EModelDefaultPrescribedEquationNumbering() ); int ndofMan = domain->giveNumberOfDofManagers(); int rindex, count = 0; // initialize corresponding dofManagers and dofs for each restrained dof restrDofMans.resize(numRestrDofs); restrDofs.resize(numRestrDofs); eqn.resize(numRestrDofs); for ( int i = 1; i <= ndofMan; i++ ) { DofManager *inode = domain->giveDofManager(i); for ( Dof *jdof: *inode ) { if ( jdof->isPrimaryDof() && ( jdof->hasBc(tStep) ) ) { // skip slave dofs rindex = jdof->__givePrescribedEquationNumber(); if ( rindex ) { count++; restrDofMans.at(count) = i; restrDofs.at(count) = jdof->giveDofID(); eqn.at(count) = rindex; } else { // NullDof has no equation number and no prescribed equation number //_error("No prescribed equation number assigned to supported DOF"); } } } } // Trim to size. restrDofMans.resizeWithValues(count); restrDofs.resizeWithValues(count); eqn.resizeWithValues(count); }
void DofManager :: giveCompleteMasterDofIDArray(IntArray &dofIDArray) const { if ( !hasSlaveDofs ) { dofIDArray.resizeWithValues(0, this->giveNumberOfDofs()); for ( Dof *dof: *this ) { dofIDArray.followedBy( dof->giveDofID() ); } } else { IntArray temp; for ( Dof *dof: *this ) { dof->giveDofIDs(temp); dofIDArray.followedBy(temp); } } }
void DofManager :: giveCompleteLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s) const { if ( !hasSlaveDofs ) { // prevents some size problem when connecting different elements with // different number of dofs locationArray.resizeWithValues(0, this->giveNumberOfDofs()); for ( Dof *dof: *this ) { locationArray.followedBy( s.giveDofEquationNumber( dof ) ); } } else { IntArray temp; locationArray.resize(0); for ( Dof *dof: *this ) { dof->giveEquationNumbers(temp, s); locationArray.followedBy(temp); } } }