MADNESS 0.10.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Private Types | Friends | List of all members
madness::DerivativeBase< T, NDIM > Class Template Referenceabstract

Tri-diagonal operator traversing tree primarily for derivative operator. More...

#include <derivative.h>

Inheritance diagram for madness::DerivativeBase< T, NDIM >:
Inheritance graph
[legend]
Collaboration diagram for madness::DerivativeBase< T, NDIM >:
Collaboration graph
[legend]

Classes

struct  submit_op
 Body of FunctionImpl::diff's submission loop, as a functor for taskq.for_each. More...
 

Public Types

typedef std::pair< keyT, coeffTargT
 
typedef GenTensor< T > coeffT
 holding the node's coeffs (possibly low rank)
 
typedef WorldContainer< Key< NDIM >, FunctionNode< T, NDIM > > dcT
 
typedef Function< T, NDIMfunctionT
 
typedef FunctionImpl< T, NDIMimplT
 
typedef Key< NDIMkeyT
 
typedef FunctionNode< T, NDIMnodeT
 
typedef Tensor< T > tensorT
 regular tensors, like rm, etc
 
- Public Types inherited from madness::WorldObject< DerivativeBase< T, NDIM > >
typedef WorldObject< DerivativeBase< T, NDIM > > objT
 

Public Member Functions

 DerivativeBase (World &world, std::size_t axis, int k, BoundaryConditions< NDIM > bc)
 
virtual ~DerivativeBase ()
 
void do_diff1 (const implT *f, implT *df, const keyT &key, const argT &left, const argT &center, const argT &right) const
 
virtual void do_diff2b (const implT *f, implT *df, const keyT &key, const argT &left, const argT &center, const argT &right) const =0
 
virtual void do_diff2i (const implT *f, implT *df, const keyT &key, const argT &left, const argT &center, const argT &right) const =0
 
Future< argTfind_neighbor (const implT *f, const Key< NDIM > &key, int step) const
 
void forward_do_diff1 (const implT *f, implT *df, const keyT &key, const argT &left, const argT &center, const argT &right) const
 
Key< NDIMneighbor (const keyT &key, int step) const
 
Function< T, NDIMoperator() (const functionT &f, bool fence=true) const
 Differentiate w.r.t. given coordinate (x=0, y=1, ...) with optional fence.
 
template<typename Archive >
void serialize (const Archive &ar) const
 
void stage_halo (const implT *f, bool fence=true) const
 Push f's remote same-level neighbor coefficients to the ranks that will need them.
 
void submit_diff_tasks (const implT *f, implT *df) const
 Parallel form of FunctionImpl::diff's submission loop; the caller owns the fence.
 
- Public Member Functions inherited from madness::WorldObject< DerivativeBase< T, NDIM > >
 WorldObject (const WorldObject &other)
 
 WorldObject (World &world)
 Constructor that associates an object (via the derived class) with a globally unique ID.
 
virtual ~WorldObject ()
 
WorldObjectoperator= (const WorldObject &)=delete
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8) const
 
detail::task_result_type< memfnT >::futureT send (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const a9T &a9) const
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const a9T &a9, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7,a8,a9).
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const a8T &a8, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7,a8).
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const a7T &a7, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7).
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const a6T &a6, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5,a6).
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const a5T &a5, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4,a5).
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const a4T &a4, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3,a4).
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const a3T &a3, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2,a3).
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const a2T &a2, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1,a2).
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const a1T &a1, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)(a1).
 
detail::task_result_type< memfnT >::futureT task (ProcessID dest, memfnT memfn, const TaskAttributes &attr=TaskAttributes()) const
 Sends task to derived class method returnT (this->*memfn)().
 
- Public Member Functions inherited from madness::WorldObjectBase
virtual ~WorldObjectBase ()
 
Worldget_world () const
 
Worldget_world_noexcept () const noexcept
 Get the world to which this object belongs, without risking a throw.
 
const uniqueidTid () const
 Returns the globally unique object ID.
 
bool world_is_alive () const noexcept
 Reports whether the world to which this object belongs still exists.
 

Static Public Member Functions

static bool enforce_bc (int bc_left, int bc_right, Level n, Translation &l)
 

Public Attributes

