MADNESS 0.10.1
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
madness::DomainMaskSDFFunctor< NDIM > Class Template Reference

Framework for combining a signed distance function (sdf) with a domain mask to produce MADNESS functions. More...

#include <sdf_domainmask.h>

Inheritance diagram for madness::DomainMaskSDFFunctor< NDIM >:
Inheritance graph
[legend]
Collaboration diagram for madness::DomainMaskSDFFunctor< NDIM >:
Collaboration graph
[legend]

Public Member Functions

 DomainMaskSDFFunctor (std::shared_ptr< DomainMaskInterface > mask, std::shared_ptr< SignedDFInterface< NDIM > > sdf)
 Constructor for mask/sdf functor.
 
 DomainMaskSDFFunctor (std::shared_ptr< DomainMaskInterface > mask, std::shared_ptr< SignedDFInterface< NDIM > > sdf, int _mswitch)
 Constructor for mask/sdf function specifying the desired function (mask, surface, etc.)
 
virtual ~DomainMaskSDFFunctor ()
 
double operator() (const Vector< double, NDIM > &x) const
 Uses the functor interface to make a MADNESS function.
 
void setMaskFunction (int _mswitch)
 Toggles which function from DomainMaskInterface to use when making the MADNESS function.
 
- Public Member Functions inherited from madness::FunctionFunctorInterface< double, NDIM >
 FunctionFunctorInterface ()
 
virtual ~FunctionFunctorInterface ()
 
virtual coeffT coeff (const keyT &) const
 
virtual void operator() (const Vector< double *, 1 > &xvals, double *fvals, int npts) const
 
virtual void operator() (const Vector< double *, 2 > &xvals, double *fvals, int npts) const
 
virtual void operator() (const Vector< double *, 3 > &xvals, double *fvals, int npts) const
 
virtual void operator() (const Vector< double *, 4 > &xvals, double *fvals, int npts) const
 
virtual void operator() (const Vector< double *, 5 > &xvals, double *fvals, int npts) const
 
virtual void operator() (const Vector< double *, 6 > &xvals, double *fvals, int npts) const
 
virtual bool provides_coeff () const
 does this functor directly provide sum coefficients? or only function values?
 
virtual bool screened (const Vector< double, NDIM > &c1, const Vector< double, NDIM > &c2) const
 Can we screen this function based on the bounding box information?
 
void set_length_scale (double lo)
 adapt the special level to resolve the smallest length scale
 
virtual Level special_level ()
 Override this change level refinement for special points (default is 6)
 
virtual std::vector< Vector< double, NDIM > > special_points () const
 Override this to return list of special points to be refined more deeply.
 
virtual bool supports_vectorized () const
 Does the interface support a vectorized operator()?
 
virtual coeffT values (const keyT &key, const Tensor< double > &tensor) const
 

Static Public Attributes

static const int DMASK = 3
 Use the dmask() function in mask.
 
static const int DSURFACE = 5
 Use the dsurface() function in mask.
 
static const int MASK = 1
 Use the mask() function in mask.
 
static const int MASK_COMPLEMENT = 2
 Get the complement of mask()
 
static const int SURFACE = 4
 Use the surface() function in mask.
 

Private Member Functions

 DomainMaskSDFFunctor ()
 Bury the default constructor.
 

Private Attributes

std::shared_ptr< DomainMaskInterfacemask
 The domain mask to use.
 
int mswitch
 Which masking function to use (mask, surface, etc.)
 
std::shared_ptr< SignedDFInterface< NDIM > > sdf
 The signed distance function.
 

Additional Inherited Members

- Public Types inherited from madness::FunctionFunctorInterface< double, NDIM >
typedef GenTensor< double > coeffT
 
typedef Key< NDIMkeyT
 
typedef double value_type
 
- Public Attributes inherited from madness::FunctionFunctorInterface< double, NDIM >
Level special_level_
 

Detailed Description

template<std::size_t NDIM>
class madness::DomainMaskSDFFunctor< NDIM >

Framework for combining a signed distance function (sdf) with a domain mask to produce MADNESS functions.

This interface provides functor functionality to produce MADNESS functions for

The functor defaults to the domain mask; however, member functions can toggle between the other options.

Constructor & Destructor Documentation

◆ DomainMaskSDFFunctor() [1/3]

template<std::size_t NDIM>
madness::DomainMaskSDFFunctor< NDIM >::DomainMaskSDFFunctor ( )
inlineprivate

Bury the default constructor.

◆ DomainMaskSDFFunctor() [2/3]

