G+Smo  23.12.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsParametrization< T > Class Template Reference

Detailed Description

template<class T>
class gismo::gsParametrization< T >

Class that maintains parametrization This class Parametrization stores the mesh information and the two-dimensional parameter points. The parameter points are stored in a vector, where the i-th vector element is the parameter point for the vertex with index i. This means that the first n elements in the vector are the inner parameter points, the rest of them are the boundary parameter points.

The parametrization gets constructed from a gsHalfEdgeMesh object, the boundary method and the parametrization method. For boundary methods one can choose between chords corners smallest opposite restrict distributed and for parametrization method one can choose between uniform shape distance

There are functions for returning the number of vertices and the number of inner vertices. Also every parameter point can be returned. The parametrization can be printed by printing all parameter points.

Inherited by gsPeriodicParametrization< T >.

+ Collaboration diagram for gsParametrization< T >:

Classes

class  LocalNeighbourhood
 Class that maintains the local neighbourhood properties. More...
 
class  LocalParametrization
 Class maintains local parametrization This class represents a local parametrization for a point in the triangle mesh, which is identified by the vertex index. The parametrization is given by the weights lambda(i,j) which is the weight of vertex x(i) regarding x(j) according to Floater's algorithm. More...
 
class  Neighbourhood
 Class that maintains neighbourhood information of triangle mesh. Represents the neighbourhood properties of a vertex in the triangle mesh. More...
 

Public Member Functions

virtual void compute ()
 Main function which performs the computation.
 
virtual gsMesh< T > createFlatMesh () const
 
gsMatrix< T > createUVmatrix ()
 
gsMatrix< T > createXYZmatrix ()
 
 gsParametrization (const gsMesh< T > &mesh, const gsOptionList &list=defaultOptions())
 Constructor using the input mesh and (possibly) options.
 
virtual void restrictMatrices (gsMatrix< T > &uv, const gsMatrix< T > &xyz, real_t uMin=0, real_t uMax=1) const
 It might make sense in the derived classes to restrict the parameters to [0, 1]^2.
 
void writeTexturedMesh (std::string filename) const
 

Static Public Member Functions

static gsOptionList defaultOptions ()
 Returns the list of default options for gsParametrization.
 

Protected Member Functions

void constructAndSolveEquationSystem (const Neighbourhood &neighbourhood, const size_t n, const size_t N)
 Constructs linear equation system and solves it. More...
 
const Point2DgetParameterPoint (size_t vertexIndex) const
 Get parameter point Returns the parameter point with given vertex index. More...
 

Protected Attributes

const gsHalfEdgeMesh< T > m_mesh
 mesh information
 
VectorType m_parameterPoints
 parameter points
 

Member Function Documentation

void constructAndSolveEquationSystem ( const Neighbourhood neighbourhood,
const size_t  n,
const size_t  N 
)
protected

Constructs linear equation system and solves it.

The last step in Floater's algorithm is solving the linear equation system to obtain the parameter values for the inner vertices of the triangle mesh. This method constructs the above-mentioned system using information from neighbourhood. The matrix is given by a(i,i) = 1 a(i,j) = -lambda(i,j) for j!=i and the right hand side is calculated using the boundary parameters found beforehand. The parameter values are multiplied with corresponding lambda values and summed up. In the last step the system is solved and the parameter points are stored in m_parameterPoints.

Parameters
[in]neighbourhoodconst Neighbourhood& - neighbourhood information of the mesh
[in]nconst int - number of inner vertices and therefore size of the square matrix
[in]Nconst int - number of the vertices and therefore N-n is the size of the right-hand-side vector
gsMesh< T > createFlatMesh ( ) const
virtual

Creates a flat mesh

Returns

Reimplemented in gsPeriodicOverlap< T >, and gsPeriodicStitch< T >.

gsMatrix< T > createUVmatrix ( )

Parametric Coordinates u,v from 0..1

Returns
gsMatrix< T > createXYZmatrix ( )

Corresponding mapped values in R3 to parametric coordinates.

Returns
const gsParametrization< T >::Point2D & getParameterPoint ( size_t  vertexIndex) const
protected

Get parameter point Returns the parameter point with given vertex index.

Parameters
[in]vertexIndexint - vertex index
Returns
two-dimensional parameter point
void writeTexturedMesh ( std::string  filename) const

Writes m_mesh into filename.vtk with the vertices coloured according to the parameters.

Parameters
filenameThe name of the output file (without extension).