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

A spherical surface (3 dimensions) More...

#include <sdf_shape_3D.h>

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

Public Member Functions

 SDFSphere (const double radius, const coord_3d &center)
 SDF for a sphere. More...
 
double sdf (const coord_3d &pt) const
 Computes the normal distance. More...
 
coord_3d grad_sdf (const coord_3d &pt) const
 Computes the gradient of the SDF. More...
 
- 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

const double radius
 Radius of sphere. More...
 
const coord_3d center
 Center of sphere. More...
 

Detailed Description

A spherical surface (3 dimensions)

Constructor & Destructor Documentation

madness::SDFSphere::SDFSphere ( const double  radius,
const coord_3d center 
)
inline

SDF for a sphere.

Parameters
radiusThe radius of the sphere
centerThe center of the sphere

Member Function Documentation

coord_3d madness::SDFSphere::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::g, and sqrt().

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

Computes the normal distance.

This SDF is exact, and easy to show.

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

References radius, and sqrt().

Member Data Documentation

const coord_3d madness::SDFSphere::center
protected

Center of sphere.

const double madness::SDFSphere::radius
protected

Radius of sphere.

Referenced by sdf().


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