PLaSK library
|
The mesh represents (ordered) set of points in 2D or 3D space. All meshes in PLaSK implements (inherits from) instantiation of plask::Mesh template interface.
Typically, there is some data associated with points in mesh. In PLaSK, all this data is not stored in the mesh class, hence they must be stored separately. As the points in the mesh are ordered and each one have unique index in a range from 0
to plask::Mesh::size()-1
, you can store data in any indexed structure, like an array (1D) or std::vector (which is recommended), storing the data value for the i-th point in the mesh under the i-th index.
Typical approaches to implementing new types of meshes:
To implement a new mesh directly you have to write class inherited from the plask::MeshD<DIM>
, where DIM (is equal 2 or 3) is a number of dimension of space your mesh is defined over.
You are required to:
Example implementation of singleton mesh (mesh which represent set with only one point in 3D space):
You should also implement interpolation algorithms for your mesh, see How to write a new interpolation algorithm? for more details.