27 public Scan<Connector> {
36 public Scan<Connector> {
45 public Scan<Connector> {
75 inline ListElm<T>* link()
const {
return lnk_;};
76 inline T* elm()
const {
return elm_;}
81 template<
class ListNode>
87 inline ListHead(ListNode* root = 0) : root_(root) {};
90 {ListNode* foo = root_; root_ = root_->link();
delete foo;}
93 inline ListNode** rootp() {
return &root_;};
94 inline ListNode* root()
const {
return root_;};
150 virtual std::ostream&
info(std::ostream& os)
const;
161 class LocalS :
public Scan<Cell1> {
166 inline LocalS(uint n,
Array<unique_ptr<Cell1> > *cell)
167 : n_(n), idx_(0), cell_(cell) {};
168 inline LocalS(
const LocalS& scan) : n_(scan.n_), idx_(scan.idx_),
169 cell_(scan.cell_) {};
170 inline bool eos()
const {
return idx_ == n_;};
171 inline Cell1& operator++(
int) {
return *((*cell_)[idx_++]);};
176 class GlobalS :
public Scan<Cell1> {
181 inline GlobalS(uint n,
Array<unique_ptr<Cell1> > *cell)
182 : n_(n), idx_(0), cell_(cell) {
185 inline GlobalS(
const GlobalS& scan) {
188 inline bool eos()
const {
return 1;};
189 inline Cell1& operator++(
int) {
return *((*cell_)[idx_++]);};
195 class CapS :
public Scan<T> {
199 inline CapS(
ListElm<T>* cntr) : cntr_(cntr) {};
200 inline CapS(
const CapS<T>& scan) : cntr_(scan.cntr_) {};
201 inline bool eos()
const {
return (!cntr_);};
202 inline T& operator++(
int) {
203 ListElm<T>* foo = cntr_; cntr_ = cntr_->link();
204 return *(foo->elm());};
205 inline Scan<T>* clone()
const {
return new CapS(*
this);};
250 inline Mesh1(
Array<unique_ptr<Connector0> >* cntr0,
251 Array<unique_ptr<Connector1> >* cntr1,
252 Array<unique_ptr<Cell1> >* cell, uint ngcell,
253 Array<unique_ptr<concepts::Map1d> >* map,
273 return new CapS<Connector0>((*cap0_)[i].root());
279 return new CapS<Cell1>((*cap1_)[i].root());
283 std::ostream&
info(std::ostream& os)
const;
288 Array<unique_ptr<Connector1> >* cntr1,
289 Array<unique_ptr<Cell1> >* cell, uint ngcell,
290 Array<unique_ptr<concepts::Map1d> >* map,
293 :
Mesh(com), ngcell_(ngcell), nlcell_(cell->cursize()), cntr0_(cntr0),
294 ncntr0_(cntr0->cursize()), cntr1_(cntr1), cell_(cell), map_(map),
295 nmap_(map ? map->cursize() : 0), cap0_(cap0), cap1_(cap1) {
301 delete cell_;
delete map_;
302 delete cntr1_;
delete cntr0_;
313 class LocalS :
public Scan<Cell2> {
318 inline LocalS(uint n,
Array<unique_ptr<Cell2> > *cell)
319 : n_(n), idx_(0), cell_(cell) {};
320 inline LocalS(
const LocalS& scan) : n_(scan.n_), idx_(scan.idx_),
321 cell_(scan.cell_) {};
322 inline bool eos()
const {
return idx_ == n_;};
323 inline Cell2& operator++(
int) {
return *((*cell_)[idx_++]);};
328 class GlobalS :
public Scan<Cell2> {
333 inline GlobalS(uint n,
Array<unique_ptr<Cell2> > *cell)
334 : n_(n), idx_(0), cell_(cell) {
337 inline GlobalS(
const GlobalS& scan) {
340 inline bool eos()
const {
return 1;};
341 inline Cell2& operator++(
int) {
return *((*cell_)[idx_++]);};
347 class CapS :
public Scan<T> {
351 inline CapS(
ListElm<T>* cntr) : cntr_(cntr) {};
352 inline CapS(
const CapS<T>& scan) : cntr_(scan.cntr_) {};
353 inline bool eos()
const {
return (!cntr_);};
354 inline T& operator++(
int) {
355 ListElm<T>* foo = cntr_; cntr_ = cntr_->link();
356 return *(foo->elm());};
357 inline Scan<T>* clone()
const {
return new CapS(*
this);};
414 inline Mesh2(
Array<unique_ptr<Connector0> >* cntr0,
415 Array<unique_ptr<Connector1> >* cntr1,
416 Array<unique_ptr<Connector2> >* cntr2,
417 Array<unique_ptr<Cell2> >* cell, uint ngcell,
418 Array<unique_ptr<concepts::Map2d> >* map,
438 return new CapS<Connector0>((*cap0_)[i].root());
444 return new CapS<Connector1>((*cap1_)[i].root());
450 return new CapS<Cell2>((*cap2_)[i].root());
454 std::ostream&
info(std::ostream& os)
const;
459 Array<unique_ptr<Connector1> >* cntr1,
460 Array<unique_ptr<Connector2> >* cntr2,
461 Array<unique_ptr<Cell2> >* cell, uint ngcell,
462 Array<unique_ptr<concepts::Map2d> >* map,
465 :
Mesh(com), ngcell_(ngcell), nlcell_(cell->cursize()), cntr0_(cntr0),
466 ncntr0_(cntr0->cursize()), cntr1_(cntr1), ncntr1_(cntr1->cursize()),
467 cntr2_(cntr2), cell_(cell), map_(map), nmap_(map ? map->cursize() : 0),
468 cap0_(cap0), cap1_(cap1), cap2_(cap2) {
472 delete cap2_;
delete cap1_;
delete cap0_;
473 delete cell_;
delete map_;
474 delete cntr2_;
delete cntr1_;
delete cntr0_;
490 inline LocalS(uint n,
Array<unique_ptr<Cell3> > *cell)
491 : n_(n), idx_(0), cell_(cell) {};
492 inline LocalS(
const LocalS& scan) : n_(scan.n_), idx_(scan.idx_),
493 cell_(scan.cell_) {};
494 inline bool eos()
const {
return idx_ == n_;};
495 inline Cell3& operator++(
int) {
return *((*cell_)[idx_++]);};
505 inline GlobalS(uint n,
Array<unique_ptr<Cell3> > *cell)
506 : n_(n), idx_(0), cell_(cell) {
509 inline GlobalS(
const GlobalS& scan) {
512 inline bool eos()
const {
return 1;};
513 inline Cell3& operator++(
int) {
return *((*cell_)[idx_++]);};
519 class CapS :
public Scan<T> {
523 inline CapS(
ListElm<T>* cntr) : cntr_(cntr) {};
524 inline CapS(
const CapS<T>& scan) : cntr_(scan.cntr_) {};
525 inline bool eos()
const {
return (!cntr_);};
526 inline T& operator++(
int) {
527 ListElm<T>* foo = cntr_; cntr_ = cntr_->link();
528 return *(foo->elm());};
596 inline Mesh3(
Array<unique_ptr<Connector0> >* cntr0,
597 Array<unique_ptr<Connector1> >* cntr1,
598 Array<unique_ptr<Connector2> >* cntr2,
599 Array<unique_ptr<Connector3> >* cntr3,
600 Array<unique_ptr<Cell3> >* cell, uint ngcell,
601 Array<unique_ptr<concepts::Map3d> >* map,
622 return new CapS<Connector0>((*cap0_)[i].root());
628 return new CapS<Connector1>((*cap1_)[i].root());
634 return new CapS<Connector2>((*cap2_)[i].root());
640 return new CapS<Cell3>((*cap3_)[i].root());
644 std::ostream&
info(std::ostream& os)
const;
649 Array<unique_ptr<Connector1> >* cntr1,
650 Array<unique_ptr<Connector2> >* cntr2,
651 Array<unique_ptr<Connector3> >* cntr3,
652 Array<unique_ptr<Cell3> >* cell, uint ngcell,
653 Array<unique_ptr<concepts::Map3d> >* map,
657 :
Mesh(com), ngcell_(ngcell), nlcell_(cell->cursize()), cntr0_(cntr0),
658 ncntr0_(cntr0->cursize()), cntr1_(cntr1), ncntr1_(cntr1->cursize()),
659 cntr2_(cntr2), ncntr2_(cntr2->cursize()), cntr3_(cntr3), cell_(cell),
660 map_(map), nmap_(map ? map->cursize() : 0), cap0_(cap0), cap1_(cap1),
661 cap2_(cap2), cap3_(cap3) {
665 delete cap3_;
delete cap2_;
delete cap1_;
delete cap0_;
666 delete cell_;
delete map_;
667 delete cntr3_;
delete cntr2_;
delete cntr1_;
delete cntr0_;
#define conceptsException(exc)
A scanner for 0D connectors on the processor intersection (cap)
Connector0 & operator++(int)=0
Returns the next connnector of the cap.
A scanner for 1D connectors on the processor intersection (cap)
Connector1 & operator++(int)=0
Returns the next connector of the cap.
A scanner for 2D connectors on the processor intersection (cap)
Connector2 & operator++(int)=0
Returns the next connector of the cap.
uint nglobcell() const
Returns global number of cells.
concepts::Scan1 * cap1scan(uint i)
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
uint nloccell() const
Returns local number of cells.
concepts::ScanCntr0 * cap0scan(uint i)
Mesh1(Array< unique_ptr< Connector0 > > *cntr0, Array< unique_ptr< Connector1 > > *cntr1, Array< unique_ptr< Cell1 > > *cell, uint ngcell, Array< unique_ptr< concepts::Map1d > > *map, Array< Cntr0Lst > *cap0, Array< Cell1Lst > *cap1, const Communicator &com)
concepts::Scan1 * locscan()
Returns a scanner over the own cells.
concepts::Scan1 * globscan()
Returns a scanner over all cells (not yet implemented).
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
concepts::Scan2 * locscan()
Returns a scanner over the own cells.
concepts::ScanCntr1 * cap1scan(uint i)
uint nloccell() const
Returns local number of cells.
concepts::Scan2 * globscan()
Returns a scanner over all cells (not yet implemented).
Mesh2(Array< unique_ptr< Connector0 > > *cntr0, Array< unique_ptr< Connector1 > > *cntr1, Array< unique_ptr< Connector2 > > *cntr2, Array< unique_ptr< Cell2 > > *cell, uint ngcell, Array< unique_ptr< concepts::Map2d > > *map, Array< Cntr0Lst > *cap0, Array< Cntr1Lst > *cap1, Array< Cell2Lst > *cap2, const Communicator &com)
concepts::Scan2 * cap2scan(uint i)
uint nglobcell() const
Returns global number of cells.
concepts::ScanCntr0 * cap0scan(uint i)
concepts::ScanCntr1 * cap1scan(uint i)
std::ostream & info(std::ostream &os) const
Returns information in an output stream.
concepts::ScanCntr0 * cap0scan(uint i)
concepts::ScanCntr2 * cap2scan(uint i)
concepts::Scan3 * globscan()
Returns a scanner over all cells (not yet implemented).
concepts::Scan3 * locscan()
Returns a scanner over the own cells.
uint nglobcell() const
Returns global number of cells.
Mesh3(Array< unique_ptr< Connector0 > > *cntr0, Array< unique_ptr< Connector1 > > *cntr1, Array< unique_ptr< Connector2 > > *cntr2, Array< unique_ptr< Connector3 > > *cntr3, Array< unique_ptr< Cell3 > > *cell, uint ngcell, Array< unique_ptr< concepts::Map3d > > *map, Array< Cntr0Lst > *cap0, Array< Cntr1Lst > *cap1, Array< Cntr2Lst > *cap2, Array< Cell3Lst > *cap3_, const Communicator &com)
uint nloccell() const
Returns local number of cells.
concepts::Scan3 * cap3scan(uint i)
virtual uint nglobcell() const =0
Returns the global number of cells in the mesh.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual Scan< Cell > * locscan()=0
virtual uint nloccell() const =0
Returns the local number of cells in the mesh.
virtual Scan< Cell > * globscan()=0