ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
Shapes::Cylinder Class Reference

#include <Cylinder.hpp>

+ Inheritance diagram for Shapes::Cylinder:
+ Collaboration diagram for Shapes::Cylinder:

Public Member Functions

void precalc ()
 Calculate derived parameters.
 
std::pair< double, double > dist_half_pore (double r, double z) const
 
 Cylinder ()
 
double radius () const
 
void set_radius (double const &radius)
 
double length () const
 
void set_length (double const &length)
 
Utils::Vector3d const & axis () const
 
void set_axis (Utils::Vector3d const &axis)
 
Utils::Vector3dcenter ()
 
bool & open ()
 
double & direction ()
 
void calculate_dist (const Utils::Vector3d &pos, double &dist, Utils::Vector3d &vec) const override
 
- Public Member Functions inherited from Shapes::Shape
virtual bool is_inside (Utils::Vector3d const &pos) const
 Check whether the given point is inside the shape or not.
 
std::vector< int > rasterize (Utils::Vector3i const &grid_size, double grid_spacing, double grid_offset) const
 Rasterize a shape on a regular grid.
 
virtual ~Shape ()=default
 

Public Attributes

Utils::Vector3d m_center
 center of the cylinder.
 
Utils::Vector3d m_axis
 Axis of the cylinder.
 
double m_rad
 cylinder radius.
 
double m_length
 cylinder length.
 
bool m_open
 whether to ignore bottom and top cap of cylinder
 
double m_direction
 direction -1: inside, +1 outside
 
double m_half_length
 Center of smoothing circle.
 
Utils::Vector3d e_z
 Unit vector in z direction.
 
Utils::Vector3d e_r_axis
 Alternative e_r for corner case.
 

Detailed Description

Definition at line 32 of file shapes/include/shapes/Cylinder.hpp.

Constructor & Destructor Documentation

◆ Cylinder()

Shapes::Cylinder::Cylinder ( )
inline

Definition at line 77 of file shapes/include/shapes/Cylinder.hpp.

Member Function Documentation

◆ axis()

Utils::Vector3d const & Shapes::Cylinder::axis ( ) const
inline

Definition at line 95 of file shapes/include/shapes/Cylinder.hpp.

References m_axis.

Referenced by set_axis().

◆ calculate_dist()

void Shapes::Cylinder::calculate_dist ( const Utils::Vector3d pos,
double &  dist,
Utils::Vector3d vec 
) const
overridevirtual

◆ center()

Utils::Vector3d & Shapes::Cylinder::center ( )
inline

Definition at line 101 of file shapes/include/shapes/Cylinder.hpp.

References m_center.

◆ direction()

double & Shapes::Cylinder::direction ( )
inline

Definition at line 103 of file shapes/include/shapes/Cylinder.hpp.

References m_direction.

◆ dist_half_pore()

std::pair< double, double > Shapes::Cylinder::dist_half_pore ( double  r,
double  z 
) const

Definition at line 32 of file Cylinder.cpp.

References m_half_length, m_open, and m_rad.

Referenced by calculate_dist().

◆ length()

double Shapes::Cylinder::length ( ) const
inline

Definition at line 89 of file shapes/include/shapes/Cylinder.hpp.

References m_length.

Referenced by set_length().

◆ open()

bool & Shapes::Cylinder::open ( )
inline

Definition at line 102 of file shapes/include/shapes/Cylinder.hpp.

References m_open.

◆ precalc()

void Shapes::Cylinder::precalc ( )
inline

Calculate derived parameters.

Definition at line 56 of file shapes/include/shapes/Cylinder.hpp.

References e_r_axis, e_z, m_axis, m_half_length, m_length, Utils::Vector< T, N >::norm(), and Utils::Vector< T, N >::normalize().

Referenced by set_axis(), set_length(), and set_radius().

◆ radius()

double Shapes::Cylinder::radius ( ) const
inline

Definition at line 83 of file shapes/include/shapes/Cylinder.hpp.

References m_rad.

Referenced by set_radius().

◆ set_axis()

void Shapes::Cylinder::set_axis ( Utils::Vector3d const &  axis)
inline

Definition at line 96 of file shapes/include/shapes/Cylinder.hpp.

References axis(), m_axis, and precalc().

◆ set_length()

void Shapes::Cylinder::set_length ( double const &  length)
inline

Definition at line 90 of file shapes/include/shapes/Cylinder.hpp.

References length(), m_length, and precalc().

◆ set_radius()

void Shapes::Cylinder::set_radius ( double const &  radius)
inline

Definition at line 84 of file shapes/include/shapes/Cylinder.hpp.

References m_rad, precalc(), and radius().

Member Data Documentation

◆ e_r_axis

Utils::Vector3d Shapes::Cylinder::e_r_axis

Alternative e_r for corner case.

Definition at line 53 of file shapes/include/shapes/Cylinder.hpp.

Referenced by calculate_dist(), and precalc().

◆ e_z

Utils::Vector3d Shapes::Cylinder::e_z

Unit vector in z direction.

Definition at line 50 of file shapes/include/shapes/Cylinder.hpp.

Referenced by calculate_dist(), and precalc().

◆ m_axis

Utils::Vector3d Shapes::Cylinder::m_axis

Axis of the cylinder.

Definition at line 37 of file shapes/include/shapes/Cylinder.hpp.

Referenced by axis(), precalc(), and set_axis().

◆ m_center

Utils::Vector3d Shapes::Cylinder::m_center

center of the cylinder.

Definition at line 35 of file shapes/include/shapes/Cylinder.hpp.

Referenced by calculate_dist(), and center().

◆ m_direction

double Shapes::Cylinder::m_direction

direction -1: inside, +1 outside

Definition at line 45 of file shapes/include/shapes/Cylinder.hpp.

Referenced by calculate_dist(), and direction().

◆ m_half_length

double Shapes::Cylinder::m_half_length

Center of smoothing circle.

Definition at line 48 of file shapes/include/shapes/Cylinder.hpp.

Referenced by calculate_dist(), dist_half_pore(), and precalc().

◆ m_length

double Shapes::Cylinder::m_length

cylinder length.

Definition at line 41 of file shapes/include/shapes/Cylinder.hpp.

Referenced by length(), precalc(), and set_length().

◆ m_open

bool Shapes::Cylinder::m_open

whether to ignore bottom and top cap of cylinder

Definition at line 43 of file shapes/include/shapes/Cylinder.hpp.

Referenced by dist_half_pore(), and open().

◆ m_rad

double Shapes::Cylinder::m_rad

cylinder radius.

Definition at line 39 of file shapes/include/shapes/Cylinder.hpp.

Referenced by calculate_dist(), dist_half_pore(), radius(), and set_radius().


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