16 #ifndef dealii__cell_id_h 17 #define dealii__cell_id_h 19 #include <deal.II/base/config.h> 20 #include <deal.II/base/exceptions.h> 26 DEAL_II_NAMESPACE_OPEN
61 explicit CellId(
unsigned int coarse_cell_id_, std::vector<unsigned char> id_)
62 : coarse_cell_id(coarse_cell_id_), id(id_)
95 unsigned int coarse_cell_id;
96 std::vector<unsigned char> id;
104 os << cid.coarse_cell_id <<
'_' << cid.id.size() <<
':';
105 for (
unsigned int i=0; i<cid.id.size(); ++i)
106 os << static_cast<int>(cid.id[i]);
120 cid.coarse_cell_id = cellid;
131 for (
unsigned int i=0; i<idsize; ++i)
134 cid.id.push_back(value-
'0');
142 if (this->coarse_cell_id != other.coarse_cell_id)
144 return id == other.id;
150 return !(*
this == other);
156 if (this->coarse_cell_id != other.coarse_cell_id)
157 return this->coarse_cell_id < other.coarse_cell_id;
159 unsigned int idx = 0;
160 while (idx <
id.size())
162 if (idx>=other.id.size())
165 if (
id[idx] != other.id[idx])
166 return id[idx] < other.id[idx];
171 if (
id.size() == other.id.size())
176 DEAL_II_NAMESPACE_CLOSE
::ExceptionBase & ExcMessage(std::string arg1)
friend std::ostream & operator<<(std::ostream &os, const CellId &cid)
#define Assert(cond, exc)
bool operator<(const CellId &other) const
bool operator!=(const CellId &other) const
friend std::istream & operator>>(std::istream &is, CellId &cid)
bool operator==(const CellId &other) const
std::string to_string() const
CellId(unsigned int coarse_cell_id_, std::vector< unsigned char > id_)