//#####################################################################
// Copyright 2021, Craig Schroeder.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
#ifndef __QUADRATIC_INTERPOLATION__
#define __QUADRATIC_INTERPOLATION__

#include <Core/Interpolation/GENERAL_INTERPOLATION_CELL.h>
#include <Core/Interpolation/GENERAL_INTERPOLATION_FACE.h>
#include <Core/Interpolation/GENERAL_INTERPOLATION_NODE.h>
#include <Core/Interpolation/INTERPOLATION_UNIFORM_FORWARD.h>
namespace PhysBAM{

// // interpolating polynomial
// struct QUADRATIC_INTERPOLATION_STENCIL
// {
//     constexpr static int stencil_size=3;
//     template<class T2,class T> static T2 Value(T t,const T2* x)
//     {
//         T2 a=x[0]+x[2]-2*x[1],b=2*x[1]-(T).5*x[2]-(T)1.5*x[0],c=(T).5*(x[0]+x[1]);
//         return (a*t+b)*t+c;
//     }
//     template<class T2,class T> static T2 Diff(T t,const T2* x)
//     {
//         T2 a=x[0]+x[2]-2*x[1],b=2*x[1]-(T).5*x[2]-(T)1.5*x[0];
//         return t*2*a+b;
//     }
//     template<class T2,class T> static T2 Hess(T t,const T2* x)
//     {
//         T2 a=x[0]+x[2]-2*x[1];
//         return 2*a;
//     }
// };

// template<class TV,class T2>
// using QUADRATIC_INTERPOLATION_NODE=GENERAL_INTERPOLATION_NODE<TV,T2,QUADRATIC_INTERPOLATION_STENCIL>;

// template<class TV,class T2>
// using QUADRATIC_INTERPOLATION_CELL=GENERAL_INTERPOLATION_CELL<TV,T2,QUADRATIC_INTERPOLATION_STENCIL>;

// template<class TV,class T2,class T_FACE_ARRAY=ARRAY<T2,FACE_INDEX<TV::m> > >
// using QUADRATIC_INTERPOLATION_FACE=GENERAL_INTERPOLATION_FACE<TV,T2,QUADRATIC_INTERPOLATION_STENCIL,false,T_FACE_ARRAY>;

// template<class TV,class T2,class T_FACE_ARRAY>
// struct QUADRATIC_INTERPOLATION_ALL:QUADRATIC_INTERPOLATION_NODE<TV,T2>,QUADRATIC_INTERPOLATION_CELL<TV,T2>,QUADRATIC_INTERPOLATION_FACE<TV,T2,T_FACE_ARRAY>
// {
// };
}
#endif
