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

Detailed Description

template<class T>
class gismo::gsTemplate< T >

Class gsTemplate object.

A template is a structure defining a topological arrangement of a collection of parameter domains (that map to physical-domain patches). Additionally, the template stores the images of the corner points on physical space (but not the surface patch itself).

For ordering the box vertices:

  6---7
 /|  /|
2---3 |
| 4-|-5
|/  |/ 
0---1

Sides:

2---3  3---7  7---6  6---2
|   |  |   |  |   |  |   |
|   |  |   |  |   |  |   |
0---1  1---5  5---4  4---0

Bottom/Top:

0---1  6---7
|   |  |   |
|   |  |   |
4---5  2---3

Then we describe quads or triangle pairs in the right counter-clockwise order:

2---3               3         2--3 
|   |  becomes     /|   and   | / 
|   |             / |         |/ 
0---1            0--1         0 

Triangles 0-1-3 and 0-3-2 Quad 0-1-3-2

+ Inheritance diagram for gsTemplate< T >:
+ Collaboration diagram for gsTemplate< T >:

Public Types

typedef gsBoxTopology Base
 Shared pointer for gsTemplate.
 

Public Member Functions

void addAutoBoundaries ()
 Make all patch sides which are not yet declared as interface or boundary to a boundary.
 
void addBoundary (index_t p, boxSide s, std::string l="")
 Set side s of box p to a boundary.
 
void addBoundary (const patchSide &ps)
 Set patch side ps to a boundary.
 
void addBox (index_t i=1)
 Add i new boxes.
 
template<class T >
gsProperty< T > addBoxProperty (const std::string &name, T t=T())
 Adds a box property. More...
 
void addInterface (index_t p1, boxSide s1, index_t p2, boxSide s2, std::string l="")
 Add an interface between side s1 of box p1 and side s2 of box p2.
 
void addInterface (const boundaryInterface &bi)
 Add an interface described by bi.
 
std::vector< std::vector
< patchComponent > > 
allComponents (bool combineCorners=false) const
 Returns all components representing the topology. More...
 
const_biterator bBegin () const
 
biterator bBegin ()
 
const_biterator bEnd () const
 
biterator bEnd ()
 
const boundaryInterfacebInterface (int i) const
 Access i-th boundary interface.
 
const bContainer & boundaries () const
 Return the vector of boundaries.
 
bContainer boundaries (const std::string l) const
 Return the vector of boundaries with label l.
 
void checkConsistency () const
 Check that boundaries and interfaces are consistent.
 
void clearAll ()
 Clear all boxes, boundary and interface data.
 
void clearTopology ()
 Clear all boundary and interface data.
 
gsTemplateclone () const
 Clone function. Used to make a copy of the object.
 
short_t dim () const
 Dimension of the boxes.
 
InterfacePtr findInterface (const index_t b1, const index_t b2) const
 
BoundaryPtr getBoundary (const patchSide &ps)
 Returns a pointer to the boundary stored in this class, given ps.
 
template<class T >
gsProperty< T > getBoxProperty (const std::string &name) const
 Adds a box property. More...
 
bool getCornerList (const patchCorner &start, std::vector< patchCorner > &cornerList) const
 
void getEVs (std::vector< std::vector< patchCorner > > &cornerLists, bool boundaries=false) const
 
bool getInterface (const patchSide &ps, boundaryInterface &result) const
 
int getMaxValence () const
 returns the maximal valence of a vertex of this topology.
 
bool getNeighbour (const patchSide &ps, patchSide &result, int &ii) const
 
bool getNeighbour (const patchSide &ps, patchSide &result) const
 
void getOVs (std::vector< std::vector< patchCorner > > &cornerLists) const
 
 gsTemplate ()
 Default empty constructor.
 
 gsTemplate (int r, bool)
 square template constructed providing the 4 corners Bb matrix (2,4) (x and y coord.)
 
 gsTemplate (const std::vector< T > &intervalWidths, const gsMatrix< T > &verts, size_t startIdx, size_t endIdx, T curveProportion)
 
const_iiterator iBegin () const
 
iiterator iBegin ()
 
const_iiterator iEnd () const
 
iiterator iEnd ()
 
const ifContainer & interfaces () const
 Return the vector of interfaces.
 
ifContainer interfaces (const std::string l) const
 Return the vector of interfaces with label l.
 
bool isBoundary (const patchSide &ps) const
 Is the given patch side ps set to a boundary?
 
bool isBoundary (index_t p, boxSide s)
 Returns true if side s on patch p is a boundary.
 
bool isInterface (const patchSide &ps) const
 Is the given patch side ps set to an interface?
 
size_t nBoundary () const
 Number of boundaries.
 
index_t nBoxes () const
 Number of boxes.
 
size_t nInterfaces () const
 Number of interfaces.
 
index_t nPatches () const
 Number of patches.
 
index_t numBoxProperties () const
 Returns the number of assigned box properties. More...
 
std::ostream & print (std::ostream &os) const
 Prints the object as a string.
 
