NetDEM v1.0
|
A class representing the discretization of a peridynamic simulation. More...
#include <peridigm_discretization.hpp>
Public Types | |
enum | Type { level_set , tetmesh } |
An enum representing the type of discretization used. More... | |
Public Member Functions | |
PeriDigmDiscretization () | |
Default constructor. | |
void | InitFromSTL (std::string const &stl_file, int num_ele_each) |
Initializes the discretization from an STL file. | |
void | InitFromSTL (STLModel const &stl_model, int num_ele_each) |
Initializes the discretization from an STL model. | |
void | InitFromDistanceMap (std::string const &txt_file) |
Initializes the discretization from a distance map. | |
void | InitFromGrid (double corner_x, double corner_y, double corner_z, double len_x, double len_y, double len_z, int num_ele_each) |
Initializes the discretization from a regular grid. | |
void | MakePorosity (double porosity) |
Modifies the node volumes to achieve a specified porosity. | |
void | WriteNodeFile (std::string const &result_dir) |
Writes the node information to file. | |
double | GetNodeSize () |
Gets the average size of the nodes in the discretization. | |
~PeriDigmDiscretization () | |
Destructor. | |
Public Attributes | |
Type | type {Type::level_set} |
The type of discretization used. | |
DomainSplittor * | domain_splittor {nullptr} |
A pointer to the domain splittor used in the discretization. | |
VecXT< Vec3d > | nodes |
The list of node positions in the discretization. | |
VecXT< int > | node_block_indices |
The list of block indices for each node in the discretization. | |
VecXT< double > | node_vols |
The list of volumes for each node in the discretization. | |
A class representing the discretization of a peridynamic simulation.
The PeriDigmDiscretization class represents the discretization of a peridynamic simulation. It includes methods for initializing the discretization from various data sources, manipulating the node positions and volumes, and writing the resulting node information to file.
PeriDigmDiscretization::PeriDigmDiscretization | ( | ) |
Default constructor.
PeriDigmDiscretization::~PeriDigmDiscretization | ( | ) |
Destructor.
double PeriDigmDiscretization::GetNodeSize | ( | ) |
Gets the average size of the nodes in the discretization.
This method gets the average size of the nodes in the discretization by computing the average distance between adjacent nodes.
void PeriDigmDiscretization::InitFromDistanceMap | ( | std::string const & | txt_file | ) |
Initializes the discretization from a distance map.
This method initializes the discretization from a distance map text file by using the values as level set distances and dividing the resulting volume into elements of equal size.
txt_file | The path to the distance map text file. |
void PeriDigmDiscretization::InitFromGrid | ( | double | corner_x, |
double | corner_y, | ||
double | corner_z, | ||
double | len_x, | ||
double | len_y, | ||
double | len_z, | ||
int | num_ele_each ) |
Initializes the discretization from a regular grid.
This method initializes the discretization from a regular grid by dividing the volume into elements of equal size. The origin of the grid is the corner with the minimum (x,y,z) coordinates.
corner_x | The x-coordinate of the corner of the grid. |
corner_y | The y-coordinate of the corner of the grid. |
corner_z | The z-coordinate of the corner of the grid. |
len_x | The length of the grid in the x-direction. |
len_y | The length of the grid in the y-direction. |
len_z | The length of the grid in the z-direction. |
num_ele_each | The number of elements in each dimension. |
void netdem::PeriDigmDiscretization::InitFromSTL | ( | std::string const & | stl_file, |
int | num_ele_each ) |
Initializes the discretization from an STL file.
This method initializes the discretization from an STL file by creating a level set representation of the surface and dividing it into elements of the specified size.
stl_file | The path to the STL file. |
num_ele_each | The number of elements in each dimension. |
void PeriDigmDiscretization::InitFromSTL | ( | STLModel const & | stl_model, |
int | num_ele_each ) |
Initializes the discretization from an STL model.
This method initializes the discretization from an STL model by creating a level set representation of the surface and dividing it into elements of the specified size.
stl_model | The STLModel object representing the surface. |
num_ele_each | The number of elements in each dimension. |
void PeriDigmDiscretization::MakePorosity | ( | double | porosity | ) |
Modifies the node volumes to achieve a specified porosity.
This method modifies the node volumes to achieve a specified porosity by scaling all volumes by the same factor such that the overall volume is reduced by the given porosity fraction.
porosity | The desired porosity. |
void PeriDigmDiscretization::WriteNodeFile | ( | std::string const & | result_dir | ) |
Writes the node information to file.
This method writes the node information (positions, block indices, volumes) to file in the specified directory.
result_dir | The path to the directory where the node file should be written. |
DomainSplittor* netdem::PeriDigmDiscretization::domain_splittor {nullptr} |
A pointer to the domain splittor used in the discretization.
VecXT<int> netdem::PeriDigmDiscretization::node_block_indices |
The list of block indices for each node in the discretization.
VecXT<double> netdem::PeriDigmDiscretization::node_vols |
The list of volumes for each node in the discretization.
The list of node positions in the discretization.
Type netdem::PeriDigmDiscretization::type {Type::level_set} |
The type of discretization used.