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

#include <Torus.hpp>

+ Inheritance diagram for Shapes::Torus:
+ Collaboration diagram for Shapes::Torus:

Public Member Functions

void precalc ()
 Calculate derived parameters.
 
 Torus ()
 
double radius () const
 
void set_radius (double const &radius)
 
double tube_radius () const
 
void set_tube_radius (double const &tube_rad)
 
Utils::Vector3d const & normal () const
 
void set_normal (Utils::Vector3d const &normal)
 
Utils::Vector3dcenter ()
 
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 shape.
 
Utils::Vector3d m_normal
 Normal axis of the shape.
 
double m_rad
 radius.
 
double m_tube_rad
 tube radius.
 
double m_direction
 direction -1: inside, +1 outside
 
Utils::Vector3d e_z
 Unit vector in z direction.
 

Detailed Description

Definition at line 26 of file shapes/include/shapes/Torus.hpp.

Constructor & Destructor Documentation

◆ Torus()

Shapes::Torus::Torus ( )
inline

Definition at line 46 of file shapes/include/shapes/Torus.hpp.

Member Function Documentation

◆ calculate_dist()

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

Implements Shapes::Shape.

Definition at line 26 of file Torus.cpp.

References e_z, m_center, m_direction, m_rad, m_tube_rad, Utils::Vector< T, N >::norm(), and Utils::sqr().

◆ center()

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

Definition at line 70 of file shapes/include/shapes/Torus.hpp.

References m_center.

◆ direction()

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

Definition at line 71 of file shapes/include/shapes/Torus.hpp.

References m_direction.

◆ normal()

Utils::Vector3d const & Shapes::Torus::normal ( ) const
inline

Definition at line 64 of file shapes/include/shapes/Torus.hpp.

References m_normal.

Referenced by set_normal().

◆ precalc()

void Shapes::Torus::precalc ( )
inline

Calculate derived parameters.

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

References e_z, m_normal, and Utils::Vector< T, N >::norm().

Referenced by set_normal(), set_radius(), and set_tube_radius().

◆ radius()

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

Definition at line 52 of file shapes/include/shapes/Torus.hpp.

References m_rad.

Referenced by set_radius().

◆ set_normal()

void Shapes::Torus::set_normal ( Utils::Vector3d const &  normal)
inline

Definition at line 65 of file shapes/include/shapes/Torus.hpp.

References m_normal, normal(), and precalc().

◆ set_radius()

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

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

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

◆ set_tube_radius()

void Shapes::Torus::set_tube_radius ( double const &  tube_rad)
inline

Definition at line 59 of file shapes/include/shapes/Torus.hpp.

References m_tube_rad, and precalc().

◆ tube_radius()

double Shapes::Torus::tube_radius ( ) const
inline

Definition at line 58 of file shapes/include/shapes/Torus.hpp.

References m_tube_rad.

Member Data Documentation

◆ e_z

Utils::Vector3d Shapes::Torus::e_z

Unit vector in z direction.

Definition at line 40 of file shapes/include/shapes/Torus.hpp.

Referenced by calculate_dist(), and precalc().

◆ m_center

Utils::Vector3d Shapes::Torus::m_center

center of the shape.

Definition at line 29 of file shapes/include/shapes/Torus.hpp.

Referenced by calculate_dist(), and center().

◆ m_direction

double Shapes::Torus::m_direction

direction -1: inside, +1 outside

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

Referenced by calculate_dist(), and direction().

◆ m_normal

Utils::Vector3d Shapes::Torus::m_normal

Normal axis of the shape.

Definition at line 31 of file shapes/include/shapes/Torus.hpp.

Referenced by normal(), precalc(), and set_normal().

◆ m_rad

double Shapes::Torus::m_rad

radius.

Definition at line 33 of file shapes/include/shapes/Torus.hpp.

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

◆ m_tube_rad

double Shapes::Torus::m_tube_rad

tube radius.

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

Referenced by calculate_dist(), set_tube_radius(), and tube_radius().


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