void setDim (short_t i)
 Set the dimension of the boxes.
 
void swap (gsBoxTopology &other)
 Swap with another gsBoxTopology.
 

Protected Attributes

bContainer m_boundary
 List of boundaries of the boxes.
 
gsProperty_container m_boxProp
 List of properties for each box.
 
short_t m_dim
 Dimension of the boxes held.
 
ifContainer m_interfaces
 List of intefaces between boxes.
 
index_t nboxes
 Number of boxes held.
 

Private Attributes

gsMatrix< T > * m_corners
 List of corner points.
 

Constructor & Destructor Documentation

gsTemplate ( const std::vector< T > &  intervalWidths,
const gsMatrix< T > &  verts,
size_t  startIdx,
size_t  endIdx,
curveProportion 
)
inline

construct a template for a convex polygon, with a single skeleton curve between two specified vertices.

Parameters
intervalWidthsA vector of widths of the parametrization intervals of each edge
vertsA gsMatrix whose rows are the vertices of the convex polygon
startIdxRow number of the vertex for the bisecting curve to start at
endIdxRow number for the end vertex
curveProportionmiddle fraction of the bisecting curve that will actually become part of the skeleton

Member Function Documentation

gsProperty<T> addBoxProperty ( const std::string &  name,
t = T() 
)
inlineinherited

Adds a box property.

Parameters
[in]nameThe name of the property
[in]tThe value of the property
Template Parameters
TThe type of the property
Returns
The property as a gsProperty object
std::vector< std::vector< patchComponent > > allComponents ( bool  combineCorners = false) const
inherited

Returns all components representing the topology.

Each entry of the outer vector represents one component (patch-interior, face, edge, corner, etc.). Since the components refering to one interface can be addressed as belonging to different patches, each component itself is represented by an inner vector which contains all patchComponent objects that refer to the particular component.

Parameters
combineCornersIf this is set, all corners are treated as one component
const_biterator bBegin ( ) const
inlineinherited

Get a const-iterator to the beginning of the boundaries

Returns
an iterator to the beginning of the boundaries
biterator bBegin ( )
inlineinherited

Get an iterator to the beginning of the boundaries

Returns
an iterator to the beginning of the boundaries
const_biterator bEnd ( ) const
inlineinherited

Get a const-iterator to the end of the boundaries

Returns
an iterator to the end of the boundaries
biterator bEnd ( )
inlineinherited

Get an iterator to the end of the boundaries

Returns
an iterator to the end of the knotvector
const boundaryInterface * findInterface ( const index_t  b1,
const index_t  b2 
) const
inherited

Returns a pointer to the interface between boxes b1 and b2, if one exists, otherwise it returns a null pointer

gsProperty<T> getBoxProperty ( const std::string &  name) const
inlineinherited

Adds a box property.

Parameters
[in]nameThe name of the property
Template Parameters
TThe type of the property
Returns
The property as a gsProperty<T> object
bool getCornerList ( const patchCorner start,
std::vector< patchCorner > &  cornerList 
) const
inherited

takes a patchCorner start and gives back all other patchCorners, that represent the same point in the vector cornerList

void getEVs ( std::vector< std::vector< patchCorner > > &  cornerLists,
bool  boundaries = false 
) const
inherited

gives back all the extraordinary vertices (3 faces or more than 4) of the topology each EV is represented by a vector of patchCorners, which represent the same vertex all the vectors are put in the vector cornerLists. It will only find vertices on the inside. CAREFUL: works only for 2D

bool getInterface ( const patchSide ps,
boundaryInterface result 
) const
inlineinherited

set result to the associated interface of ps, returns false if it is a boundary patchSide

bool getNeighbour ( const patchSide ps,
patchSide result,
int &  ii 
) const
inherited

set result to the associated patchSide of ps, returns false if it is a boundary patchSide

bool getNeighbour ( const patchSide ps,
patchSide result 
) const
inherited

set result to the associated patchSide of ps, returns false if it is a boundary patchSide

void getOVs ( std::vector< std::vector< patchCorner > > &  cornerLists) const
inherited

gives back all the ordinary vertices (4 faces) of the topology each OV is represented by a vector of patchCorners, which represent the same vertex all the vectors are put in the vector cornerLists It will only find vertices on the inside. CAREFUL: works only for 2D

const_iiterator iBegin ( ) const
inlineinherited

Get a const-iterator to the interfaces

Returns
an iterator to the beginning of the interfaces
iiterator iBegin ( )
inlineinherited

Get an iterator to the beginning of the interfaces

Returns
an iterator to the beginning of the interfaces
const_iiterator iEnd ( ) const
inlineinherited

Get a const iterator to the end of the interfaces

Returns
an iterator to the end of the interfaces
iiterator iEnd ( )
inlineinherited

Get an iterator to the end of the interfaces

Returns
an iterator to the end of the interfaces
index_t numBoxProperties ( ) const
inlineinherited

Returns the number of assigned box properties.

Returns
The number of assigned box properties