//#####################################################################
// Copyright 2002-2007, Ronald Fedkiw, Geoffrey Irving, Nipun Kwatra, Frank Losasso.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
// Class BOUNDARY_PERIODIC
//#####################################################################
#ifndef __BOUNDARY_PERIODIC__
#define __BOUNDARY_PERIODIC__

#include <Core/Boundaries/BOUNDARY.h>
namespace PhysBAM{

template<class TV,class T2>
class BOUNDARY_PERIODIC:public BOUNDARY<TV,T2>
{
    typedef typename TV::SCALAR T;typedef VECTOR<int,TV::m> IV;
public:
    VECTOR<bool,TV::m> is_periodic;

    BOUNDARY_PERIODIC()
    {is_periodic.Fill(true);}

    ~BOUNDARY_PERIODIC() = default;

//#####################################################################
    void Fill_Ghost_Cells(const GRID<TV>& grid,const ARRAYS_ND_BASE<T2,IV>& u,ARRAYS_ND_BASE<T2,IV>& u_ghost,const int number_of_ghost_cells=3) const override;
    void Fill_Ghost_Faces(const GRID<TV>& grid,const ARRAY<T2,FACE_INDEX<TV::m> >& u,ARRAY<T2,FACE_INDEX<TV::m> >& u_ghost,const int number_of_ghost_cells=3) const override;
    void Apply_Boundary_Condition_Cell(const GRID<TV>& grid,ARRAYS_ND_BASE<T2,IV>& u) const override {} // do nothing
    void Apply_Boundary_Condition_Face(const GRID<TV>& grid,ARRAY<T2,FACE_INDEX<TV::m> >& u) const override;
//#####################################################################
};
}
#endif
