|
OOFEM 3.0
|
A class to represent a 3D grid of voxels. More...
#include <VoxelGrid.h>
Public Member Functions | |
| VoxelGrid (std::array< double, 3 > steps, std::array< int, 3 > sizes) | |
| Constructor for VoxelGrid. | |
| std::array< int, 3 > | sizes () |
| Get the number of steps in each dimension. | |
| std::array< double, 3 > | steps () |
| Get the step sizes in each dimension. | |
| int | get_index (int i, int j, int k) |
| Get the 1D index of a voxel in the grid. | |
| std::tuple< int, int, int > | get_indices (int i) |
| Get the 3D indices of a voxel from its 1D index. | |
| std::tuple< int, int, int > | get_indices_from_point (std::array< double, 3 > point) |
| Get the 3D indices of a voxel from a point in space. | |
| std::array< double, 3 > | get_vector_3d (int i) |
| Get the 3D vector of a voxel (origin) from its 1D index. | |
| std::array< int, 8 > | giveVoxelNodeIds (int index) |
| void | activateNodes (int index, double timeActivated) |
| Voxel & | createVoxel (int index, double timeActivated) |
| Create a Vovel at given index and at given time. | |
| Voxel & | activate (int index, double timeActivated, double vofIncrement) |
| Activate a voxel at a given index in a given time and store the corresponding vof value. | |
| bool | is_active (int index) |
| Check if a voxel at a given index is active. | |
| bool | is_active_node (int index) |
| Check if a node at a given index is active. | |
| int | active_elements () |
| Get the number of active elements (voxels) in the grid. | |
| int | active_nodes () |
| Get the number of active nodes in the grid. | |
| int | size () |
| Get the size of the grid. | |
| Voxel & | get_voxel (int index) |
| Get the voxel at a given index. | |
| VoxelNode & | get_node (int index) |
| Get the node at a given index. | |
| std::unordered_map< int, Voxel > & | giveVoxels () |
| Get the map of nodes in the grid. | |
| std::unordered_map< int, VoxelNode > & | giveNodes () |
| Get the map of nodes in the grid. | |
| Model | get_model (int index) |
| Get the triangulated model of a voxel at a given index. | |
| void | writeVTK (std::string filename) |
Private Attributes | |
| std::unordered_map< int, Voxel > | m_voxels |
| std::unordered_map< int, VoxelNode > | m_nodes |
| std::array< double, 3 > | m_steps |
| std::array< int, 3 > | m_sizes |
A class to represent a 3D grid of voxels.
Definition at line 64 of file VoxelGrid.h.
|
inline |
|
inline |
Activate a voxel at a given index in a given time and store the corresponding vof value.
| index | The index of the voxel. |
| timeActivated | The time the voxel was activated. |
| vofIncrement | The volume of fluid increment (new material volume [0-1]) in the voxel. |
Definition at line 217 of file VoxelGrid.h.
References createVoxel(), get_index(), get_indices(), m_sizes, and m_voxels.
|
inline |
Definition at line 164 of file VoxelGrid.h.
References get_vector_3d(), giveVoxelNodeIds(), is_active_node(), and m_nodes.
Referenced by createVoxel().
|
inline |
Get the number of active elements (voxels) in the grid.
Definition at line 314 of file VoxelGrid.h.
References m_voxels.
|
inline |
Get the number of active nodes in the grid.
Definition at line 323 of file VoxelGrid.h.
References m_nodes.
|
inline |
Create a Vovel at given index and at given time.
| index | The index of the voxel to activate. |
| timeActivated | The time the voxel was activated. |
Definition at line 186 of file VoxelGrid.h.
References activateNodes(), giveVoxelNodeIds(), is_active(), m_nodes, and m_voxels.
Referenced by activate().
|
inline |
Get the 1D index of a voxel in the grid.
| i | The x-coordinate of the voxel. |
| j | The y-coordinate of the voxel. |
| k | The z-coordinate of the voxel. |
Definition at line 102 of file VoxelGrid.h.
References m_sizes.
Referenced by activate(), and giveVoxelNodeIds().
|
inline |
Get the 3D indices of a voxel from its 1D index.
| i | The 1D index of the voxel. |
Definition at line 112 of file VoxelGrid.h.
References m_sizes.
Referenced by activate(), get_vector_3d(), and giveVoxelNodeIds().
|
inline |
Get the 3D indices of a voxel from a point in space.
| point | An array containing the x, y, and z coordinates of the point. |
Definition at line 126 of file VoxelGrid.h.
References m_steps.
|
inline |
Get the triangulated model of a voxel at a given index.
| index | The index of the voxel. |
Definition at line 380 of file VoxelGrid.h.
References get_vector_3d(), m_steps, and modelfrompolygons().
Referenced by Printer::handleG1Command().
|
inline |
Get the node at a given index.
| index | The index of the node. |
Definition at line 352 of file VoxelGrid.h.
References m_nodes.
|
inline |
Get the 3D vector of a voxel (origin) from its 1D index.
| i | The 1D index of the voxel. |
Definition at line 140 of file VoxelGrid.h.
References get_indices(), and m_steps.
Referenced by activateNodes(), get_model(), and writeVTK().
|
inline |
Get the voxel at a given index.
| index | The index of the voxel. |
Definition at line 342 of file VoxelGrid.h.
References m_voxels.
|
inline |
Get the map of nodes in the grid.
Definition at line 370 of file VoxelGrid.h.
References m_nodes.
|
inline |
Definition at line 146 of file VoxelGrid.h.
References get_index(), and get_indices().
Referenced by activateNodes(), and createVoxel().
|
inline |
Get the map of nodes in the grid.
Definition at line 361 of file VoxelGrid.h.
References m_voxels.
|
inline |
Check if a voxel at a given index is active.
| index | The index of the voxel. |
Definition at line 295 of file VoxelGrid.h.
References m_voxels.
Referenced by createVoxel().
|
inline |
Check if a node at a given index is active.
| index | The index of the node. |
Definition at line 305 of file VoxelGrid.h.
References m_nodes.
Referenced by activateNodes().
|
inline |
Get the size of the grid.
Definition at line 332 of file VoxelGrid.h.
References m_sizes.
|
inline |
Get the number of steps in each dimension.
Definition at line 81 of file VoxelGrid.h.
References m_sizes.
Referenced by VoxelGrid().
|
inline |
Get the step sizes in each dimension.
Definition at line 90 of file VoxelGrid.h.
References m_steps.
Referenced by VoxelGrid().
|
inline |
Definition at line 410 of file VoxelGrid.h.
References get_vector_3d(), m_steps, and m_voxels.
|
private |
The map of nodes in the grid.
Definition at line 461 of file VoxelGrid.h.
Referenced by activateNodes(), active_nodes(), createVoxel(), get_node(), giveNodes(), and is_active_node().
|
private |
The sizes of the grid in each dimension.
Definition at line 464 of file VoxelGrid.h.
Referenced by activate(), get_index(), get_indices(), size(), sizes(), and VoxelGrid().
|
private |
The step sizes in each dimension.
Definition at line 463 of file VoxelGrid.h.
Referenced by get_indices_from_point(), get_model(), get_vector_3d(), steps(), VoxelGrid(), and writeVTK().
|
private |
The map of voxels in the grid.
Definition at line 460 of file VoxelGrid.h.
Referenced by activate(), active_elements(), createVoxel(), get_voxel(), giveVoxels(), is_active(), and writeVTK().