19#include <gsIO/gsBase64.h>
31 const unsigned d = basis.dim();
34 typename gsBasis<T>::domainIter domIter = basis.makeDomainIterator();
43 std::vector<Vertex> map(1ULL<<d);
47 std::vector<std::vector<unsigned> > neighbour(1ULL<<d,
48 std::vector<unsigned>() );
55 for (
unsigned dim = 0; dim < d; dim++)
59 const unsigned tmp = counter | (1<< dim) ;
60 neighbour[counter].push_back(tmp);
69 for (; domIter->good(); domIter->next())
73 const T vol = domIter->volume();
83 for (
unsigned dim = 0; dim < d; dim++)
85 vertex(dim) = ( cur(dim) ? upp(dim) : low(dim) );
88 Vertex v = mesh.addVertex(vertex);
96 for (
size_t index = 0; index != neighbour.size(); index++)
98 const std::vector<unsigned> & v = neighbour[index];
100 for (
size_t ngh = 0; ngh != v.size(); ngh++)
103 mesh.
addLine( map[index], map[v[ngh]], n );
122template <
short_t d,
typename T>
129 for (
unsigned i = 0; i < basis.maxLevel() + 1; i++)
141 std::vector<std::vector<unsigned> > neighbour(1 << d,
142 std::vector<unsigned>() );
150 for (
unsigned dim = 0; dim < d; dim++)
154 const unsigned tmp = counter | (1<< dim) ;
155 neighbour[counter].push_back(tmp);
166 std::vector<Vertex> map(1 << d);
172 for (; domIter.
good(); domIter.
next())
175 int level = domIter.getLevel();
189 for (
unsigned dim = 0; dim < d; dim++)
191 vertex(dim) = ( cur(dim) ? upp(dim) : low(dim) );
194 meshes[level].addVertex(vertex);
195 map[counter++] = meshes[level].vertices().back();
201 for (
size_t index = 0; index != neighbour.size(); index++)
203 const std::vector<unsigned> & v = neighbour[index];
205 for (
size_t ngh = 0; ngh != v.size(); ngh++)
208 meshes[level].addLine( map[index], map[v[ngh]], n );
237 internal::makeHierarchicalMesh<1, T>(*hBasis1, meshes, n);
247 internal::makeHierarchicalMesh<2, T>(*hBasis2, meshes, n);
257 internal::makeHierarchicalMesh<3, T>(*hBasis3, meshes, n);
A basis represents a family of scalar basis functions defined over a common parameter domain.
Definition gsBasis.h:79
bool good() const
Is the iterator still pointing to a valid element?
Definition gsDomainIterator.h:112
Re-implements gsDomainIterator for iteration over all boundary elements of a hierarchical parameter d...
Definition gsHDomainIterator.h:39
const gsVector< T > & upperCorner() const
Returns the upper corner of the current element.
Definition gsHDomainIterator.h:122
const gsVector< T > & lowerCorner() const
Returns the lower corner of the current element.
Definition gsHDomainIterator.h:120
bool next()
Proceeds to the next element.
Definition gsHDomainIterator.h:75
Class representing a (scalar) hierarchical tensor basis of functions .
Definition gsHTensorBasis.h:75
Class Representing a triangle mesh with 3D vertices.
Definition gsMesh.h:32
void addLine(gsMatrix< T > const &points)
Definition gsMesh.hpp:329
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
gsVertex class that represents a 3D vertex for a gsMesh.
Definition gsVertex.h:27
bool nextCubePoint(Vec &cur, const Vec &end)
Iterate in lexigographic order through the points of the integer lattice contained in the cube [0,...
Definition gsCombinatorics.h:327
This file contains the debugging and messaging system of G+Smo.
Provides declaration of iterator of hierarchical domain.
Provides definition of HTensorBasis abstract interface.
void makeHierarchicalMesh(const gsHTensorBasis< d, T > &basis, std::vector< gsMesh< T > > &meshes, int n=0)
Look at function gismo::makeHierarchicalMesh.
Definition gsIOUtils.h:123
The G+Smo namespace, containing all definitions for the library.
void makeMesh(const gsBasis< T > &basis, gsMesh< T > &mesh, int n=0)
Returns the computational mesh of basis.
Definition gsIOUtils.h:29
bool makeHierarchicalMesh(const gsBasis< T > &basis, std::vector< gsMesh< T > > &meshes, int n=0)
Definition gsIOUtils.h:227