//#####################################################################
// Copyright 2015-2020, Craig Schroeder.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
#ifndef __MPM_HELPERS__
#define __MPM_HELPERS__
#include <Core/Vectors/VECTOR.h>
#include <functional>
namespace PhysBAM{
namespace MPM{
enum BC_TYPE {BC_FREE, BC_SLIP, BC_NOSLIP, BC_PERIODIC, BC_SEP, BC_MIXED};
}
template<class TV> class MPM_PARTICLES;
template<class TV> class GRID;
template<class TV>
class PARTICLE_BOUNDARY_CONDITIONS
{
    typedef typename TV::SCALAR T;
    const VECTOR<MPM::BC_TYPE,TV::m*2>& side_bc_type;
    RANGE<TV> range;
    RANGE<TV> grid_domain;
    TV periodic_shift;
    MPM_PARTICLES<TV>& particles;
public:
    std::function<TV(const TV& X)> bc_v;
    VECTOR<std::function<MPM::BC_TYPE(const TV& X)>,TV::m*2> bc_mixed_type;

    PARTICLE_BOUNDARY_CONDITIONS(MPM_PARTICLES<TV>& particles,const GRID<TV>& grid,
        const VECTOR<MPM::BC_TYPE,TV::m*2>& side_bc_type);

    void Enforce(int p);
};

}
#endif
