* refinement level to the next, starting with the coarse cell,
* until we get to the cell represented by the current object.
*/
- std::vector<unsigned char> id;
+ std::vector<unsigned char> child_indices;
friend std::istream &operator>> (std::istream &is, CellId &cid);
friend std::ostream &operator<< (std::ostream &os, const CellId &cid);
std::ostream &operator<< (std::ostream &os,
const CellId &cid)
{
- os << cid.coarse_cell_id << '_' << cid.id.size() << ':';
- for (unsigned int i=0; i<cid.id.size(); ++i)
- os << static_cast<int>(cid.id[i]);
+ os << cid.coarse_cell_id << '_' << cid.child_indices.size() << ':';
+ for (unsigned int i=0; i<cid.child_indices.size(); ++i)
+ os << static_cast<int>(cid.child_indices[i]);
return os;
}
Assert(dummy==':', ExcMessage("invalid CellId"));
char value;
- cid.id.clear();
+ cid.child_indices.clear();
for (unsigned int i=0; i<idsize; ++i)
{
is >> value;
- cid.id.push_back(value-'0');
+ cid.child_indices.push_back(value-'0');
}
return is;
}
const std::vector<unsigned char> &id)
:
coarse_cell_id(coarse_cell_id),
- id(id)
+ child_indices(id)
{}
{
if (this->coarse_cell_id != other.coarse_cell_id)
return false;
- return id == other.id;
+ return child_indices == other.child_indices;
}
return this->coarse_cell_id < other.coarse_cell_id;
unsigned int idx = 0;
- while (idx < id.size())
+ while (idx < child_indices.size())
{
- if (idx>=other.id.size())
+ if (idx>=other.child_indices.size())
return false;
- if (id[idx] != other.id[idx])
- return id[idx] < other.id[idx];
+ if (child_indices[idx] != other.child_indices[idx])
+ return child_indices[idx] < other.child_indices[idx];
++idx;
}
- if (id.size() == other.id.size())
+ if (child_indices.size() == other.child_indices.size())
return false;
return true; // other.id is longer
}
{
typename Triangulation<dim,spacedim>::cell_iterator cell (&tria,0,coarse_cell_id);
- for (unsigned int i = 0; i < id.size(); ++i)
- cell = cell->child(static_cast<unsigned int> (id[i]));
+ for (unsigned int i = 0; i < child_indices.size(); ++i)
+ cell = cell->child(static_cast<unsigned int> (child_indices[i]));
return cell;
}