My Project
Loading...
Searching...
No Matches
Opm::WachspressCoord Class Reference

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.
 
int numCorners (const int cell) const
 Count of vertices adjacent to a call.
 
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.
 
const SparseTable< CornerInfo > & cornerInfo () const
 The class stores some info for each corner, made accessible for user convenience.
 
const std::vector< int > & adjacentFaces () const
 The class stores adjacent faces for each corner, made accessible for user convenience.
 

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

◆ WachspressCoord()

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

Constructor.

prod_{all j} n_j * (c_j - x), resulting in the formula:

Parameters
[in]gridA grid.

Constructor.

Parameters
[in]gridA grid.

Member Function Documentation

◆ adjacentFaces()

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.

Returns
The vector of adjacent faces. Size = dim * #corners.
The corner info container.

◆ cartToBary()

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).

◆ cornerInfo()

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.

Returns
The corner info container.

◆ numCorners()

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 files: