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

A class representing a wall object in a physics simulation. More...

#include <wall.hpp>

Public Member Functions

 Wall ()
 Default constructor for Wall class.
 
 Wall (Shape *const shape)
 Constructor for Wall class that sets the shape of the wall.
 
WallClone () const
 Creates a copy of the wall object.
 
void Init ()
 Initializes the wall object with default values.
 
void SetShape (Shape *const shape)
 Sets the shape of the wall.
 
void SetPosition (double pos_x, double pos_y, double pos_z)
 Sets the position of the wall.
 
void SetRodrigues (double angle, double axis_x, double axis_y, double axis_z)
 Sets the orientation of the wall using Rodrigues' formula.
 
void SetQuaternion (double q_0, double q_1, double q_2, double q_3)
 Sets the orientation of the wall using a quaternion.
 
void SetVelocity (double v_x, double v_y, double v_z)
 Sets the translational velocity of the wall.
 
void SetSpin (double spin_x, double spin_y, double spin_z)
 Sets the rotational velocity of the wall.
 
void SetVelocitySpin (double spin_x, double spin_y, double spin_z)
 Sets the combined translational and rotational velocities of the wall.
 
Vec3d GetVelocity (Vec3d const &cnt_pos)
 Gets the velocity of a point within the wall.
 
void SetDynamicProperty (std::string const &key, double value)
 Sets a dynamic property for the wall.
 
double GetDynamicProperty (std::string const &key)
 Gets the value of a dynamic property for the wall.
 
void AddForce (const Vec3d &f)
 Adds a force to the wall object.
 
void AddMoment (const Vec3d &m)
 Adds a moment to the wall object.
 
void AddForceAtomic (const Vec3d &f)
 Adds a force to the wall object atomically.
 
void AddMomentAtomic (const Vec3d &m)
 Adds a moment to the wall object atomically.
 
void ClearForce ()
 Clears the accumulated force on the wall object.
 
void ClearMoment ()
 Clears the accumulated moment on the wall object.
 
void ApplyContactForce (ContactPW const *cnt)
 Applies a contact force to the wall object.
 
void UpdateContactForce ()
 Updates the contact forces for the wall object.
 
void UpdateMotion (double timestep)
 Updates the motion of the wall object over a specified time step.
 
void UpdateMotion (const Vec3d &v, const Vec3d &s, double timestep)
 Updates the motion of the wall object using a specified velocity and spin over a specified time step.
 
void UpdateMotion (const Vec3d &dpos, const Vec4d &dquat)
 Updates the motion of the wall object using a specified displacement position and quaternion.
 
void UpdateBoundFast ()
 Updates the bounding box for the wall object. Wall has a skin and if the movement of particle has not exceed this skin, the bounding box will not be updated.
 
void UpdateBound ()
 Update the bounding box of the wall, which is useful for collision detection. The bounding box will be updated regardless of the wall movement.
 
void ClearLinkedCells ()
 Clears the linked cell list for the wall object.
 
void ClearLinkedNeighs ()
 Clears the linked neighbor list for the wall object.
 
void BuildContactRefTable ()
 Builds the contact lookup table for the wall object.
 
void ClearContactRefTable ()
 Clears the contact lookup table for the wall object.
 
void UpdateLinkedCells (CellManager *const cm)
 Updates the linked cells for the wall object.
 
void UpdateLinkedNeighs (Domain *const domain)
 Updates the linked neighbor list for the wall object.
 
VecXT< ContactPW * > GetContactPWs ()
 Gets a vector of pointers to ContactPW objects representing the contact forces on the wall object.
 
VecXT< std::pair< Cell *, int > > const & GetLinkedCells ()
 Gets a vector of pointers to the cells that may be potentially overlapped this wall.
 
VecXT< NeighPofW > const & GetLinkedParticles ()
 Gets a vector of pointers to the particles that may be potentially overlapped this wall.
 
NeighPofW *const GetLinkedParticle (int lookup_id)
 Gets the neigh obj by look-up id.
 
void UpdateSTLModel ()
 Updates the STL model for the wall object.
 
STLModel GetSTLModel (int num_nodes=200)
 Gets the STL model for the wall object.
 
STLModelGetSTLModelInternal ()
 Gets the STL model for the wall object.
 
void SaveAsVTK (std::string const &filename)
 Saves the wall object as a VTK file.
 
void Print ()
 Prints the properties and state of the wall object to the console.
 
 ~Wall ()
 Destructor for Wall class.
 
int FindLinkedParticle (Particle *const p)
 Find linked particle, return the index.
 
int LinkToCell (Cell *const cell)
 Create a link between this wall and the given cell and return the look up id.
 
NeighPofWLinkToParticle (Particle *const p)
 Create a link between this wall and the given particle and return the look up id.
 

Public Attributes

int id {0}
 The index of the wall in the wall list.
 
int id_in_list {0}
 The label or name of the wall.
 
std::string label {"default"}
 Pointer to the shape of the wall.
 
Shapeshape
 The material type of the wall.
 
int material_type {0}
 Boolean flags for enabling wall rotation and AABB bounds.
 
bool enable_rotation {false}
 
bool enable_bound_aabb {true}
 
Vec3d bound_min
 
Vec3d bound_max
 
Vec3d bound_disp {0, 0, 0}
 The position of the wall.
 
Vec3d pos {0, 0, 0}
 The quaternion representing the orientation of the wall.
 
Vec4d quaternion {1, 0, 0, 0}
 Forces and moments in the global coordinate system.
 
Vec3d force {0, 0, 0}
 
Vec3d moment {0, 0, 0}
 Translational, rotational, and combined velocities of the wall.
 
Vec3d vel {0, 0, 0}
 
Vec3d spin {0, 0, 0}
 
Vec3d vel_spin {0, 0, 0}
 Customized properties for the wall.
 
MiniMap< std::string, double > dynamic_properties
 Boolean flag for updating the linked list algorithm.
 
bool need_update_linked_list {true}
 
bool need_update_stl_model {false}
 < Boolean flag for updating the STL model.
 

Protected Member Functions

void RemoveLinkedCell (int lookup_id)
 Reomve a linked cell by look-up id.
 
void RemoveLinkedParticle (int lookup_id)
 Reomve a linked neighbor by look-up id.
 
void RemoveContactRefPW (int lookup_id)
 Reomve a p-w contact by look-up id.
 
NeighPofW *const GetLinkedContactRefPW (int lookup_id)
 Gets the neigh obj by look-up id.
 
int FindContactRefPW (Particle *const p)
 Find a contact in the look up table, return the index.
 

Protected Attributes

VecXT< std::pair< Cell *, int > > linked_cell_list
 < A list of linked cells for the wall.
 
VecXT< NeighPofWlinked_particle_list
 A lookup table for contact history reference reconstruction.
 
VecXT< NeighPofWcontact_pw_ref_table
 
STLModel stl_model
 

Friends

class Particle
 
class Cell
 
class Domain
 
class MPIManager
 
class DEMSolver
 
class NeighPofW
 
class NeighWofP
 The ID number of the wall.
 

Detailed Description

A class representing a wall object in a physics simulation.

This class defines the properties and behaviors of a wall object, including its position and orientation, shape, and material type. The class also contains methods for updating the wall's state and resolving collisions.

Examples
00_gen_dataset_trimesh_plane.cpp, 00_hertz_contact.cpp, 00_nut_in_bolt.cpp, 01_test_dataset_trimesh_plane.cpp, 06_test_ann_vs_geom_trimesh_plane.cpp, 1_membrane_case.cpp, 20_gen_dataset_ellipsoid_plane.cpp, 21_test_dataset_ellipsoid_plane.cpp, 26_test_ann_vs_geom_ellipsoid_plane.cpp, 81_golf_ball_impact.cpp, 92_nut_in_bolt.cpp, blade_mixing_main.cpp, and landslide_main.cpp.

Constructor & Destructor Documentation

◆ Wall() [1/2]

Wall::Wall ( )

Default constructor for Wall class.

Initializes member variables to default values.

◆ Wall() [2/2]

Wall::Wall ( Shape *const shape)

Constructor for Wall class that sets the shape of the wall.

Parameters
shapePointer to the shape of the wall.

◆ ~Wall()

Wall::~Wall ( )

Destructor for Wall class.

Frees any dynamically allocated memory used by the class.

Member Function Documentation

◆ AddForce()

void Wall::AddForce ( const Vec3d & f)

Adds a force to the wall object.

Parameters
fThe force vector to be added.

◆ AddForceAtomic()

void Wall::AddForceAtomic ( const Vec3d & f)

Adds a force to the wall object atomically.

This method ensures atomicity when adding forces to the wall object in a multithreaded environment.

Parameters
fThe force vector to be added.

◆ AddMoment()

