NetDEM v1.0
|
A domain splitter that uses a level set function to define the domain. More...
#include <level_set_splittor.hpp>
Public Member Functions | |
LevelSetSplittor () | |
Default constructor. | |
void | InitFromSTL (STLModel const &stl_model, int num_ele_each) override |
Initializes the domain splitter from an STL model. | |
void | InitFromDistanceMap (std::string const &file_name) |
Initializes the domain splitter from a distance map file. | |
void | InitFromDistanceMap (double corner_x, double corner_y, double corner_z, double sp, int dim_x, int dim_y, int dim_z, const VecXT< double > &dist_list) |
Initializes the domain splitter from a list of distances. | |
void | GetPeriDigmNodes (VecXT< Vec3d > *const nodes, VecXT< double > *const node_vols) override |
Gets the nodes and volumes of the discretized domain. | |
void | MakePorosity (double porosity) override |
Modifies the domain by adding porosity. | |
STLModel | GetSTLModel () override |
Gets the STL model corresponding to the discretized domain. | |
STLModel | GetSTLModel (const VecXT< int > &node_indices) override |
Gets the STL model corresponding to a subset of the discretized domain. | |
Public Member Functions inherited from netdem::DomainSplittor | |
DomainSplittor () | |
Default constructor. | |
virtual void | InitFromSTL (std::string const &stl_file, int num_ele_each) |
Initializes the domain splitter from an STL file. | |
virtual | ~DomainSplittor () |
Virtual destructor. | |
Public Member Functions inherited from netdem::LevelSetFunction | |
LevelSetFunction () | |
Default constructor. | |
Vec3d const & | GetCorner () const |
double | GetSpacing () const |
Vec3i const & | GetDimensions () const |
double | GetSignedDistance (int id_x, int id_y, int id_z) |
Get the signed distance value of a certian cell of the grid. | |
VecXT< VecXT< VecXT< double > > > const & | GetSignedDistanceTable () const |
void | SetCorner (double corner_x, double corner_y, double corner_z) |
Set the corner of the grid. | |
void | SetSpacing (double sp) |
Set the spacing between grid points. | |
void | SetDimension (double dim_x, double dim_y, double dim_z) |
Set the dimensions of the grid. | |
void | SetSignedDistance (int id_x, int id_y, int id_z, double sdf) |
Set the signed distance value of a certian cell of the grid. | |
void | InitFromSDFCalculator (const SDFCalculator &sdf_calculator) |
Initialize from a signed distance field. | |
double | SignedDistance (Vec3d const &pos) const |
Compute the signed distance at a point in space. | |
Vec3d | GradientInterpolate (Vec3d const &pos) |
Compute the gradient at a point in space using interpolation. | |
Vec3d | GradientMinus (int i, int j, int k) |
Compute the gradient at the grid point (i, j, k) using backward differences. | |
Vec3d | GradientPlus (int i, int j, int k) |
Compute the gradient at the grid point (i, j, k) using forward differences. | |
void | Reinitialization (int iter, double dt) |
Perform reinitialization to maintain properties of the level set function. | |
void | Reinitialization () |
Perform reinitialization with default parameters. | |
Additional Inherited Members | |
Protected Attributes inherited from netdem::LevelSetFunction | |
Vec3d | corner {-0.5, -0.5, -0.5} |
Coordinates of the corner of the grid. | |
double | spacing {0.05} |
Spacing between grid points. | |
Vec3i | dim {21, 21, 21} |
Dimensions of the grid. | |
VecXT< VecXT< VecXT< double > > > | signed_distance_table |
Table containing the signed distance values. | |
A domain splitter that uses a level set function to define the domain.
This class extends the DomainSplittor and LevelSetFunction classes to implement a domain splitter that uses a level set function to define the geometry of the domain. The level set function is a scalar field that represents the distance between points in the domain and the boundary of the domain.
LevelSetSplittor::LevelSetSplittor | ( | ) |
Default constructor.
|
overridevirtual |
Gets the nodes and volumes of the discretized domain.
This method populates the given arrays with the positions of the nodes and the volumes of the elements in the discretized domain.
nodes | A pointer to an array of Vec3d objects to fill with node positions. |
node_vols | A pointer to an array of doubles to fill with element volumes. |
Implements netdem::DomainSplittor.
|
overridevirtual |
Gets the STL model corresponding to the discretized domain.
This method returns an STL model representing the discretized domain.
Implements netdem::DomainSplittor.
Gets the STL model corresponding to a subset of the discretized domain.
This method returns an STL model representing a subset of the discretized domain defined by the given indices.
node_indices | A VecXT<int> object containing the indices of the subset of elements to include in the STL model. |
Implements netdem::DomainSplittor.
void LevelSetSplittor::InitFromDistanceMap | ( | double | corner_x, |
double | corner_y, | ||
double | corner_z, | ||
double | sp, | ||
int | dim_x, | ||
int | dim_y, | ||
int | dim_z, | ||
const VecXT< double > & | dist_list ) |
Initializes the domain splitter from a list of distances.
This method creates a level set function from a list of distances and uses it to define the geometry of the domain.
corner_x | The x coordinate of the corner of the bounding box for the level set function. |
corner_y | The y coordinate of the corner of the bounding box for the level set function. |
corner_z | The z coordinate of the corner of the bounding box for the level set function. |
sp | The spacing between grid points in the level set function. |
dim_x | The number of grid points along the x axis of the level set function. |
dim_y | The number of grid points along the y axis of the level set function. |
dim_z | The number of grid points along the z axis of the level set function. |
dist_list | A VecXT<double> object containing the distances to use in the level set function. |
void LevelSetSplittor::InitFromDistanceMap | ( | std::string const & | file_name | ) |
Initializes the domain splitter from a distance map file.
This method loads a distance map file and creates a level set function to define the geometry of the domain.
file_name | The path to the distance map file to load. |
|
overridevirtual |
Initializes the domain splitter from an STL model.
This method initializes the domain splitter using the given STL model and creates a level set function to define the geometry of the domain.
stl_model | The STL model to use as the domain. |
num_ele_each | The desired number of elements in each dimension of the split domain. |
Implements netdem::DomainSplittor.
|
overridevirtual |
Modifies the domain by adding porosity.
This method modifies the discretized domain by randomly removing elements from it, according to the given porosity value.
porosity | The desired porosity of the modified domain. |
Implements netdem::DomainSplittor.