| 1368 | |
| 1369 | |
| 1370 | Parameter * |
| 1371 | Domain::removeParameter(int tag) |
| 1372 | { |
| 1373 | Parameter *theParam = (Parameter*) theParameters->getComponentPtr(tag); |
| 1374 | |
| 1375 | if (theParam != 0) { |
| 1376 | |
| 1377 | // Find where RV is located |
| 1378 | int index; |
| 1379 | for (index = 0; index < numParameters; index++) { |
| 1380 | if (paramIndex[index] == tag) |
| 1381 | break; |
| 1382 | } |
| 1383 | |
| 1384 | // Shift indices down by one |
| 1385 | for (int i = index; i < numParameters-1; i++) { |
| 1386 | paramIndex[i] = paramIndex[i+1]; |
| 1387 | Parameter *otherParam = this->getParameterFromIndex(i); |
| 1388 | otherParam->setGradIndex(i); |
| 1389 | } |
| 1390 | |
| 1391 | // Now remove the component |
| 1392 | theParameters->removeComponent(tag); |
| 1393 | |
| 1394 | numParameters--; |
| 1395 | } |
| 1396 | |
| 1397 | return 0; |
| 1398 | |
| 1399 | /* |
| 1400 | // remove the object from the container |
| 1401 | TaggedObject *mc = theParameters->removeComponent(tag); |
| 1402 | |
| 1403 | // if not there return 0 |
| 1404 | if (mc == 0) |
| 1405 | return 0; |
| 1406 | |
| 1407 | // otherwise mark the domain as having changed |
| 1408 | this->domainChange(); |
| 1409 | |
| 1410 | // perform a downward cast to an Element (safe as only Element added to |
| 1411 | // this container, 0 the Elements DomainPtr and return the result of the cast |
| 1412 | Parameter *result = (Parameter *)mc; |
| 1413 | // result->setDomain(0); |
| 1414 | return result; |
| 1415 | */ |
| 1416 | } |
| 1417 | |
| 1418 | LoadPattern * |
| 1419 | Domain::removeLoadPattern(int tag) |
no test coverage detected