void Wall::AddMoment ( const Vec3d & m)

Adds a moment to the wall object.

Parameters
mThe moment vector to be added.

◆ AddMomentAtomic()

void Wall::AddMomentAtomic ( const Vec3d & m)

Adds a moment to the wall object atomically.

This method ensures atomicity when adding moments to the wall object in a multithreaded environment.

Parameters
mThe moment vector to be added.

◆ ApplyContactForce()

void Wall::ApplyContactForce ( ContactPW const * cnt)

Applies a contact force to the wall object.

Parameters
cntPointer to the ContactPW object representing the contact force.

◆ BuildContactRefTable()

void Wall::BuildContactRefTable ( )

Builds the contact lookup table for the wall object.

◆ ClearContactRefTable()

void Wall::ClearContactRefTable ( )

Clears the contact lookup table for the wall object.

◆ ClearForce()

void Wall::ClearForce ( )

Clears the accumulated force on the wall object.

◆ ClearLinkedCells()

void Wall::ClearLinkedCells ( )

Clears the linked cell list for the wall object.

◆ ClearLinkedNeighs()

void Wall::ClearLinkedNeighs ( )

Clears the linked neighbor list for the wall object.

◆ ClearMoment()

void Wall::ClearMoment ( )

Clears the accumulated moment on the wall object.

◆ Clone()

Wall * Wall::Clone ( ) const

Creates a copy of the wall object.

Returns
A pointer to the cloned wall object.

◆ FindContactRefPW()

int Wall::FindContactRefPW ( Particle *const p)
protected

Find a contact in the look up table, return the index.

◆ FindLinkedParticle()

int Wall::FindLinkedParticle ( Particle *const p)

Find linked particle, return the index.

◆ GetContactPWs()

VecXT< ContactPW * > Wall::GetContactPWs ( )

Gets a vector of pointers to ContactPW objects representing the contact forces on the wall object.

Returns
Vector of pointers to ContactPW objects representing the contact forces on the wall object.

◆ GetDynamicProperty()

double Wall::GetDynamicProperty ( std::string const & key)

Gets the value of a dynamic property for the wall.

Parameters
keyThe name of

the property.

Returns
The value of the property, or 0 if the property is not found.

◆ GetLinkedCells()

VecXT< std::pair< Cell *, int > > const & Wall::GetLinkedCells ( )

Gets a vector of pointers to the cells that may be potentially overlapped this wall.

◆ GetLinkedContactRefPW()

NeighPofW *const Wall::GetLinkedContactRefPW ( int lookup_id)
protected

Gets the neigh obj by look-up id.

◆ GetLinkedParticle()

NeighPofW *const Wall::GetLinkedParticle ( int lookup_id)

Gets the neigh obj by look-up id.

◆ GetLinkedParticles()

VecXT< NeighPofW > const & Wall::GetLinkedParticles ( )

Gets a vector of pointers to the particles that may be potentially overlapped this wall.

◆ GetSTLModel()

STLModel Wall::GetSTLModel ( int num_nodes = 200)

Gets the STL model for the wall object.

Parameters
num_nodesThe number of nodes to be used in the model.
Returns
The STL model for the wall object.

◆ GetSTLModelInternal()

STLModel * Wall::GetSTLModelInternal ( )

Gets the STL model for the wall object.

Parameters
num_facetThe number of facets to be used in the model.
Returns
The STL model for the wall object.

◆ GetVelocity()

Vec3d Wall::GetVelocity ( Vec3d const & cnt_pos)

Gets the velocity of a point within the wall.

Parameters
cnt_posThe position of the point within the wall.
Returns
The velocity of the point within the wall.

◆ Init()

void Wall::Init ( )

Initializes the wall object with default values.

This method sets all member variables to their default values.

◆ LinkToCell()

int Wall::LinkToCell ( Cell *const cell)

Create a link between this wall and the given cell and return the look up id.

Parameters
cellA pointer to the cell to which a link is being created.
Returns
The look up id.

◆ LinkToParticle()

NeighPofW * Wall::LinkToParticle ( Particle *const p)

Create a link between this wall and the given particle and return the look up id.

Parameters
pA pointer to the particle to which a link is being created.
Returns
A pointer to the newly created neighbor tuple belonging to this particle.

◆ Print()

void Wall::Print ( )

Prints the properties and state of the wall object to the console.

◆ RemoveContactRefPW()

void Wall::RemoveContactRefPW ( int lookup_id)
protected

