SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::component::topology::DynamicSparseGridTopologyModifier Class Reference

#include <DynamicSparseGridTopologyModifier.h>

Inheritance diagram for sofa::component::topology::DynamicSparseGridTopologyModifier:

Detailed Description

A class that modifies the topology by adding and removing hexahedra

Public Member Functions

 SOFA_CLASS (DynamicSparseGridTopologyModifier, HexahedronSetTopologyModifier)
 
void init () override
 
void addHexahedraProcess (const sofa::helper::vector< Hexahedron > &hexahedra) override
 Actually Add some hexahedra to this topology. Wrong way to add some hexahedra for the moment ! More...
 
virtual void addHexahedraProcess (const sofa::helper::vector< Hexahedron > &hexahedra, const sofa::helper::vector< unsigned int > &indices)
 Actually Add some hexahedra to this topology. More...
 
void removeHexahedraProcess (const sofa::helper::vector< unsigned int > &indices, const bool removeIsolatedItems=false) override
 Remove a subset of hexahedra. More...
 
virtual void renumberAttributes (const sofa::helper::vector< unsigned int > &hexahedra)
 Renumber the attributes of this class. More...
 
- Public Member Functions inherited from sofa::component::topology::HexahedronSetTopologyModifier
 SOFA_CLASS (HexahedronSetTopologyModifier, QuadSetTopologyModifier)
 
void init () override
 
void propagateTopologicalEngineChanges () override
 function to propagate topological change events by parsing the list of topologyEngines linked to this topology. More...
 
virtual void addHexahedra (const sofa::helper::vector< Hexahedron > &hexahedra)
 add a set of hexahedra More...
 
virtual void addHexahedra (const sofa::helper::vector< Hexahedron > &hexahedra, const sofa::helper::vector< sofa::helper::vector< HexahedronID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< double > > &baryCoefs)
 add a set of hexahedra More...
 
void addHexahedraWarning (const size_t nHexahedra, const sofa::helper::vector< Hexahedron > &hexahedraList, const sofa::helper::vector< HexahedronID > &hexahedraIndexList)
 Sends a message to warn that some hexahedra were added in this topology. More...
 
void addHexahedraWarning (const size_t nHexahedra, const sofa::helper::vector< Hexahedron > &hexahedraList, const sofa::helper::vector< HexahedronID > &hexahedraIndexList, const sofa::helper::vector< sofa::helper::vector< HexahedronID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< double > > &baryCoefs)
 Sends a message to warn that some hexahedra were added in this topology. More...
 
void addHexahedronProcess (Hexahedron e)
 Add a hexahedron. More...
 
virtual void removeHexahedraWarning (sofa::helper::vector< HexahedronID > &hexahedra)
 Sends a message to warn that some hexahedra are about to be deleted. More...
 
void addQuadsProcess (const sofa::helper::vector< Quad > &quads) override
 Actually Add some quads to this topology. More...
 
void removeQuadsProcess (const sofa::helper::vector< QuadID > &indices, const bool removeIsolatedEdges=false, const bool removeIsolatedPoints=false) override
 Remove a subset of quads. More...
 
void addEdgesProcess (const sofa::helper::vector< Edge > &edges) override
 Add some edges to this topology. More...
 
void removeEdgesProcess (const sofa::helper::vector< EdgeID > &indices, const bool removeIsolatedItems=false) override
 Remove a subset of edges. More...
 
void addPointsProcess (const size_t nPoints) override
 Add some points to this topology. More...
 
void removePointsProcess (const sofa::helper::vector< PointID > &indices, const bool removeDOF=true) override
 Remove a subset of points. More...
 
void renumberPointsProcess (const sofa::helper::vector< PointID > &index, const sofa::helper::vector< PointID > &inv_index, const bool renumberDOF=true) override
 Reorder this topology. More...
 
virtual void removeHexahedra (const sofa::helper::vector< HexahedronID > &hexahedraIds)
 Remove a set of hexahedra. More...
 
void removeItems (const sofa::helper::vector< HexahedronID > &items) override
 Generic method to remove a list of items. More...
 
void renumberPoints (const sofa::helper::vector< PointID > &index, const sofa::helper::vector< PointID > &inv_index) override
 Generic method for points renumbering. More...
 
- Public Member Functions inherited from sofa::component::topology::QuadSetTopologyModifier
 SOFA_CLASS (QuadSetTopologyModifier, EdgeSetTopologyModifier)
 
void init () override
 
void propagateTopologicalEngineChanges () override
 function to propagate topological change events by parsing the list of topologyEngines linked to this topology. More...
 
virtual void addQuads (const sofa::helper::vector< Quad > &quads)
 add a set of quads More...
 
