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) {
86 temp = pt[i] - center[i];
98 double x = pt[0] - center[0];
99 double y = pt[1] - center[1];
100 double r =
sqrt(x*x + y*y);
130 : lengths(length*0.5), center(center)
140 max =
fabs(pt[0] - center[0]) - lengths[0];
141 diff =
fabs(pt[1] - center[1]) - lengths[1];
159 #endif // MADNESS_MRA_SDF_SHAPE_2D_H__INCLUDED
coord_2d grad_sdf(const coord_2d &pt) const
Computes the gradient of the SDF.
Definition: sdf_shape_2D.h:97
double sdf(const coord_2d &pt) const
Computes the normal distance.
Definition: sdf_shape_2D.h:137
NDIM const Function< R, NDIM > & g
Definition: mra.h:2179
SDFCircle(const double radius, const coord_2d ¢er)
SDF for a sphere.
Definition: sdf_shape_2D.h:69
A simple, fixed dimension Coordinate.
Definition: array.h:99
const double radius
Radius of circle.
Definition: sdf_shape_2D.h:61
const coord_2d lengths
Half the length of each side.
Definition: sdf_shape_2D.h:121
A circle (2 dimensions)
Definition: sdf_shape_2D.h:59
Defines abstract interfaces and concrete classes signed distance functions and domain masks...
SDFRectangle(const coord_2d &length, const coord_2d ¢er)
Constructor for rectangle.
Definition: sdf_shape_2D.h:129
coord_2d grad_sdf(const coord_2d &pt) const
Definition: sdf_shape_2D.h:152
const coord_2d center
Center of circle.
Definition: sdf_shape_2D.h:62
The interface for a signed distance function (sdf).
Definition: sdf_domainmask.h:74
#define max(a, b)
Definition: lda.h:53
double sdf(const coord_2d &pt) const
Computes the normal distance.
Definition: sdf_shape_2D.h:80
const coord_2d center
the center
Definition: sdf_shape_2D.h:122
tensorT sqrt(const tensorT &s, double tol=1e-8)
Computes matrix square root (not used any more?)
Definition: DFcode/moldft.cc:446
#define MADNESS_EXCEPTION(msg, value)
Definition: worldexc.h:88
A rectangle (2 dimensions)
Definition: sdf_shape_2D.h:119
const mpreal fabs(const mpreal &v, mp_rnd_t rnd_mode)
Definition: mpreal.h:2187
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45