Reomve a p-w contact by look-up id.

◆ RemoveLinkedCell()

void Wall::RemoveLinkedCell ( int lookup_id)
protected

Reomve a linked cell by look-up id.

◆ RemoveLinkedParticle()

void Wall::RemoveLinkedParticle ( int lookup_id)
protected

Reomve a linked neighbor by look-up id.

◆ SaveAsVTK()

void Wall::SaveAsVTK ( std::string const & filename)

Saves the wall object as a VTK file.

Parameters
filenameThe name

of the file to be saved.

◆ SetDynamicProperty()

void Wall::SetDynamicProperty ( std::string const & key,
double value )

Sets a dynamic property for the wall.

Parameters
keyThe name of the property.
valueThe value of the property.

◆ SetPosition()

void Wall::SetPosition ( double pos_x,
double pos_y,
double pos_z )

Sets the position of the wall.

Parameters
pos_xThe x-coordinate of the position.
pos_yThe y-coordinate of the position.
pos_zThe z-coordinate of the position.
Examples
00_gen_dataset_trimesh_plane.cpp, 01_test_dataset_trimesh_plane.cpp, 06_test_ann_vs_geom_trimesh_plane.cpp, 20_gen_dataset_ellipsoid_plane.cpp, 21_test_dataset_ellipsoid_plane.cpp, and 26_test_ann_vs_geom_ellipsoid_plane.cpp.

◆ SetQuaternion()

void Wall::SetQuaternion ( double q_0,
double q_1,
double q_2,
double q_3 )

Sets the orientation of the wall using a quaternion.

Parameters
q_0The scalar component of the quaternion.
q_1The x-coordinate of the vector component of the quaternion.
q_2The y-coordinate of the vector component of the quaternion.
q_3The z-coordinate of the vector component of the quaternion.
Examples
00_gen_dataset_trimesh_plane.cpp, 01_test_dataset_trimesh_plane.cpp, 06_test_ann_vs_geom_trimesh_plane.cpp, 20_gen_dataset_ellipsoid_plane.cpp, 21_test_dataset_ellipsoid_plane.cpp, and 26_test_ann_vs_geom_ellipsoid_plane.cpp.

◆ SetRodrigues()

void Wall::SetRodrigues ( double angle,
double axis_x,
double axis_y,
double axis_z )

Sets the orientation of the wall using Rodrigues' formula.

Parameters
angleThe rotation angle in radians.
axis_xThe x-coordinate of the rotation axis.
axis_yThe y-coordinate of the rotation axis.
axis_zThe z-coordinate of the rotation axis.
Examples
00_nut_in_bolt.cpp, and 92_nut_in_bolt.cpp.

◆ SetShape()

void Wall::SetShape ( Shape *const shape)

Sets the shape of the wall.

Parameters
shapePointer to the shape of the wall.
Examples
blade_mixing_main.cpp.

◆ SetSpin()

void Wall::SetSpin ( double spin_x,
double spin_y,
double spin_z )

Sets the rotational velocity of the wall.

Parameters
spin_xThe x-component of the rotational velocity.
spin_yThe y-component of the rotational velocity.
spin_zThe z-component of the rotational velocity.

◆ SetVelocity()

void Wall::SetVelocity ( double v_x,
double v_y,
double v_z )

Sets the translational velocity of the wall.

Parameters
v_xThe x-component of the velocity.
v_yThe y-component of the velocity.
v_zThe z-component of the velocity.

◆ SetVelocitySpin()

void Wall::SetVelocitySpin ( double spin_x,
double spin_y,
double spin_z )

Sets the combined translational and rotational velocities of the wall.

This method allows the velocity to vary according to the radius using the cross product of spin and the position.

Parameters
spin_xThe x-component of the rotational velocity.
spin_yThe y-component of the rotational velocity.
spin_zThe z-component of the rotational velocity.
Examples
blade_mixing_main.cpp.

◆ UpdateBound()

void Wall::UpdateBound ( )

Update the bounding box of the wall, which is useful for collision detection. The bounding box will be updated regardless of the wall movement.

◆ UpdateBoundFast()

void Wall::UpdateBoundFast ( )

Updates the bounding box for the wall object. Wall has a skin and if the movement of particle has not exceed this skin, the bounding box will not be updated.

◆ UpdateContactForce()

void Wall::UpdateContactForce ( )

Updates the contact forces for the wall object.

This method updates the contact forces for the wall object based on its current state.

