G+Smo
24.08.0
Geometry + Simulation Modules
|
A class for computing periodic parametrizations of closed (cylinder-like) surface meshes. The result will be periodic in the u-direction and the parameter domain will be [0, 1]^2. An alternative implementation is given in gsPeriodicOverlap.
This is the implementation used in the paper L. Groiss, B. Juettler, D. Mokris: 27 variants of Tutte's theorem for plane near-triangulations and an application to periodic spline surface fitting, CAGD, 2021.
The user prescribes the u-values of the points on the lower and upper boundaries (i.e., v = 0 and v = 1, respectively). In addition, they are required to provide an overlap mesh: an edge-connected chain of triangles connecting the periodic interface on the bottom and top side of the mesh, which serves as an initial guess for the periodic interface. The triangles corresponding to the overlap are repeated, which allows ``unwrapping" the mesh as.
The equations for the inner vertices (depicted with empty circles in the figure below) are assembled by the methods of the parent class. The vertices from the overlap are set to have their u-coordinate smaller or greater by one than that of their twin, depending on whether they are on the left or the right hand side of the overlap (empty and full squares, respectively).
Inherits gsPeriodicParametrization< T >.
Public Member Functions | |
void | compute () |
Computes the periodic parametrization. | |
gsMesh< T > | createFlatMesh () const |
gsMatrix< T > | createUVmatrix () |
gsMatrix< T > | createXYZmatrix () |
gsPeriodicOverlap (const gsMesh< T > &mesh, const gsMatrix< T > &verticesV0, const gsMatrix< T > ¶msV0, const gsMatrix< T > &verticesV1, const gsMatrix< T > ¶msV1, const gsMesh< T > &overlap, const gsOptionList &list=gsPeriodicParametrization< T >::defaultOptions()) | |
void | restrictMatrices (gsMatrix< T > &uv, const gsMatrix< T > &xyz, real_t uMin=0, real_t uMax=1) const |
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 | calculate (const size_t paraMethod) |
void | constructAndSolveEquationSystem (const Neighbourhood &neighbourhood, const size_t n, const size_t N) |
Analogous to the overloaded function from the parent class. | |
void | constructTwins () |
Construct the twins. | |
void | constructTwinsBetween (size_t ¤tNrAllVertices, std::list< size_t > vertexIndices, size_t from, size_t to, bool rightHandSide) |
void | constructTwinsBetween (size_t ¤tNrAllVertices, std::list< size_t > vertexIndices, gsVertexHandle from, gsVertexHandle to, bool rightHandSide) |
gsMesh< T > | createExtendedFlatMesh (const std::vector< size_t > &right, const std::vector< size_t > &left) const |
size_t | findTwin (size_t vertexId) const |
Finds the twin of the vertex nr. vertexId in the mesh. | |
const Point2D & | getParameterPoint (size_t vertexIndex) const |
Get parameter point Returns the parameter point with given vertex index. More... | |
void | initParameterPoints () |
void | updateLambdasWithTwins (std::vector< T > &lambdas, size_t vertexId) const |
Protected Attributes | |
const std::vector< size_t > | m_indicesV0 |
indices of the vertices with v=0 | |
const std::vector< size_t > | m_indicesV1 |
indicesV1 indices of the vertices with v=1 | |
const gsHalfEdgeMesh< T > | m_mesh |
mesh information | |
const gsHalfEdgeMesh< T > | m_overlapHEM |
The mesh of the overlap, cf. the introduction to the class. | |
VectorType | m_parameterPoints |
parameter points | |
const gsMatrix< T > | m_paramsV0 |
u-parameters of the vertices with v=0 | |
const gsMatrix< T > | m_paramsV1 |
u-parameters of the vertices with v=1 | |
std::vector< std::pair< size_t, size_t > > | m_twins |
|
inlineexplicit |
Constructor
mesh | the surface mesh to be parametrized |
verticesV0 | vertices on the bottom (i.e., v = 0) boundary |
paramsV0 | their prescribed parameters |
verticessV1 | vertices on the upper (i.e., v = 1) boundary |
paramsV1 | their prescribed parameters |
overlap | edge-connected chain of triangles connecting the bottom and top boundary and forming the first guess of the periodic interface |
list | list of the method options |
|
protected |
Analogous to the calculate method of the parent class.
paraMethod | which parametrization method to use |
indicesV0 | indices of the vertices on the bottom (i.e., v = 0) boundary |
indicesV1 | indices of the vertices on the upper (i.e., v = 1) boundary |
|
protected |
Helper function to constructTwins. Constructs twins on the left or right side of the overlap.
currentNrAllVertices | number of input vertices plus the number of twins constructed so far |
vertexIndices | indices of the boundary vertices of the overlap mesh |
from | the index (in the overlap mesh) of the starting vertex of the side |
to | the index of the end vertex of the side |
rightHandSide | flag to decide, whether we are working on the right hand side (true) or left hand side (false) of the overlap. |
|
inlineprotected |
Helper function to constructTwins, preprocesses the inputs for the overloaded method by finding the indices of the vertices from and to.
|
protected |
Creates a flat (i.e., 2D) mesh with the overlap triangles on both sides of the parametric domain.
left | Indices of the vertices on the left boundary of the overlap mesh (using the same indexing as the twins). |
right | Indices of the vertices on the right boundary of the overlap mesh (using the same indexing as the twins). |
|
virtual |
Creates a flat (i.e., 2D) mesh out of a periodic parametrization created by the overlap method.
restrict | If set to true, the mesh is restricted to [0, 1]^2. |
Reimplemented from gsParametrization< T >.
|
inherited |
Parametric Coordinates u,v from 0..1
|
inherited |
Corresponding mapped values in R3 to parametric coordinates.
|
protectedinherited |
Get parameter point Returns the parameter point with given vertex index.
[in] | vertexIndex | int - vertex index |
|
protectedinherited |
Prepares m_parameterPoints for a computation of a periodic parametrization. Important: Neighbourhood has to be constructed before calling this function.
|
inherited |
Moves the u-coordinates of parameters outside the interval [uMin, uMax] to inside the interval. Note: it modifies uv!
uv | Matrix of the parameters, one column per point |
xyz | Matrix of the coordinates, one column per point |
uMin | minimal desired u |
uMax | maximal desired u |
|
protected |
Helper function to constructAndSolveEquationSystem with twins. Takes the coefficients computed by the standard method and shifts them to the twins.
lambdas | the coefficients of the linear combination for the current vertex |
vertex | the id of the current vertex |
|
inherited |
Writes m_mesh into filename.vtk with the vertices coloured according to the parameters.
filename | The name of the output file (without extension). |
|
protected |
Every twin pair is a pair of vertices with (almost) the same coordinates. The first in the pair has the u-coordinate smaller by one than the second.