View on GitHub

Vistle

Distributed Data-parallel Scientific Visualization in VR

indexed.h
Go to the documentation of this file.
1#ifndef INDEXED_H
2#define INDEXED_H
3
4
5#include "scalar.h"
6#include "shm.h"
7#include "coords.h"
8#include "export.h"
9#include "celltree.h"
10#include "vertexownerlist.h"
11
12namespace vistle {
13
14class V_COREEXPORT Indexed: public Coords, virtual public CelltreeInterface<3> {
16
17public:
18 typedef Coords Base;
21
22 Indexed(const Index numElements, const Index numCorners, const Index numVertices, const Meta &meta = Meta());
23
24 Index getNumElements() override;
25 Index getNumElements() const override;
26 virtual void resetElements();
27 Index getNumCorners();
28 Index getNumCorners() const;
29 void resetCorners();
30
31 typename shm<Index>::array &el() { return *d()->el; }
32 typename shm<Index>::array &cl() { return *d()->cl; }
33 const Index *el() const { return m_el; }
34 const Index *cl() const { return m_cl; }
35
36 std::pair<Vector, Vector> getBounds() const override;
37
38 bool hasCelltree() const override;
39 Celltree::const_ptr getCelltree() const override;
40 bool validateCelltree() const override;
41
42 bool hasVertexOwnerList() const;
43 VertexOwnerList::const_ptr getVertexOwnerList() const;
44 void removeVertexOwnerList() const;
46 friend class Indexed;
47
48 public:
50 Index getNeighborElement(Index elem, Index v1, Index v2, Index v3) const;
52 std::vector<Index> getContainingElements(Index vert) const;
54 std::vector<Index> getNeighborElements(Index elem) const;
55
56 private:
57 NeighborFinder(const Indexed *indexed);
58 const Indexed *indexed;
59 Index numElem, numVert;
60 const Index *el, *cl;
61 const Index *vl, *vol;
62 };
63 const NeighborFinder &getNeighborFinder() const;
64
65 virtual std::pair<Vector, Vector> elementBounds(Index elem) const;
66 std::vector<Index> cellVertices(Index elem) const override;
67 Index cellNumFaces(Index elem) const override;
68
69private:
70 mutable Index m_numEl = InvalidIndex, m_numCl = InvalidIndex;
71 mutable const Index *m_el = nullptr;
72 mutable const Index *m_cl = nullptr;
73 mutable Celltree::const_ptr m_celltree;
74 mutable VertexOwnerList::const_ptr m_vertexOwnerList;
75 mutable std::unique_ptr<const NeighborFinder> m_neighborfinder;
76
77 void createVertexOwnerList() const;
78 void createCelltree(Index nelem, const Index *el, const Index *cl) const;
79
81 ShmVector<Index> el; //< element list: index into connectivity list - last element: sentinel
82 ShmVector<Index> cl; //< connectivity list: index into coordinates
83
84 Data(const Index numElements = 0, const Index numCorners = 0, const Index numVertices = 0, Type id = UNKNOWN,
85 const std::string &name = "", const Meta &meta = Meta());
86 static Data *create(const std::string &name = "", Type id = UNKNOWN, const Index numElements = 0,
87 const Index numCorners = 0, const Index numVertices = 0, const Meta &meta = Meta());
88
90};
91
94
95} // namespace vistle
96#endif
#define ARCHIVE_ASSUME_ABSTRACT(obj)
Definition: archives_config.h:466
Definition: celltree.h:172
Definition: celltree.h:31
Definition: coords.h:15
Definition: indexed.h:45
Definition: indexed.h:14
Coords Base
Definition: indexed.h:18
shm< Index >::array & el()
Definition: indexed.h:31
vistle::CelltreeInterface< 3 >::Celltree Celltree
Definition: indexed.h:20
shm< Index >::array & cl()
Definition: indexed.h:32
const Index * cl() const
Definition: indexed.h:34
vistle::VertexOwnerList VertexOwnerList
Definition: indexed.h:19
const Index * el() const
Definition: indexed.h:33
Definition: objectmeta.h:16
std::shared_ptr< const Object > const_ptr
Definition: object.h:68
Type
Definition: object.h:84
map vertices to owning elements/cells
Definition: vertexownerlist.h:16
Definition: shm_reference.h:15
Definition: shm_array.h:19
#define V_COREEXPORT
Definition: export.h:9
Definition: allobjects.cpp:30
const Index InvalidIndex
Definition: index.h:17
uint32_t Index
Definition: index.h:13
#define V_DATA_BEGIN(ObjType)
Definition: object.h:474
#define V_OBJECT_DECL(ObjType)
Definition: object.h:525
#define V_DATA_END(ObjType)
Definition: object.h:481
#define V_OBJECT(ObjType)
declare a new Object type
Definition: object.h:381
Definition: object.h:233