NetDEM v1.0
Loading...
Searching...
No Matches
netdem::PeriDigmDiscretization Class Reference

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.
 
DomainSplittordomain_splittor {nullptr}
 A pointer to the domain splittor used in the discretization.
 
VecXT< Vec3dnodes
 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.
 

Detailed Description

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.

Member Enumeration Documentation

◆ Type

An enum representing the type of discretization used.

The Type enum represents the type of discretization used, which can be either level set or tetmesh.

Enumerator
level_set 
tetmesh 

Constructor & Destructor Documentation

◆ PeriDigmDiscretization()

PeriDigmDiscretization::PeriDigmDiscretization ( )

Default constructor.

◆ ~PeriDigmDiscretization()

PeriDigmDiscretization::~PeriDigmDiscretization ( )

Destructor.

Member Function Documentation

◆ GetNodeSize()

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.

Returns
The average size of the nodes.

◆ InitFromDistanceMap()

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.

Parameters
txt_fileThe path to the distance map text file.

◆ InitFromGrid()

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.

Parameters
corner_xThe x-coordinate of the corner of the grid.
corner_yThe y-coordinate of the corner of the grid.
corner_zThe z-coordinate of the corner of the grid.
len_xThe length of the grid in the x-direction.
len_yThe length of the grid in the y-direction.
len_zThe length of the grid in the z-direction.
num_ele_eachThe number of elements in each dimension.

◆ InitFromSTL() [1/2]

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.

Parameters
stl_fileThe path to the STL file.
num_ele_eachThe number of elements in each dimension.

◆ InitFromSTL() [2/2]

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.

Parameters
stl_modelThe STLModel object representing the surface.
num_ele_eachThe number of elements in each dimension.

◆ MakePorosity()

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.

Parameters
porosityThe desired porosity.

◆ WriteNodeFile()

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.

Parameters
result_dirThe path to the directory where the node file should be written.

Member Data Documentation

◆ domain_splittor

DomainSplittor* netdem::PeriDigmDiscretization::domain_splittor {nullptr}

A pointer to the domain splittor used in the discretization.

◆ node_block_indices

VecXT<int> netdem::PeriDigmDiscretization::node_block_indices

The list of block indices for each node in the discretization.

◆ node_vols

VecXT<double> netdem::PeriDigmDiscretization::node_vols

The list of volumes for each node in the discretization.

◆ nodes

VecXT<Vec3d> netdem::PeriDigmDiscretization::nodes

The list of node positions in the discretization.

◆ type

Type netdem::PeriDigmDiscretization::type {Type::level_set}

The type of discretization used.


The documentation for this class was generated from the following files: