Opm::WachspressCoord Class Reference

#include <WachspressCoord.hpp>

Classes

struct  CornerInfo
 

Public Member Functions

 WachspressCoord (const UnstructuredGrid &grid)
 
int numCorners (const int cell) const
 
void cartToBary (const int cell, const double *x, double *xb) const
 
const SparseTable< CornerInfo > & cornerInfo () const
 
const std::vector< int > & adjacentFaces () const
 

Detailed Description

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.

Constructor & Destructor Documentation

Opm::WachspressCoord::WachspressCoord ( const UnstructuredGrid grid)
explicit

Constructor.

Parameters
[in]gridA grid.

Member Function Documentation

const std::vector<int>& Opm::WachspressCoord::adjacentFaces ( ) const

The class stores adjacent faces for each corner, made accessible for user convenience.

Returns
The vector of adjacent faces. Size = dim * #corners.
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.

Parameters
[in]cellCell in which to compute coordinates.
[in]xCoordinates of point in cartesian coordinates. Must be array of length grid.dimensions.
[out]xbCoordinates of point in barycentric coordinates. Must be array of length numCorners(cell).
const SparseTable<CornerInfo>& Opm::WachspressCoord::cornerInfo ( ) const

The class stores some info for each corner, made accessible for user convenience.

Returns
The corner info container.
int Opm::WachspressCoord::numCorners ( const int  cell) const

Count of vertices adjacent to a call.

Parameters
[in]cellA cell index.
Returns
Number of corners of cell.

The documentation for this class was generated from the following file: