51#ifndef MADNESS_MRA_SDF_SHAPE_2D_H__INCLUDED
52#define MADNESS_MRA_SDF_SHAPE_2D_H__INCLUDED
85 for(i = 0; i < 2; ++i) {
98 double x = pt[0] -
center[0];
99 double y = pt[1] -
center[1];
100 double r = sqrt(x*x + y*y);
A circle (2 dimensions)
Definition sdf_shape_2D.h:59
const double radius
Radius of circle.
Definition sdf_shape_2D.h:61
coord_2d grad_sdf(const coord_2d &pt) const
Computes the gradient of the SDF.
Definition sdf_shape_2D.h:97
SDFCircle(const double radius, const coord_2d ¢er)
SDF for a sphere.
Definition sdf_shape_2D.h:69
const coord_2d center
Center of circle.
Definition sdf_shape_2D.h:62
double sdf(const coord_2d &pt) const
Computes the normal distance.
Definition sdf_shape_2D.h:80
A rectangle (2 dimensions)
Definition sdf_shape_2D.h:119
const coord_2d center
the center
Definition sdf_shape_2D.h:122
const coord_2d lengths
Half the length of each side.
Definition sdf_shape_2D.h:121
coord_2d grad_sdf(const coord_2d &pt) const
Definition sdf_shape_2D.h:152
double sdf(const coord_2d &pt) const
Computes the normal distance.
Definition sdf_shape_2D.h:137
SDFRectangle(const coord_2d &length, const coord_2d ¢er)
Constructor for rectangle.
Definition sdf_shape_2D.h:129
The interface for a signed distance function (sdf).
Definition sdf_domainmask.h:74
A simple, fixed dimension vector.
Definition vector.h:64
static const double length
Definition hedft.cc:48
#define max(a, b)
Definition lda.h:51
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition madness_exception.h:119
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
NDIM const Function< R, NDIM > & g
Definition mra.h:2416
static Function< T, NDIM > diff(const Function< T, NDIM > &f, int axis)
Definition navstokes_cosines.cc:119
Defines abstract interfaces and concrete classes signed distance functions and domain masks.