Class capable of computing Wachspress coordinates in 2d and 3d. More...
#include <WachspressCoord.hpp>
Classes | |
struct | CornerInfo |
Public Member Functions | |
WachspressCoord (const UnstructuredGrid &grid) | |
Constructor. More... | |
int | numCorners (const int cell) const |
Count of vertices adjacent to a call. More... | |
void | cartToBary (const int cell, const double *x, double *xb) const |
Compute generalized barycentric coordinates for some point x with respect to the vertices of a grid cell. More... | |
const SparseTable< CornerInfo > & | cornerInfo () const |
The class stores some info for each corner, made accessible for user convenience. More... | |
const std::vector< int > & | adjacentFaces () const |
The class stores adjacent faces for each corner, made accessible for user convenience. More... | |
Class capable of computing Wachspress coordinates in 2d and 3d.
The formula used is a modification of the formula given in: M. Meyer, A. Barr, H. Lee, and M. Desbrun. Generalized barycentric coordinates on irregular poly- gons. Journal of Graphics Tools, 7(1):13–22, 2002.
|
explicit |
Constructor.
prod_{all j} n_j * (c_j - x), resulting in the formula:
[in] | grid | A grid. |
Constructor.
[in] | grid | A grid. |
const std::vector< int > & Opm::WachspressCoord::adjacentFaces | ( | ) | const |
The class stores adjacent faces for each corner, made accessible for user convenience.
The class stores some info for each corner.
void Opm::WachspressCoord::cartToBary | ( | const int | cell, |
const double * | x, | ||
double * | xb | ||
) | const |
Compute generalized barycentric coordinates for some point x with respect to the vertices of a grid cell.
[in] | cell | Cell in which to compute coordinates. |
[in] | x | Coordinates of point in cartesian coordinates. Must be array of length grid.dimensions. |
[out] | xb | Coordinates of point in barycentric coordinates. Must be array of length numCorners(cell). |
const SparseTable< WachspressCoord::CornerInfo > & Opm::WachspressCoord::cornerInfo | ( | ) | const |
The class stores some info for each corner, made accessible for user convenience.
The class stores some info for each corner.
int Opm::WachspressCoord::numCorners | ( | const int | cell | ) | const |
Count of vertices adjacent to a call.
[in] | cell | A cell index. |