// ------ FVFastRecons3D.h ------
// S. CLAIN 2013/05
#ifndef _FVFASTRECONS3D
#define _FVFASTRECONS3D
#include "FVRecons3D.h"

class FVFastRecons3D
{
private:
FVRecons3D *_rec;
vector< FVPoint3D<double> > *_list_Point;
size_t _degree,_Ncoef,_reconstruction_type,_reconstruction_purpose;
size_t _nb_row,_nb_col;
FVPoint3D<double> _ref_point;
FVVect<double> *_Vertex3DVect,*_Edge3DVect,*_Face3DVect,*_Cell3DVect;  
FVStencil * _ptr_s;
FVVect<double> *_AValue;
FVVect<FVPoint3D<double> >*_ADerivative;

// value pour  vertex: matrice double de nb_vertex X nb_element_stencil (+1 si conservatif)
// value pour  edge : matrice double de nb_edge*nb_gauss X nb_element_stencil (+1 si conservatif)
// value pour cell : matrice double de nb_gauss_cell X nb_element_stencil (+1 si conservatif)
// pour Derivative, les matrice sont des <FVPoint2D<double> >
// la derniere colonne contient le coef pour le cas conservatif.
public:
FVFastRecons3D();  // constructor
~FVFastRecons3D(); //destructor
FVFastRecons3D(const FVFastRecons3D &frec); // copy constructor
FVFastRecons3D & operator =(const  FVFastRecons3D &frec); // assigment operator
void clean(); // clean the instance
void show(); // show the instance
//
void setStencil(FVStencil &st){ FVFastRecons3D::setStencil(&st); }      
void setStencil(FVStencil *ptr_s);
void setStencil(FVStencil &st, size_t degree){ FVFastRecons3D::setStencil(&st,degree); }      
void setStencil(FVStencil *ptr_s, size_t degree);
FVStencil * getStencil();
void setPolynomialDegree(size_t degree);   
size_t getPolynomialDegree(){return(_degree); } 
void setReferencePoint(FVPoint3D<double> P){_ref_point=P;}
void setReconstructionType(size_t rec_type){_reconstruction_type=rec_type;}
size_t getReconstructionType(){return _reconstruction_type;}
void setReconstructionPurpose(size_t rec_purpose){_reconstruction_purpose=rec_purpose;}
size_t getReconstructionPurpose(){return _reconstruction_purpose;}
void addPoint(FVPoint3D<double> P){_list_Point->push_back(P);}
FVPoint3D<double>  getPoint(size_t k){ return((*_list_Point)[k]);}
size_t getNbPoint(){return  _list_Point->size();}
void doMatrix(FVMesh3D  &m); 
// 
void setVectorVertex3D( FVVect<double> & u){_Vertex3DVect=&u;}
void setVectorEdge3D( FVVect<double> & u)  {_Edge3DVect=&u;}
void setVectorFace3D( FVVect<double> & u)  {_Face3DVect=&u;}
void setVectorCell3D( FVVect<double> & u)  {_Cell3DVect=&u;}
FVVect<double>* getVectorVertex3D( ){return _Vertex3DVect;}
FVVect<double>* getVectorEdge3D( )  {return _Edge3DVect;}
FVVect<double>* getVectorFace3D( )  {return _Face3DVect;}
FVVect<double>* getVectorCell3D( )  {return _Cell3DVect;}
double getValue(size_t i); 
FVPoint3D<double> getDerivative(size_t i);

double getCoefValue(size_t stencil_index,size_t k);
FVPoint3D<double> getCoefDerivative(size_t stencil_index,size_t k);
};
#endif // define _FVFASTRECONS3D

