G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsBoxTopology Class Reference

Detailed Description

Defines a topological arrangement of a collection of "boxes" (e.g., parameter domains that map to physical-domain patches).

The information on outer boundaries is stored as a list of patchSide structs, each one defining the corresponding patch side to lie on the boundary.

The topological arrangement is stored as a list of boundaryInterface structs, each one defining an interface between two patch sides.

+ Inheritance diagram for gsBoxTopology:

Public Types

typedef memory::shared_ptr
< gsBoxTopology
Ptr
 Shared pointer for gsBoxTopology.
 

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.
 
gsBoxTopologyclone () 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
 
 gsBoxTopology (short_t d=-1, index_t n=0)
 Default constructor.
 
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 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.
 

Friends

std::ostream & operator<< (std::ostream &os, const gsBoxTopology &b)
 Print (as string) a boxTopology object.
 

Member Function Documentation

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

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

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
inline

Get a const-iterator to the beginning of the boundaries

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

Get an iterator to the beginning of the boundaries

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

Get a const-iterator to the end of the boundaries

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

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

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
inline

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

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

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
inline

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

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

bool getNeighbour ( const patchSide ps,
patchSide result 
) const

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

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
inline

Get a const-iterator to the interfaces

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

Get an iterator to the beginning of the interfaces

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

Get a const iterator to the end of the interfaces

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

Get an iterator to the end of the interfaces

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

Returns the number of assigned box properties.

Returns
The number of assigned box properties