//#####################################################################
// 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 __DIV_FREE_INTERPOLATION_C1__
#define __DIV_FREE_INTERPOLATION_C1__

#include <Core/Arrays/FACE_ARRAYS.h>
#include <Core/Interpolation/GENERAL_INTERPOLATION_AXIS_FACE.h>
#include <Core/Interpolation/LINEAR_INTERPOLATION_CELL.h>
#include <Core/Interpolation/LINEAR_INTERPOLATION_NODE.h>
namespace PhysBAM{

// interpolating polynomial
struct DIV_FREE_INTERPOLATION_C1_STENCIL
{
    constexpr static int stencil_size=3;
    template<int a,int d,class T> static VECTOR<VECTOR<T,3+(a==d)>,1> Value(T t);
    template<int a,int d,class T> static VECTOR<VECTOR<T,3+(a==d)>,1> Diff(T t);
    template<int a,int d,class T> static VECTOR<VECTOR<T,3+(a==d)>,1> Hess(T t);
};

template<class TV,class T2,class T_FACE_ARRAY=ARRAY<T2,FACE_INDEX<TV::m> > >
using DIV_FREE_INTERPOLATION_C1=GENERAL_INTERPOLATION_AXIS_FACE<TV,T2,DIV_FREE_INTERPOLATION_C1_STENCIL,false,T_FACE_ARRAY>;

template<class TV,class T2,class T_FACE_ARRAY=ARRAY<T2,FACE_INDEX<TV::m> > >
struct DIV_FREE_INTERPOLATION_C1_ALL:LINEAR_INTERPOLATION_NODE<TV,VECTOR<T2, TV::m>>,LINEAR_INTERPOLATION_CELL<TV,T2>,DIV_FREE_INTERPOLATION_C1<TV,T2,T_FACE_ARRAY> {};
}
#endif