virtual void addQuads (const sofa::helper::vector< Quad > &quads, const sofa::helper::vector< sofa::helper::vector< QuadID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< double > > &baryCoefs)
 add a set of quads More...
 
void addQuadsWarning (const size_t nQuads, const sofa::helper::vector< Quad > &quadsList, const sofa::helper::vector< QuadID > &quadsIndexList)
 Sends a message to warn that some quads were added in this topology. More...
 
void addQuadsWarning (const size_t nQuads, const sofa::helper::vector< Quad > &quadsList, const sofa::helper::vector< QuadID > &quadsIndexList, const sofa::helper::vector< sofa::helper::vector< QuadID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< double > > &baryCoefs)
 Sends a message to warn that some quads were added in this topology. More...
 
void addQuadProcess (Quad e)
 Effectively Add a quad. More...
 
virtual void removeQuadsWarning (sofa::helper::vector< QuadID > &quads)
 Sends a message to warn that some quads are about to be deleted. More...
 
void addEdgesProcess (const sofa::helper::vector< Edge > &edges) override
 Add some edges to this topology. More...
 
void removeEdgesProcess (const sofa::helper::vector< QuadID > &indices, const bool removeIsolatedItems=false) override
 Remove a subset of edges. More...
 
void addPointsProcess (const size_t nPoints) override
 Add some points to this topology. More...
 
void removePointsProcess (const sofa::helper::vector< PointID > &indices, const bool removeDOF=true) override
 Remove a subset of points. More...
 
void renumberPointsProcess (const sofa::helper::vector< PointID > &index, const sofa::helper::vector< PointID > &inv_index, const bool renumberDOF=true) override
 Reorder this topology. More...
 
virtual void removeQuads (const sofa::helper::vector< QuadID > &quadIds, const bool removeIsolatedEdges, const bool removeIsolatedPoints)
 Remove a set of quads. More...
 
void removeItems (const sofa::helper::vector< QuadID > &items) override
 Generic method to remove a list of items. More...
 
void renumberPoints (const sofa::helper::vector< PointID > &index, const sofa::helper::vector< PointID > &inv_index) override
 Generic method for points renumbering. More...
 
- Public Member Functions inherited from sofa::component::topology::EdgeSetTopologyModifier
 SOFA_CLASS (EdgeSetTopologyModifier, PointSetTopologyModifier)
 
void init () override
 
virtual void addEdges (const sofa::helper::vector< Edge > &edges)
 add a set of edges More...
 
virtual void addEdges (const sofa::helper::vector< Edge > &edges, const sofa::helper::vector< sofa::helper::vector< EdgeID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< SReal > > &baryCoefs)
 add a set of edges More...
 
virtual void addEdges (const sofa::helper::vector< Edge > &edges, const sofa::helper::vector< core::topology::EdgeAncestorElem > &ancestorElems)
 add a set of edges More...
 
virtual void addEdgesWarning (const size_t nEdges)
 Sends a message to warn that some edges were added in this topology. More...
 
virtual void addEdgesWarning (const size_t nEdges, const sofa::helper::vector< Edge > &edgesList, const sofa::helper::vector< EdgeID > &edgesIndexList)
 Sends a message to warn that some edges were added in this topology. More...
 
virtual void addEdgesWarning (const size_t nEdges, const sofa::helper::vector< Edge > &edgesList, const sofa::helper::vector< EdgeID > &edgesIndexList, const sofa::helper::vector< sofa::helper::vector< EdgeID > > &ancestors)
 Sends a message to warn that some edges were added in this topology. More...
 
virtual void addEdgesWarning (const size_t nEdges, const sofa::helper::vector< Edge > &edgesList, const sofa::helper::vector< EdgeID > &edgesIndexList, const sofa::helper::vector< sofa::helper::vector< EdgeID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< SReal > > &baryCoefs)
 Sends a message to warn that some edges were added in this topology. More...
 
virtual void addEdgesWarning (const size_t nEdges, const sofa::helper::vector< Edge > &edgesList, const sofa::helper::vector< EdgeID > &edgesIndexList, const sofa::helper::vector< core::topology::EdgeAncestorElem > &ancestorElems)
 Sends a message to warn that some edges were added in this topology. More...
 
void addEdgeProcess (Edge e)
 Effectively add an edge. More...
 
virtual void removeEdgesWarning (sofa::helper::vector< EdgeID > &edges)
 Sends a message to warn that some edges are about to be deleted. More...
 
virtual void swapEdgesProcess (const sofa::helper::vector< sofa::helper::vector< EdgeID > > &edgesPairs)
 Swap the edges. More...
 
