MADNESS 0.10.1
madness::CompositeFactory< T, NDIM, MDIM > Class Template Reference

Factory for facile setup of a CompositeFunctorInterface and its FuncImpl. More...

#include <function_factory.h>

Inheritance diagram for madness::CompositeFactory< T, NDIM, MDIM >:
Collaboration diagram for madness::CompositeFactory< T, NDIM, MDIM >:

Public Types

typedef std::shared_ptr< FunctionImpl< T, NDIM > > implT_ptr_hidim
typedef std::shared_ptr< FunctionImpl< T, MDIM > > implT_ptr_lodim

Public Member Functions

 CompositeFactory (World &world)
CompositeFactory & g12 (const Function< T, NDIM > &f)
 g12 is the interaction potential (6D)
std::shared_ptr< FunctionFunctorInterface< T, NDIM > > get_functor () const
 return the functor; override this if the functor needs deferred construction
CompositeFactory & ket (const Function< T, NDIM > &f)
 provide directly the NDIM (6D) pair function ket
CompositeFactory & ket (const std::vector< Function< T, NDIM > > &vf)
CompositeFactory & particle1 (const Function< T, MDIM > &f)
CompositeFactory & particle1 (const std::vector< Function< T, MDIM > > &vf)
CompositeFactory & particle2 (const Function< T, MDIM > &f)
CompositeFactory & particle2 (const std::vector< Function< T, MDIM > > &vf)
CompositeFactory & self ()
CompositeFactory & V_for_particle1 (const Function< T, MDIM > &f)
 a one-particle potential, acting on particle 1
CompositeFactory & V_for_particle2 (const Function< T, MDIM > &f)
 a one-particle potential, acting on particle 2
Public Member Functions inherited from madness::FunctionFactory< T, NDIM >
 FunctionFactory (World &world)
virtual ~FunctionFactory ()
FunctionFactory & autorefine ()
FunctionFactory & compressed (bool value=true)
FunctionFactory & empty ()
FunctionFactory & f (T(*f)(const coordT &))
FunctionFactory & fence (bool fence=true)
template<typename opT>
std::enable_if< notstd::is_base_of< FunctionFunctorInterface< T, NDIM >, opT >::value, FunctionFactory & >::type functor (const opT &op)
 pass in a functor that is not derived from FunctionFunctorInterface
template<typename opT>
std::enable_if< std::is_base_of< FunctionFunctorInterface< T, NDIM >, opT >::value, FunctionFactory & >::type functor (const opT &op)
 pass in a functor that is derived from FunctionFunctorInterface
FunctionFactory & functor (const std::shared_ptr< FunctionFunctorInterface< T, NDIM > > &f)
int get_k () const
double get_thresh () const
World & get_world () const
FunctionFactory & initial_level (int initial_level)
virtual FunctionFactory & is_on_demand ()
virtual FunctionFactory & k (int k)
FunctionFactory & max_refine_level (int max_refine_level)
FunctionFactory & no_functor ()
FunctionFactory & noautorefine ()
FunctionFactory & nofence ()
FunctionFactory & norefine (bool norefine=true)
FunctionFactory & notruncate_on_project ()
FunctionFactory & pmap (const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &pmap)
FunctionFactory & refine (bool refine=true)
FunctionFactory & self ()
 implement this in all derived classes for correct chaining
FunctionFactory & special_level (int special_level)
FunctionFactory & special_points (const std::vector< Vector< double, NDIM > > &special_points)
virtual FunctionFactory & thresh (double thresh)
FunctionFactory & treestate (const TreeState state)
FunctionFactory & truncate_mode (int truncate_mode)
FunctionFactory & truncate_on_project ()

Public Attributes

std::shared_ptr< FunctionImpl< T, NDIM > > _g12
 supposedly a interaction potential
std::vector< implT_ptr_hidim > _ket
std::vector< std::shared_ptr< FunctionImpl< T, MDIM > > > _particle1
 supposedly particle 1
std::vector< std::shared_ptr< FunctionImpl< T, MDIM > > > _particle2
 supposedly particle 2
std::shared_ptr< FunctionImpl< T, MDIM > > _v1
 supposedly a potential for particle 1
std::shared_ptr< FunctionImpl< T, MDIM > > _v2
 supposedly a potential for particle 2

Private Attributes

std::shared_ptr< CompositeFunctorInterface< T, NDIM, MDIM > > _func

Friends

class CompositeFunctorInterface< T, NDIM, MDIM >

Additional Inherited Members

Protected Attributes inherited from madness::FunctionFactory< T, NDIM >
bool _autorefine
bool _empty
bool _fence
int _initial_level = FunctionDefaults<NDIM>::get_initial_level()
int _k
int _max_refine_level
std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > _pmap
bool _refine
int _special_level = FunctionDefaults<NDIM>::get_special_level()
std::vector< Vector< double, NDIM > > _special_points
double _thresh
TreeState _tree_state
int _truncate_mode
bool _truncate_on_project
World & _world

Detailed Description

template<typename T, std::size_t NDIM, std::size_t MDIM>
class madness::CompositeFactory< T, NDIM, MDIM >

Factory for facile setup of a CompositeFunctorInterface and its FuncImpl.

for the concept of a Factory see base class FunctionFactory here we need to provide two different dimensions, since the main purpose of this is to set up a pair function (6D), consisting of orbitals (3D), and also one- and two-electron potentials

