|
enum | Type : INTEGER_TYPE { Undefined = std::numeric_limits<INTEGER_TYPE>::lowest(),
Inside = (unsigned) 1 << (unsigned) 0,
Outside = (unsigned) 1 << (unsigned) 1,
Boundary = (unsigned) 1 << (unsigned) 2
} |
|
using | Index = std::size_t |
|
using | Int = INTEGER_TYPE |
|
using | Float = FLOATING_POINT_TYPE |
|
using | SofaFloat = typename DataTypes::Real |
|
using | SofaVecInt = sofa::defaulttype::Vec< Dimension, UNSIGNED_INTEGER_TYPE > |
|
using | SofaVecFloat = sofa::defaulttype::Vec< Dimension, SofaFloat > |
|
using | Coord = typename DataTypes::Coord |
|
using | SofaVecCoord = sofa::helper::vector< Coord > |
|
using | ElementId = sofa::Index |
|
using | VecElementId = sofa::helper::vector< ElementId > |
|
using | SofaHexahedron = sofa::core::topology::BaseMeshTopology::Hexahedron |
|
using | SofaQuad = sofa::core::topology::BaseMeshTopology::Quad |
|
using | SofaTriangle = sofa::core::topology::BaseMeshTopology::Triangle |
|
using | SofaEdge = sofa::core::topology::BaseMeshTopology::Edge |
|
using | GridType = caribou::topology::Grid< Dimension > |
|
using | NodeIndex = typename GridType::NodeIndex |
|
using | CellIndex = typename GridType::CellIndex |
|
using | Dimensions = typename GridType::Dimensions |
|
using | Subdivisions = typename GridType::Subdivisions |
|
using | LocalCoordinates = typename GridType::LocalCoordinates |
|
using | WorldCoordinates = typename GridType::WorldCoordinates |
|
using | GridCoordinates = typename GridType::GridCoordinates |
|
using | CellSet = typename GridType::CellSet |
|
using | CellElement = typename GridType::Element |
|
template<typename ObjectType > |
using | Link = SingleLink< FictitiousGrid< DataTypes >, ObjectType, BaseLink::FLAG_STRONGLINK > |
|
|
| SOFA_CLASS (SOFA_TEMPLATE(FictitiousGrid, DataTypes), BaseObject) |
|
virtual void | create_grid () |
| Initialization of the grid. More...
|
|
UNSIGNED_INTEGER_TYPE | number_of_cells () const |
| Get the number of sparse cells in the grid.
|
|
UNSIGNED_INTEGER_TYPE | number_of_nodes () const |
| Get the number of sparse nodes in the grid.
|
|
UNSIGNED_INTEGER_TYPE | number_of_subdivisions () const |
| Get the number of subdivisions in the grid.
|
|
std::vector< Cell * > | get_neighbors (const Cell *cell) const |
| Get neighbors cells around a given cell. More...
|
|
std::vector< Cell * > | get_neighbors (const Cell *cell, UNSIGNED_INTEGER_TYPE axis, INTEGER_TYPE direction) const |
| Get cells neighbors in a given axis (x=0, y=1, z=2) and direction (-1, 1) of a given cell. More...
|
|
std::vector< std::pair< LocalCoordinates, FLOATING_POINT_TYPE > > | get_gauss_nodes_of_cell (const CellIndex &sparse_cell_index) const |
| Get the list of gauss nodes coordinates and their respective weight inside a cell. More...
|
|
std::vector< std::pair< LocalCoordinates, FLOATING_POINT_TYPE > > | get_gauss_nodes_of_cell (const CellIndex &sparse_cell_index, const UNSIGNED_INTEGER_TYPE level) const |
| Similar to get_gauss_nodes_of_cell(const CellIndex & index) , but here only the gauss nodes of inner cells up to the subdivision level given are returned. More...
|
|
CellElement | get_cell_element (const CellIndex &sparse_cell_index) const |
| Get the element of a cell from its index in the sparse grid.
|
|
const SofaHexahedron & | get_node_indices_of (const CellIndex &sparse_cell_index) const |
| Get the node indices of a cell from its index in the sparse grid.
|
|
Type | get_type_at (const WorldCoordinates &p) const |
| Get the type (inside, outside, boundary or undefined) of a given point in space.
|
|
std::map< FLOATING_POINT_TYPE, std::vector< CellIndex > > | cell_volume_ratio_distribution (UNSIGNED_INTEGER_TYPE number_of_decimals=0) const |
| Compute the distribution of volume ratios of the top level cells of the grid. More...
|
|
void | init () override |
|
void | draw (const sofa::core::visual::VisualParams *vparams) override |
|
void | computeBBox (const sofa::core::ExecParams *, bool onlyVisible) override |
|
std::string | getTemplateName () const override |
|
template<typename DataTypes >
Compute the distribution of volume ratios of the top level cells of the grid.
The volume ratio is the ratio of actual volume of a cell over the total volume of the cell. Hence, the ratio of a cell outside the boundaries is 0, the ratio of a cell inside is 1, and the ratio of boundary cells are between 0 and 1.
- Parameters
-
number_of_decimals | Round the volume ratio to the given number of decimals. For example, setting this value to 2 will generate a distribution of maximum 100 entries (0.00, 0.01, 0.02, ..., 0.99, 1.00). |
Setting a value at zero deactivate the rounding of volume ratio. Default is 0 which means no rounding.
- Returns
- A sorted map where the keys are the percentage of volume inside the cell, and the value is a vector containing the ids of all cells having this volume percentage.
template<typename DataTypes >
std::vector< std::pair< typename FictitiousGrid< DataTypes >::LocalCoordinates, FLOATING_POINT_TYPE > > SofaCaribou::topology::FictitiousGrid< DataTypes >::get_gauss_nodes_of_cell |
( |
const CellIndex & |
sparse_cell_index, |
|
|
const UNSIGNED_INTEGER_TYPE |
level |
|
) |
| const |
Similar to get_gauss_nodes_of_cell(const CellIndex & index)
, but here only the gauss nodes of inner cells up to the subdivision level given are returned.
Leafs cells bellow the given level are only used to compute the weight of a gauss node.
For example, if the grid's subdivision level is 3, calling this function with level = 0 will give the standard 4 gauss nodes in 2D (8 gauss nodes in 3D), but where each gauss nodes will use their underlying quad tree (resp. octree in 3D) to compute their weight.
- Parameters
-
sparse_cell_index | The index of the cell in the sparse grid |
template<typename DataTypes >
Get cells neighbors in a given axis (x=0, y=1, z=2) and direction (-1, 1) of a given cell.
For example, to get the neighbors cells that are on the top of the given cell (in the y direction), axis would be 1 and direction would be 1. Neighbors outside of the surface boundary are excluded.