template<std::size_t NDIM>
madness::DomainMaskSDFFunctor< NDIM >::DomainMaskSDFFunctor ( std::shared_ptr< DomainMaskInterface mask,
std::shared_ptr< SignedDFInterface< NDIM > >  sdf 
)
inline

Constructor for mask/sdf functor.

Parameters
maskPointer to the domain mask
sdfPointer to the signed distance function

◆ DomainMaskSDFFunctor() [3/3]

template<std::size_t NDIM>
madness::DomainMaskSDFFunctor< NDIM >::DomainMaskSDFFunctor ( std::shared_ptr< DomainMaskInterface mask,
std::shared_ptr< SignedDFInterface< NDIM > >  sdf,
int  _mswitch 
)
inline

Constructor for mask/sdf function specifying the desired function (mask, surface, etc.)

Parameters
maskPointer to the domain mask
sdfPointer to the signed distance function
[in]_mswitchWhich function to use (MASK, DMASK, SURFACE, DSURFACE, or MASK_COMPLEMENT)

References madness::DomainMaskSDFFunctor< NDIM >::DMASK, madness::DomainMaskSDFFunctor< NDIM >::DSURFACE, madness::error(), madness::DomainMaskSDFFunctor< NDIM >::MASK, madness::DomainMaskSDFFunctor< NDIM >::MASK_COMPLEMENT, madness::DomainMaskSDFFunctor< NDIM >::mswitch, and madness::DomainMaskSDFFunctor< NDIM >::SURFACE.

◆ ~DomainMaskSDFFunctor()

template<std::size_t NDIM>
virtual madness::DomainMaskSDFFunctor< NDIM >::~DomainMaskSDFFunctor ( )
inlinevirtual

Member Function Documentation

◆ operator()()

template<std::size_t NDIM>
double madness::DomainMaskSDFFunctor< NDIM >::operator() ( const Vector< double, NDIM > &  x) const
inlinevirtual

Uses the functor interface to make a MADNESS function.

Parameters
xPoint to compute value
Returns
Value of the desired function

Implements madness::FunctionFunctorInterface< double, NDIM >.

References madness::error(), madness::DomainMaskSDFFunctor< NDIM >::mask, madness::DomainMaskSDFFunctor< NDIM >::mswitch, and madness::DomainMaskSDFFunctor< NDIM >::sdf.

◆ setMaskFunction()

template<std::size_t NDIM>
void madness::DomainMaskSDFFunctor< NDIM >::setMaskFunction ( int  _mswitch)
inline

Toggles which function from DomainMaskInterface to use when making the MADNESS function.

Parameters
_mswitchThe function to use (should be MASK, DMASK, SURFACE, DSURFACE, or MASK_COMPLEMENT)

References madness::DomainMaskSDFFunctor< NDIM >::DMASK, madness::DomainMaskSDFFunctor< NDIM >::DSURFACE, madness::error(), madness::DomainMaskSDFFunctor< NDIM >::MASK, madness::DomainMaskSDFFunctor< NDIM >::MASK_COMPLEMENT, madness::DomainMaskSDFFunctor< NDIM >::mswitch, and madness::DomainMaskSDFFunctor< NDIM >::SURFACE.

Referenced by main().

Member Data Documentation

◆ DMASK

template<std::size_t NDIM>
const int madness::DomainMaskSDFFunctor< NDIM >::DMASK = 3
static

◆ DSURFACE

template<std::size_t NDIM>
const int madness::DomainMaskSDFFunctor< NDIM >::DSURFACE = 5
static

◆ mask

template<std::size_t NDIM>
std::shared_ptr<DomainMaskInterface> madness::DomainMaskSDFFunctor< NDIM >::mask
private

The domain mask to use.

Referenced by madness::DomainMaskSDFFunctor< NDIM >::operator()().

◆ MASK

template<std::size_t NDIM>
const int madness::DomainMaskSDFFunctor< NDIM >::MASK = 1
static

◆ MASK_COMPLEMENT

template<std::size_t NDIM>
const int madness::DomainMaskSDFFunctor< NDIM >::MASK_COMPLEMENT = 2
static

◆ mswitch

template<std::size_t NDIM>
int madness::DomainMaskSDFFunctor< NDIM >::mswitch
private

◆ sdf

template<std::size_t NDIM>
std::shared_ptr<SignedDFInterface<NDIM> > madness::DomainMaskSDFFunctor< NDIM >::sdf
private

The signed distance function.

Referenced by madness::DomainMaskSDFFunctor< NDIM >::operator()().

◆ SURFACE

template<std::size_t NDIM>
const int madness::DomainMaskSDFFunctor< NDIM >::SURFACE = 4
static

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