G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsPeriodicOverlap.h
Go to the documentation of this file.
1 
14 #pragma once
15 
16 #include <gsIO/gsOptionList.h>
18 
19 namespace gismo
20 {
21 
56 template <class T>
57 class GISMO_EXPORT gsPeriodicOverlap : public gsPeriodicParametrization<T>
58 {
61 
62 public:
63  typedef memory::shared_ptr<gsPeriodicOverlap<T> > uPtr;
64 
65 public:
76  explicit gsPeriodicOverlap(const gsMesh<T> &mesh,
77  const gsMatrix<T>& verticesV0,
78  const gsMatrix<T>& paramsV0,
79  const gsMatrix<T>& verticesV1,
80  const gsMatrix<T>& paramsV1,
81  const gsMesh<T>& overlap,
82  const gsOptionList &list = gsPeriodicParametrization<T>::defaultOptions())
83  : gsPeriodicParametrization<T>(mesh, verticesV0, paramsV0, verticesV1, paramsV1, list),
84  m_overlapHEM(overlap)
85  {
86  // Note: m_twins gets constructed later on.
87  // Note: One could also write another constructor accepting gsHalfEdgeMesh as overlap.
88  }
89 
91  void compute();
92 
93 protected:
101  void calculate(const size_t paraMethod);
102 
104  size_t findTwin(size_t vertexId) const
105  {
106  return this->m_mesh.getVertexIndex(m_overlapHEM.getVertexUnsorted(vertexId));
107  }
108 
123  void constructTwinsBetween(size_t& currentNrAllVertices,
124  std::list<size_t> vertexIndices,
125  size_t from, size_t to, bool rightHandSide);
126 
131  void constructTwinsBetween(size_t& currentNrAllVertices,
132  std::list<size_t> vertexIndices,
133  gsVertexHandle from,
134  gsVertexHandle to,
135  bool rightHandSide)
136  {
137  return constructTwinsBetween(currentNrAllVertices,
138  vertexIndices,
139  m_overlapHEM.findVertex(from),
140  m_overlapHEM.findVertex(to),
141  rightHandSide);
142  }
143 
145  void constructTwins();
146 
148  void constructAndSolveEquationSystem(const Neighbourhood &neighbourhood,
149  const size_t n,
150  const size_t N);
151 
159  void updateLambdasWithTwins(std::vector<T>& lambdas,
160  size_t vertexId) const;
161 
162  // From here on the visualisation functions.
163 public:
169  gsMesh<T> createFlatMesh() const;
170 
171 protected:
181  gsMesh<T> createExtendedFlatMesh(const std::vector<size_t>& right,
182  const std::vector<size_t>& left) const;
183 
184 
185 protected: // members
186 
187  std::vector<std::pair<size_t, size_t> > m_twins;
194 };
195 
196 } // namespace gismo
197 
198 #ifndef GISMO_BUILD_LIB
199 #include GISMO_HPP_HEADER(gsPeriodicOverlap.hpp)
200 #endif
const gsHalfEdgeMesh< T > m_overlapHEM
The mesh of the overlap, cf. the introduction to the class.
Definition: gsPeriodicOverlap.h:193
void constructTwinsBetween(size_t &currentNrAllVertices, std::list< size_t > vertexIndices, gsVertexHandle from, gsVertexHandle to, bool rightHandSide)
Definition: gsPeriodicOverlap.h:131
Class that maintains neighbourhood information of triangle mesh. Represents the neighbourhood propert...
Definition: gsParametrization.h:285
std::vector< std::pair< size_t, size_t > > m_twins
Definition: gsPeriodicOverlap.h:187
gsPeriodicOverlap(const gsMesh< T > &mesh, const gsMatrix< T > &verticesV0, const gsMatrix< T > &paramsV0, const gsMatrix< T > &verticesV1, const gsMatrix< T > &paramsV1, const gsMesh< T > &overlap, const gsOptionList &list=gsPeriodicParametrization< T >::defaultOptions())
Definition: gsPeriodicOverlap.h:76
size_t findTwin(size_t vertexId) const
Finds the twin of the vertex nr. vertexId in the mesh.
Definition: gsPeriodicOverlap.h:104
Class Representing a triangle mesh with 3D vertices.
Definition: gsMesh.h:31
Provides a list of labeled parameters/options that can be set and accessed easily.
Definition: gsPeriodicOverlap.h:57
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
Abstract class with the functionality common to gsPeriodicStitch and gsPeriodicOverlap.
gsHalfEdgeMesh is a gsMesh implementation that handles Halfedges
Definition: gsHalfEdgeMesh.h:46
gsVertex class that represents a 3D vertex for a gsMesh.
Definition: gsVertex.h:26