|
| ~MeshCoordinates () |
| Destructor, free's the allocated vectors. More...
|
|
void | append (const double *coords, IndexType n=1) |
| Appends multiple nodes to the MeshCoordinates instance. More...
|
|
void | insert (IndexType nodeID, const double *coords, IndexType n=1) |
| Inserts multiple nodes to the MeshCoordinates instance. More...
|
|
double | getCoordinate (IndexType nodeID, int dim) const |
| Returns the coordinate of a point at the given dimension. More...
|
|
void | getCoordinates (IndexType nodeID, double *coords) const |
| Copy the coordinates of the given node into the provided buffer. More...
|
|
|
| MeshCoordinates (int dimension, IndexType numNodes=0, IndexType capacity=USE_DEFAULT) |
| Creates a MeshCoordinates instance of specified dimension and given number of nodes. Optionally, an initial max capacity may be specified in the constructor to reserve additional space for storing nodes. If a capacity is not specified, an internal initial default capacity will be computed instead. More...
|
|
|
| MeshCoordinates (IndexType numNodes, IndexType capacity, double *x, double *y=nullptr, double *z=nullptr) |
| Creates a MeshCoordinates object from the given coordinate buffers. More...
|
|
| MeshCoordinates (IndexType numNodes, double *x, double *y=nullptr, double *z=nullptr) |
|
|
int | dimension () const |
| Returns the dimension of this MeshCoordinates instance. More...
|
|
IndexType | numNodes () const |
| Returns the number of nodes in this MeshCoordinates instance. More...
|
|
void | resize (IndexType size) |
| Changes the number of nodes to the specified size. More...
|
|
IndexType | capacity () const |
| Get the maximum number of points that can currently be held. More...
|
|
void | reserve (IndexType capacity) |
| Changes the max capacity to the specified capacity. More...
|
|
void | shrink () |
| Returns all extra memory to the system. More...
|
|
double | getResizeRatio () const |
| Returns the resize ratio by which the capacity will increase. More...
|
|
void | setResizeRatio (double ratio) |
| Sets the resize ratio by which the capacity will increase when a dynamically re-allocation is triggered. More...
|
|
bool | empty () const |
|
bool | isExternal () const |
| Return true iff constructed via the external constructor. More...
|
|
bool | isInSidre () const |
| Return true iff constructed via the sidre constructors. More...
|
|
|
IndexType | append (double x) |
| Appends a new node to the MeshCoordinates instance. More...
|
|
IndexType | append (double x, double y) |
|
IndexType | append (double x, double y, double z) |
|
|
void | append (const double *x, const double *y, IndexType n) |
| Appends new nodes to the MeshCoordinates instance. More...
|
|
void | append (const double *x, const double *y, const double *z, IndexType n) |
|
|
void | set (IndexType nodeID, double x) |
| Sets the coordinates for the given node. More...
|
|
void | set (IndexType nodeID, double x, double y) |
|
void | set (IndexType nodeID, double x, double y, double z) |
|
|
void | insert (IndexType nodeID, double x) |
| Insert a node to the MeshCoordinates instance. More...
|
|
void | insert (IndexType nodeID, double x, double y) |
|
void | insert (IndexType nodeID, double x, double y, double z) |
|
|
void | insert (IndexType nodeID, const double *x, const double *y, IndexType n) |
| Insert multiple nodes to the MeshCoordinates instance. More...
|
|
void | insert (IndexType nodeID, const double *x, const double *y, const double *z, IndexType n) |
|
|
double * | getCoordinateArray (int dim) |
| Returns pointer to the coordinate array at the requested dimension. More...
|
|
const double * | getCoordinateArray (int dim) const |
|
Provides functionality to store and operate on mesh node coordinates.
A MeshCoordinates object is generally tied to an associated Mesh instance and provides the means to store, access and modify the node coordinates of a mesh.
The MeshCoordinates object may be constructed using (a) native storage, (b) external storage, or, (c) Sidre:
Native Storage
When using native storage, the MeshCoordinates object owns all associated memory. The storage can dynamically grow as needed, e.g., when adding more nodes. Typically, extra space is allocated to minimize the number of re-allocations. At any given instance, the total node capacity can be queried by calling the capacity() function. The extra memory can be returned to the system by calling the shrink() method.
When all extra memory is exhausted, appending a new node triggers a re-allocation. The amount of extra space that is allocated is according to the resize_ratio parameter, which is set to 2.0 by default. The resize_ratio may be queried and set to a different value by the getResizeRatio() and setResizeRatio() functions respectively.
When the MeshCoordinates object goes out-of-scope, all memory associated with the given instance is returned to the system.
External Storage
A MeshCoordinates object may also be constructed from external, user-supplied buffers that store the mesh node coordinates. In this case, the memory is owned by the caller. The MeshCoordinates object just keeps pointers to the user-supplied buffers.
- Warning
- Since the memory is not owned by the MeshCoordinates object when external buffers are supplied, the MeshCoordinates object cannot dynamically grow the storage. Consequently, the number of nodes the MeshCoordinates instance can hold is fixed. All calls to
shrink()
and reserve()
will fail.
-
Moreover, when the MeshCoordinates object goes out-of-scope, the associated buffers are not deleted. The caller owns the external data and has the responsibility of properly de-allocating the associated memory.
Sidre
A MeshCoordinates object may also be constructed from a sidre::Group which conforms to the mesh blueprint .
A MeshCoordinates object that is bound to a particular sidre::Group supports all operations transparently including dynamically growing the storage to hold more nodes as needed, but, instead, Sidre owns the memory. All memory management operations are delegated to Sidre.
- Warning
- Once the MeshCoordinates object goes out-of-scope, the data stays remains persistent in Sidre.
-
Reallocations tend to be costly operations in terms of performance. Use
reserve()
when the number of nodes is known a priori, or opt to use a constructor that takes an actual size and capacity when possible.
- See also
- axom::deprecated::MCArray
-
mint::Mesh
-
sidre::Group
-
sidre::deprecated::MCArray