bool parallel_submit_ = false
 Spawn diff's per-node tasks from the task pool instead of the main thread.
 

Protected Attributes

const std::size_t axis
 Axis along which the operation is performed.
 
const BoundaryConditions< NDIMbc
 
const int k
 Number of wavelets of the function.
 
const std::vector< longvk
 (k,...) used to initialize Tensors
 
Worldworld
 

Private Types

typedef WorldObject< DerivativeBase< T, NDIM > > woT
 

Friends

class FunctionImpl< T, NDIM >
 

Additional Inherited Members

- Protected Member Functions inherited from madness::WorldObject< DerivativeBase< T, NDIM > >
void process_pending ()
 To be called from derived constructor to process pending messages.
 
- Protected Member Functions inherited from madness::WorldObjectBase
 WorldObjectBase (const WorldObjectBase &other)
 Copy constructor; produces an unregistered object.
 
 WorldObjectBase (World &w)
 Construct a new WorldObjectBase.
 
Worldget_world_unchecked () const noexcept
 Unchecked access to the memoized world reference.
 
template<typename DerivedT >
void register_self (DerivedT *this_ptr)
 Registers this object with its world, making it globally addressable.
 

Detailed Description

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

Tri-diagonal operator traversing tree primarily for derivative operator.

Member Typedef Documentation

◆ argT

template<typename T , std::size_t NDIM>
typedef std::pair<keyT,coeffT> madness::DerivativeBase< T, NDIM >::argT

◆ coeffT

template<typename T , std::size_t NDIM>
typedef GenTensor<T> madness::DerivativeBase< T, NDIM >::coeffT

holding the node's coeffs (possibly low rank)

◆ dcT

template<typename T , std::size_t NDIM>
typedef WorldContainer<Key<NDIM> , FunctionNode<T, NDIM> > madness::DerivativeBase< T, NDIM >::dcT

◆ functionT

template<typename T , std::size_t NDIM>
typedef Function<T,NDIM> madness::DerivativeBase< T, NDIM >::functionT

◆ implT

template<typename T , std::size_t NDIM>
typedef FunctionImpl<T,NDIM> madness::DerivativeBase< T, NDIM >::implT

◆ keyT

template<typename T , std::size_t NDIM>
typedef Key<NDIM> madness::DerivativeBase< T, NDIM >::keyT

◆ nodeT

template<typename T , std::size_t NDIM>
typedef FunctionNode<T,NDIM> madness::DerivativeBase< T, NDIM >::nodeT

◆ tensorT

template<typename T , std::size_t NDIM>
typedef Tensor<T> madness::DerivativeBase< T, NDIM >::tensorT

regular tensors, like rm, etc

◆ woT

template<typename T , std::size_t NDIM>
typedef WorldObject< DerivativeBase<T, NDIM> > madness::DerivativeBase< T, NDIM >::woT
private

Constructor & Destructor Documentation

◆ DerivativeBase()

template<typename T , std::size_t NDIM>
madness::DerivativeBase< T, NDIM >::DerivativeBase ( World world,
std::size_t  axis,
int  k,
BoundaryConditions< NDIM bc 
)
inline

◆ ~DerivativeBase()

template<typename T , std::size_t NDIM>
virtual madness::DerivativeBase< T, NDIM >::~DerivativeBase ( )
inlinevirtual

Member Function Documentation

◆ do_diff1()

template<typename T , std::size_t NDIM>
void madness::DerivativeBase< T, NDIM >::do_diff1 ( const implT f,
implT df,
const keyT key,
const argT left,
const argT center,
const argT right 
) const
inline

◆ do_diff2b()

template<typename T , std::size_t NDIM>
virtual void madness::DerivativeBase< T, NDIM >::do_diff2b ( const implT f,
implT df,
const keyT key,
const argT left,
const argT center,
const argT right 
) const
pure virtual

◆ do_diff2i()

template<typename T , std::size_t NDIM>
virtual void madness::DerivativeBase< T, NDIM >::do_diff2i ( const implT f,
implT df,
const keyT key,
const argT left,
const argT center,
const argT right 
) const
pure virtual

◆ enforce_bc()

