MADNESS  version 0.9
Public Member Functions | Protected Attributes | List of all members
madness::SDFCylinder Class Reference

A cylinder (3 dimensions) More...

#include <sdf_shape_3D.h>

Inheritance diagram for madness::SDFCylinder:
Inheritance graph
[legend]
Collaboration diagram for madness::SDFCylinder:
Collaboration graph
[legend]

Public Member Functions

 SDFCylinder (const double radius, const double length, const coord_3d &axpt, const coord_3d &axis)
 Constructor for cylinder. More...
 
double sdf (const coord_3d &pt) const
 Computes the normal distance. More...
 
coord_3d grad_sdf (const coord_3d &pt) const
 
- Public Member Functions inherited from madness::SignedDFInterface< 3 >
virtual double sdf (const Vector< double, NDIM > &x) const =0
 Returns the signed distance from the surface,. More...
 
virtual Vector< double, NDIMgrad_sdf (const Vector< double, NDIM > &x) const =0
 Returns the gradient of the signed distance from the surface (i.e., dsdf(x)/dx[i] ) More...
 
virtual ~SignedDFInterface ()
 

Protected Attributes

double radius
 the radius of the cylinder More...
 
double a
 half the length of the cylinder More...
 
coord_3d center
 the central axial point of the cylinder (distance a from both ends) More...
 
coord_3d axis
 the axial direction of the cylinder More...
 

Detailed Description

A cylinder (3 dimensions)

Constructor & Destructor Documentation

madness::SDFCylinder::SDFCylinder ( const double  radius,
const double  length,
const coord_3d axpt,
const coord_3d axis 
)
inline

Constructor for cylinder.

Parameters
radiusThe radius of the cylinder
lengthThe length of the cylinder
axptThe central axial point of the cylinder (equidistant from both ends)
axisThe axial direction of the cylinder

Member Function Documentation

coord_3d madness::SDFCylinder::grad_sdf ( const coord_3d pt) const
inline

Computes the gradient of the SDF.

Parameters
ptPoint at which to compute the gradient
Returns
the gradient

References MADNESS_EXCEPTION.

double madness::SDFCylinder::sdf ( const coord_3d pt) const
inline

Computes the normal distance.

This SDF naively uses contours, and should be improved before serious usage.

Parameters
ptPoint at which to compute the distance from the surface
Returns
The signed distance from the surface

References mpfr::fabs(), max, and sqrt().

Member Data Documentation

double madness::SDFCylinder::a
protected

half the length of the cylinder

coord_3d madness::SDFCylinder::axis
protected

the axial direction of the cylinder

coord_3d madness::SDFCylinder::center
protected

the central axial point of the cylinder (distance a from both ends)

double madness::SDFCylinder::radius
protected

the radius of the cylinder


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