Skip to content
Snippets Groups Projects
kern_base.h 1.85 KiB
Newer Older
mkirsz's avatar
mkirsz committed
#ifndef KERN_BASE_H
#define KERN_BASE_H

#include "../../../CORE/core_types.h"
mkirsz's avatar
mkirsz committed
#include "../function_base.h"

#include <iostream>

/** \brief Abstract class to be used as a base for all kernels.
 *
 *  - b = basis vector
 *  - af = atomic energy descriptor
 *  - ff = force descriptor
 *  - all derivatives are defined wrt to the second argument
 */
class Kern_Base: public virtual Function_Base {
    public:
mkirsz's avatar
mkirsz committed
        aeds_type2 basis;
mkirsz's avatar
mkirsz committed
        virtual ~Kern_Base();

        /**
         * Calculate kernel value given two vectors
         *
         * - b = basis vector
         * - af = atomic energy descriptor
         */
mkirsz's avatar
mkirsz committed
        virtual double operator() (const aed_type2 &b, const aed_type2 &af)=0;
mkirsz's avatar
mkirsz committed

        /**
         * Calculate the kernel derivative wrt to the second argument
         *
         * - b = basis vector
         * - af = atomic energy descriptor
         */
mkirsz's avatar
mkirsz committed
        virtual aed_type2 derivative(const aed_type2 &b, const aed_type2 &af)=0;
mkirsz's avatar
mkirsz committed

        /**
         * Calculate inner product of the kernel derivative
         * wrt to the second argument (b wrt af) with the force descriptor
         *
         * - b = basis vector
         * - af = atomic energy descriptor
         * - ff = force descriptor (TODO i-th dir component of it)
         *   TODO consider calculating all 3-directions at once
         */
mkirsz's avatar
mkirsz committed
        virtual double prime(const aed_type2 &b, const aed_type2 &af,
                const aed_type2 &ff)=0;
mkirsz's avatar
mkirsz committed

        /** \brief Set basis for calculations */
mkirsz's avatar
mkirsz committed
        virtual void set_basis(const aeds_type2 b);
mkirsz's avatar
mkirsz committed

mkirsz's avatar
mkirsz committed
        virtual double epredict(const t_type &kweights, const aed_type2 &aed);
mkirsz's avatar
mkirsz committed
        virtual double fpredict(const t_type &kweights, const fd_type &fdij,
mkirsz's avatar
mkirsz committed
                const aed_type2 &aedi, const size_t k);
mkirsz's avatar
mkirsz committed
        virtual force_type fpredict(const t_type &kweights, const fd_type &fdij,
mkirsz's avatar
mkirsz committed
                const aed_type2 &aedi);
mkirsz's avatar
mkirsz committed
};
#endif