This Factory constructs a FuncImpl, and also the functor to it.

NOTE: pass in only copies of functions, since use in here will corrupt the tree structure and functions will not pass the VERIFY test after this.

Member Typedef Documentation

◆ implT_ptr_hidim

template<typename T, std::size_t NDIM, std::size_t MDIM>
typedef std::shared_ptr<FunctionImpl<T, NDIM> > madness::CompositeFactory< T, NDIM, MDIM >::implT_ptr_hidim

◆ implT_ptr_lodim

template<typename T, std::size_t NDIM, std::size_t MDIM>
typedef std::shared_ptr<FunctionImpl<T, MDIM> > madness::CompositeFactory< T, NDIM, MDIM >::implT_ptr_lodim

Constructor & Destructor Documentation

◆ CompositeFactory()

template<typename T, std::size_t NDIM, std::size_t MDIM>
madness::CompositeFactory< T, NDIM, MDIM >::CompositeFactory ( World & world)
inline

Member Function Documentation

◆ g12()

◆ get_functor()

template<typename T, std::size_t NDIM, std::size_t MDIM>
std::shared_ptr< FunctionFunctorInterface< T, NDIM > > madness::CompositeFactory< T, NDIM, MDIM >::get_functor ( ) const
inlinevirtual

return the functor; override this if the functor needs deferred construction

Reimplemented from madness::FunctionFactory< T, NDIM >.

References _g12, _ket, _particle1, _particle2, _v1, and _v2.

◆ ket() [1/2]

◆ ket() [2/2]

template<typename T, std::size_t NDIM, std::size_t MDIM>
CompositeFactory & madness::CompositeFactory< T, NDIM, MDIM >::ket ( const std::vector< Function< T, NDIM > > & vf)
inline

◆ particle1() [1/2]

◆ particle1() [2/2]

template<typename T, std::size_t NDIM, std::size_t MDIM>
CompositeFactory & madness::CompositeFactory< T, NDIM, MDIM >::particle1 ( const std::vector< Function< T, MDIM > > & vf)
inline

provide particle 1, used with particle 2 to set up a pair function by direct product

References _particle1, madness::FunctionFactory< T, NDIM >::f(), and self().

◆ particle2() [1/2]

◆ particle2() [2/2]

template<typename T, std::size_t NDIM, std::size_t MDIM>
CompositeFactory & madness::CompositeFactory< T, NDIM, MDIM >::particle2 ( const std::vector< Function< T, MDIM > > & vf)
inline

provide particle 2, used with particle 1 to set up a pair function by direct product

References _particle2, madness::FunctionFactory< T, NDIM >::f(), and self().

◆ self()

template<typename T, std::size_t NDIM, std::size_t MDIM>
CompositeFactory & madness::CompositeFactory< T, NDIM, MDIM >::self ( )
inline

◆ V_for_particle1()

◆ V_for_particle2()

◆ CompositeFunctorInterface< T, NDIM, MDIM >

template<typename T, std::size_t NDIM, std::size_t MDIM>
friend class CompositeFunctorInterface< T, NDIM, MDIM >
friend

Member Data Documentation

◆ _func

template<typename T, std::size_t NDIM, std::size_t MDIM>
std::shared_ptr<CompositeFunctorInterface<T, NDIM, MDIM> > madness::CompositeFactory< T, NDIM, MDIM >::_func
private

Referenced by CompositeFactory().

◆ _g12

template<typename T, std::size_t NDIM, std::size_t MDIM>
std::shared_ptr<FunctionImpl<T, NDIM> > madness::CompositeFactory< T, NDIM, MDIM >::_g12

supposedly a interaction potential

Referenced by CompositeFactory(), g12(), and get_functor().

◆ _ket

template<typename T, std::size_t NDIM, std::size_t MDIM>
std::vector<implT_ptr_hidim> madness::CompositeFactory< T, NDIM, MDIM >::_ket

◆ _particle1

template<typename T, std::size_t NDIM, std::size_t MDIM>
std::vector<std::shared_ptr<FunctionImpl<T, MDIM> > > madness::CompositeFactory< T, NDIM, MDIM >::_particle1

supposedly particle 1

Referenced by CompositeFactory(), get_functor(), particle1(), and particle1().

◆ _particle2

template<typename T, std::size_t NDIM, std::size_t MDIM>
std::vector<std::shared_ptr<FunctionImpl<T, MDIM> > > madness::CompositeFactory< T, NDIM, MDIM >::_particle2

supposedly particle 2

Referenced by CompositeFactory(), get_functor(), particle2(), and particle2().

◆ _v1

template<typename T, std::size_t NDIM, std::size_t MDIM>
std::shared_ptr<FunctionImpl<T, MDIM> > madness::CompositeFactory< T, NDIM, MDIM >::_v1

supposedly a potential for particle 1

Referenced by CompositeFactory(), get_functor(), and V_for_particle1().

◆ _v2

template<typename T, std::size_t NDIM, std::size_t MDIM>
std::shared_ptr<FunctionImpl<T, MDIM> > madness::CompositeFactory< T, NDIM, MDIM >::_v2

supposedly a potential for particle 2

Referenced by CompositeFactory(), get_functor(), and V_for_particle2().


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