virtual void fuseEdgesProcess (const sofa::helper::vector< sofa::helper::vector< EdgeID > > &edgesPairs, const bool removeIsolatedPoints=true)
 Fuse the edges. More...
 
virtual void splitEdgesProcess (sofa::helper::vector< EdgeID > &indices, const bool removeIsolatedPoints=true)
 Split the edges. More...
 
virtual void splitEdgesProcess (sofa::helper::vector< EdgeID > &indices, const sofa::helper::vector< sofa::helper::vector< SReal > > &baryCoefs, const bool removeIsolatedPoints=true)
 Split the edges. More...
 
virtual void removeEdges (const sofa::helper::vector< EdgeID > &edgeIds, const bool removeIsolatedPoints=true, const bool resetTopoChange=true)
 Remove a set of edges. More...
 
void removeItems (const sofa::helper::vector< EdgeID > &items) override
 Generic method to remove a list of items. More...
 
virtual void swapEdges (const sofa::helper::vector< sofa::helper::vector< EdgeID > > &edgesPairs)
 Swap a list of pair edges, replacing each edge pair ((p11, p12), (p21, p22)) by the edge pair ((p11, p21), (p12, p22)) More...
 
virtual void fuseEdges (const sofa::helper::vector< sofa::helper::vector< EdgeID > > &edgesPairs, const bool removeIsolatedPoints=true)
 Fuse a list of pair edges, replacing each edge pair ((p11, p12), (p21, p22)) by one edge (p11, p22) More...
 
virtual void splitEdges (sofa::helper::vector< EdgeID > &indices, const bool removeIsolatedPoints=true)
 Split an array of edges, replacing each edge (p1, p2) by two edges (p1, p3) and (p3, p2) where p3 is the new vertex On each edge, a vertex is created based on its barycentric coordinates. More...
 
virtual void splitEdges (sofa::helper::vector< EdgeID > &indices, const sofa::helper::vector< sofa::helper::vector< SReal > > &baryCoefs, const bool removeIsolatedPoints=true)
 Split an array of edges, replacing each edge (p1, p2) by two edges (p1, p3) and (p3, p2) where p3 is the new vertex On each edge, a vertex is created based on its barycentric coordinates. More...
 
virtual void resortCuthillMckee (sofa::helper::vector< int > &inverse_permutation)
 Gives the optimal vertex permutation according to the Reverse CuthillMckee algorithm (use BOOST GRAPH LIBRAIRY) More...
 
void movePointsProcess (const sofa::helper::vector< PointID > &id, const sofa::helper::vector< sofa::helper::vector< PointID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< SReal > > &coefs, const bool moveDOF=true) override
 Move input points indices to input new coords. Also propagate event and update edgesAroundVertex for data handling. More...
 
virtual bool removeConnectedComponents (EdgeID elemID)
 Given an element indice, it will remove all the connected component in which this element belongs to. Warning: if there is only one connected component in the model. All the object will be removed. More...
 
virtual bool removeConnectedElements (EdgeID elemID)
 Given an element indice, it will remove all elements directly connected to the input one. More...
 
virtual bool removeIsolatedElements ()
 If several connected components are detected, it will keep only the biggest one and remove all the rest. Warning: if two connected components have the same number of element and are the biggest. It will keep the first one. More...
 
virtual bool removeIsolatedElements (size_t scaleElem)
 If several connected components are detected, it will remove all connected component with less than a given number of elements. More...
 
- Public Member Functions inherited from sofa::component::topology::PointSetTopologyModifier
 SOFA_CLASS (PointSetTopologyModifier, core::topology::TopologyModifier)
 
void init () override
 
virtual void swapPoints (const int i1, const int i2)
 Swap points i1 and i2. More...
 
void addPointsWarning (const size_t nPoints, const bool addDOF=true)
 Sends a message to warn that some points were added in this topology. More...
 
void addPointsWarning (const size_t nPoints, const sofa::helper::vector< sofa::helper::vector< PointID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< SReal > > &coefs, const bool addDOF=true)
 Sends a message to warn that some points were added in this topology. More...
 
void addPointsWarning (const size_t nPoints, const sofa::helper::vector< core::topology::PointAncestorElem > &ancestorElems, const bool addDOF=true)
 Sends a message to warn that some points were added in this topology. More...
 
virtual void addPoints (const size_t nPoints, const bool addDOF=true)
 Add a set of points. More...
 
virtual void addPoints (const size_t nPoints, const sofa::helper::vector< sofa::helper::vector< PointID > > &ancestors, const sofa::helper::vector< sofa::helper::vector< SReal > > &coefs, const bool addDOF=true)
 Add a set of points. More...
 
