| 1416 | } |
| 1417 | |
| 1418 | LoadPattern * |
| 1419 | Domain::removeLoadPattern(int tag) |
| 1420 | { |
| 1421 | // remove the object from the container |
| 1422 | TaggedObject *obj = theLoadPatterns->removeComponent(tag); |
| 1423 | |
| 1424 | // if not there return 0 |
| 1425 | if (obj == 0) |
| 1426 | return 0; |
| 1427 | |
| 1428 | // perform a downward cast, set the objects domain pointer to 0 |
| 1429 | // and return the result of the cast |
| 1430 | LoadPattern *result = (LoadPattern *)obj; |
| 1431 | // result->setDomain(0); |
| 1432 | |
| 1433 | // |
| 1434 | // now set the Domain pointer for all loads and SP constraints |
| 1435 | // in the loadPattern to be 0 |
| 1436 | // |
| 1437 | |
| 1438 | NodalLoad *theNodalLoad; |
| 1439 | NodalLoadIter &theNodalLoads = result->getNodalLoads(); |
| 1440 | while ((theNodalLoad = theNodalLoads()) != 0) { |
| 1441 | // theNodalLoad->setDomain(0); |
| 1442 | } |
| 1443 | |
| 1444 | ElementalLoad *theElementalLoad; |
| 1445 | ElementalLoadIter &theElementalLoads = result->getElementalLoads(); |
| 1446 | while ((theElementalLoad = theElementalLoads()) != 0) { |
| 1447 | // theElementalLoad->setDomain(0); |
| 1448 | } |
| 1449 | |
| 1450 | int numSPs = 0; |
| 1451 | SP_Constraint *theSP_Constraint; |
| 1452 | SP_ConstraintIter &theSP_Constraints = result->getSPs(); |
| 1453 | while ((theSP_Constraint = theSP_Constraints()) != 0) { |
| 1454 | numSPs++; |
| 1455 | // theSP_Constraint->setDomain(0); |
| 1456 | } |
| 1457 | |
| 1458 | // mark the domain has having changed if numSPs > 0 |
| 1459 | // as the constraint handlers have to be redone |
| 1460 | if (numSPs > 0) |
| 1461 | this->domainChange(); |
| 1462 | |
| 1463 | // finally return the load pattern |
| 1464 | return result; |
| 1465 | } |
| 1466 | |
| 1467 | |
| 1468 |
no test coverage detected