template<typename T , std::size_t NDIM>
static bool madness::DerivativeBase< T, NDIM >::enforce_bc ( int  bc_left,
int  bc_right,
Level  n,
Translation l 
)
inlinestatic

◆ find_neighbor()

template<typename T , std::size_t NDIM>
Future< argT > madness::DerivativeBase< T, NDIM >::find_neighbor ( const implT f,
const Key< NDIM > &  key,
int  step 
) const
inline

◆ forward_do_diff1()

template<typename T , std::size_t NDIM>
void madness::DerivativeBase< T, NDIM >::forward_do_diff1 ( const implT f,
implT df,
const keyT key,
const argT left,
const argT center,
const argT right 
) const
inline

◆ neighbor()

template<typename T , std::size_t NDIM>
Key< NDIM > madness::DerivativeBase< T, NDIM >::neighbor ( const keyT key,
int  step 
) const
inline

◆ operator()()

template<typename T , std::size_t NDIM>
Function< T, NDIM > madness::DerivativeBase< T, NDIM >::operator() ( const functionT f,
bool  fence = true 
) const
inline

Differentiate w.r.t. given coordinate (x=0, y=1, ...) with optional fence.

Returns a new function with the same distribution

References madness::f, madness::Function< T, NDIM >::get_impl(), MADNESS_CHECK_THROW, madness::reconstructed, madness::Function< T, NDIM >::set_impl(), and VERIFY_TREE.

◆ serialize()

template<typename T , std::size_t NDIM>
template<typename Archive >
void madness::DerivativeBase< T, NDIM >::serialize ( const Archive ar) const
inline

◆ stage_halo()

template<typename T , std::size_t NDIM>
void madness::DerivativeBase< T, NDIM >::stage_halo ( const implT f,
bool  fence = true 
) const
inline

Push f's remote same-level neighbor coefficients to the ranks that will need them.

Node M is the neighbor of M-1 and M+1, so its owner pushes it to the owners of those keys without being asked, one batched message per destination. This is the axis-specific staging policy for FunctionImpl's halo table; halo_clear() frees the result. The pushes arrive as tasks, so the fence is what separates staging from differentiating.

References d, madness::f, madness::WorldGopInterface::fence(), madness::World::gop, madness::TaskAttributes::hipri(), madness::DerivativeBase< T, NDIM >::neighbor(), madness::nonlinear_vector_solver(), madness::WorldContainer< keyT, valueT, hashfunT >::owner(), madness::World::rank(), madness::FunctionImpl< T, NDIM >::receive_halo(), and madness::DerivativeBase< T, NDIM >::world.

◆ submit_diff_tasks()

template<typename T , std::size_t NDIM>
void madness::DerivativeBase< T, NDIM >::submit_diff_tasks ( const implT f,
implT df 
) const
inline

Parallel form of FunctionImpl::diff's submission loop; the caller owns the fence.

References madness::f, madness::nonlinear_vector_solver(), madness::World::taskq, and madness::FunctionImpl< T, NDIM >::world.

Friends And Related Symbol Documentation

◆ FunctionImpl< T, NDIM >

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

Member Data Documentation

◆ axis

template<typename T , std::size_t NDIM>
const std::size_t madness::DerivativeBase< T, NDIM >::axis
protected

◆ bc

template<typename T , std::size_t NDIM>
const BoundaryConditions<NDIM> madness::DerivativeBase< T, NDIM >::bc
protected

◆ k

template<typename T , std::size_t NDIM>
const int madness::DerivativeBase< T, NDIM >::k
protected

◆ parallel_submit_

template<typename T , std::size_t NDIM>
bool madness::DerivativeBase< T, NDIM >::parallel_submit_ = false

Spawn diff's per-node tasks from the task pool instead of the main thread.

The same tasks are produced, so the result is unchanged. Per instance and off by default, since it only pays off when many functions are differentiated at once.

◆ vk

template<typename T , std::size_t NDIM>
const std::vector<long> madness::DerivativeBase< T, NDIM >::vk
protected

(k,...) used to initialize Tensors

Referenced by madness::DerivativeBase< T, NDIM >::find_neighbor().

◆ world

template<typename T , std::size_t NDIM>
World& madness::DerivativeBase< T, NDIM >::world
protected

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