void addPoints (const size_t nPoints, const sofa::helper::vector< core::topology::PointAncestorElem > &ancestorElems, const bool addDOF=true)
 Add a set of points according to their ancestors topology elements. More...
 
void removePointsWarning (sofa::helper::vector< PointID > &indices, const bool removeDOF=true)
 Sends a message to warn that some points are about to be deleted. More...
 
void renumberPointsWarning (const sofa::helper::vector< PointID > &index, const sofa::helper::vector< PointID > &inv_index, const bool renumberDOF=true)
 Sends a message to warn that points are about to be reordered. More...
 
void propagateTopologicalChanges () override
 Called by a topology to warn specific topologies linked to it that TopologyChange objects happened. More...
 
void propagateTopologicalChangesWithoutReset ()
 TODO: doc ?? More...
 
void propagateStateChanges () override
 Called by a topology to warn the Mechanical Object component that points have been added or will be removed. More...
 
void notifyEndingEvent () override
 
void removeItems (const sofa::helper::vector< PointID > &) override
 Generic method to remove a list of items. More...
 

Protected Member Functions

 DynamicSparseGridTopologyModifier ()
 
 ~DynamicSparseGridTopologyModifier () override
 
- Protected Member Functions inherited from sofa::component::topology::HexahedronSetTopologyModifier
 HexahedronSetTopologyModifier ()
 
 ~HexahedronSetTopologyModifier () override
 
- Protected Member Functions inherited from sofa::component::topology::QuadSetTopologyModifier
 QuadSetTopologyModifier ()
 
 ~QuadSetTopologyModifier () override
 
- Protected Member Functions inherited from sofa::component::topology::EdgeSetTopologyModifier
 EdgeSetTopologyModifier ()
 
 ~EdgeSetTopologyModifier () override
 
- Protected Member Functions inherited from sofa::component::topology::PointSetTopologyModifier
 PointSetTopologyModifier ()
 
 ~PointSetTopologyModifier () override
 

Additional Inherited Members

- Public Attributes inherited from sofa::component::topology::HexahedronSetTopologyModifier
Data< boolremoveIsolated
 Controlled DOF index. More...
 
- Public Attributes inherited from sofa::component::topology::PointSetTopologyModifier
Data< boold_propagateToDOF
 propagate changes to Mechanical object DOFs More...
 

Constructor details

sofa::component::topology::DynamicSparseGridTopologyModifier::DynamicSparseGridTopologyModifier ( )
inlineprotected
sofa::component::topology::DynamicSparseGridTopologyModifier::~DynamicSparseGridTopologyModifier ( )
inlineoverrideprotected

Function details

void sofa::component::topology::DynamicSparseGridTopologyModifier::addHexahedraProcess ( const sofa::helper::vector< Hexahedron > &  hexahedra)
overridevirtual

Actually Add some hexahedra to this topology. Wrong way to add some hexahedra for the moment !

TEMPORARY BUT THIS METHOD MUST NOT BE USED !!

See also
addHexahedraWarning

Reimplemented from sofa::component::topology::HexahedronSetTopologyModifier.

void sofa::component::topology::DynamicSparseGridTopologyModifier::addHexahedraProcess ( const sofa::helper::vector< Hexahedron > &  hexahedra,
const sofa::helper::vector< unsigned int > &  indices 
)
virtual

Actually Add some hexahedra to this topology.

This overloaded function updates relation between hexahedra indices in the topology and hexahedra indices in the regular grid.

See also
addHexahedraWarning
void sofa::component::topology::DynamicSparseGridTopologyModifier::init ( void  )
override
void sofa::component::topology::DynamicSparseGridTopologyModifier::removeHexahedraProcess ( const sofa::helper::vector< unsigned int > &  indices,
const bool  removeIsolatedItems = false 
)
overridevirtual

Remove a subset of hexahedra.

Elements corresponding to these points are removed form the mechanical object's state vectors.

Important : some structures might need to be warned BEFORE the points are actually deleted, so always use method removeEdgesWarning before calling removeEdgesProcess.

See also
removeHexahedraWarning
Parameters
removeIsolatedItemsif true remove isolated quads, edges and vertices

Reimplemented from sofa::component::topology::HexahedronSetTopologyModifier.

void sofa::component::topology::DynamicSparseGridTopologyModifier::renumberAttributes ( const sofa::helper::vector< unsigned int > &  hexahedra)
virtual

Renumber the attributes of this class.

This method is automatically called in removeHexahedraProcess() if the user has not ever called it.

sofa::component::topology::DynamicSparseGridTopologyModifier::SOFA_CLASS ( DynamicSparseGridTopologyModifier  ,
HexahedronSetTopologyModifier   
)