| 110 | } |
| 111 | |
| 112 | shared_ptr<XdmfGridCollection> |
| 113 | XdmfGridTemplate::getGridCollection(const unsigned int index) |
| 114 | { |
| 115 | if (mBase) { |
| 116 | if (index < getNumberSteps()) { |
| 117 | this->clearStep(); |
| 118 | this->setStep(index); |
| 119 | if (shared_ptr<XdmfGridCollection> grid = |
| 120 | shared_dynamic_cast<XdmfGridCollection>(mBase)) { |
| 121 | return grid; |
| 122 | } |
| 123 | else { |
| 124 | return shared_ptr<XdmfGridCollection>(); |
| 125 | } |
| 126 | } |
| 127 | else { |
| 128 | return shared_ptr<XdmfGridCollection>(); |
| 129 | } |
| 130 | } |
| 131 | else { |
| 132 | XdmfError::message(XdmfError::FATAL, "Error: Attempting to get GridCollection from template without a base"); |
| 133 | return shared_ptr<XdmfGridCollection>(); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | shared_ptr<const XdmfGridCollection> |
| 138 | XdmfGridTemplate::getGridCollection(const unsigned int index) const |
no test coverage detected