◆ UpdateLinkedCells()

void Wall::UpdateLinkedCells ( CellManager *const cm)

Updates the linked cells for the wall object.

Parameters
cmPointer to the CellManager object used for the update.

◆ UpdateLinkedNeighs()

void Wall::UpdateLinkedNeighs ( Domain *const domain)

Updates the linked neighbor list for the wall object.

Parameters
domainPointer to the Domain object used for the update.

◆ UpdateMotion() [1/3]

void Wall::UpdateMotion ( const Vec3d & dpos,
const Vec4d & dquat )

Updates the motion of the wall object using a specified displacement position and quaternion.

Parameters
dposThe displacement position.
dquatThe new orientation quaternion.

◆ UpdateMotion() [2/3]

void Wall::UpdateMotion ( const Vec3d & v,
const Vec3d & s,
double timestep )

Updates the motion of the wall object using a specified velocity and spin over a specified time step.

Parameters
vThe translational velocity for the update.
sThe rotational velocity (spin) for the update.
timestepThe time step for the update.

◆ UpdateMotion() [3/3]

void Wall::UpdateMotion ( double timestep)

Updates the motion of the wall object over a specified time step.

Parameters
timestepThe time step for the update.

◆ UpdateSTLModel()

void Wall::UpdateSTLModel ( )

Updates the STL model for the wall object.

Friends And Related Symbol Documentation

◆ Cell

friend class Cell
friend

◆ DEMSolver

friend class DEMSolver
friend

◆ Domain

friend class Domain
friend

◆ MPIManager

friend class MPIManager
friend

◆ NeighPofW

friend class NeighPofW
friend

◆ NeighWofP

friend class NeighWofP
friend

The ID number of the wall.

◆ Particle

friend class Particle
friend

Member Data Documentation

◆ bound_disp

Vec3d netdem::Wall::bound_disp {0, 0, 0}

The position of the wall.

◆ bound_max

Vec3d netdem::Wall::bound_max

◆ bound_min

Vec3d netdem::Wall::bound_min

◆ contact_pw_ref_table

VecXT<NeighPofW> netdem::Wall::contact_pw_ref_table
protected

◆ dynamic_properties

MiniMap<std::string, double> netdem::Wall::dynamic_properties

Boolean flag for updating the linked list algorithm.

◆ enable_bound_aabb

bool netdem::Wall::enable_bound_aabb {true}

The minimum and maximum bounds of the wall, with a skin displacement for broad-phase contact detection.

◆ enable_rotation

bool netdem::Wall::enable_rotation {false}

◆ force

Vec3d netdem::Wall::force {0, 0, 0}

◆ id

int netdem::Wall::id {0}

The index of the wall in the wall list.

◆ id_in_list

int netdem::Wall::id_in_list {0}

The label or name of the wall.

◆ label

std::string netdem::Wall::label {"default"}

Pointer to the shape of the wall.

◆ linked_cell_list

VecXT<std::pair<Cell *, int> > netdem::Wall::linked_cell_list
protected

< A list of linked cells for the wall.

A list of linked particles for the wall.

◆ linked_particle_list

VecXT<NeighPofW> netdem::Wall::linked_particle_list
protected

A lookup table for contact history reference reconstruction.

◆ material_type

int netdem::Wall::material_type {0}

Boolean flags for enabling wall rotation and AABB bounds.

◆ moment

Vec3d netdem::Wall::moment {0, 0, 0}

Translational, rotational, and combined velocities of the wall.

◆ need_update_linked_list

bool netdem::Wall::need_update_linked_list {true}

◆ need_update_stl_model

bool netdem::Wall::need_update_stl_model {false}

◆ pos

Vec3d netdem::Wall::pos {0, 0, 0}

The quaternion representing the orientation of the wall.

Examples
blade_mixing_main.cpp.

◆ quaternion

Vec4d netdem::Wall::quaternion {1, 0, 0, 0}

Forces and moments in the global coordinate system.

◆ shape

Shape* netdem::Wall::shape

The material type of the wall.

◆ spin

Vec3d netdem::Wall::spin {0, 0, 0}

◆ stl_model

STLModel netdem::Wall::stl_model
protected

< The STL model used for intersection-based contact detection and resolution.

◆ vel

Vec3d netdem::Wall::vel {0, 0, 0}

◆ vel_spin

Vec3d netdem::Wall::vel_spin {0, 0, 0}

Customized properties for the wall.


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