/* $Id: intA.h,v 1.2 1996/10/04 15:06:56 roitzsch Exp $ */

#ifndef INTA_H
#define INTA_H

#include "int.h"

class NodeCoordinates;

//-------------------------------------------------------------------------


class LinElemInt : virtual public Interface
{
  public:

    LinElemInt() { }

    virtual void getGlobalNodes(const PATCH* t, Vector<int>& globalNodes) const;
    virtual void updateDirichletBCs(Real time) const;
    virtual void getNodeCoordinates(NodeCoordinates& nc) const;

  protected:

    virtual void setNodeNumbers();
    virtual void interpolateSolution(Vector<Num>& u) const;

    virtual void updateMGFamilyTree();


    // --		multi-level operations:

    virtual void getGlobalMLNodes(const PATCH* t, Vector<int>& node, 
				  int depth) const;

    virtual void setMLNodeNumbers(int maxDepth, int maxDepthM1, int targetDepth);
    virtual void updateMLFamilyTree(int maxDepth, int maxDepthM1);
    virtual void interpolateMLSolution(Vector<Num>& u, 
				       int maxDepth, int maxDepthM1) const;
};
//-------------------------------------------------------------------------


// --		   quadratic lagrange-elements


class LQuadElemInt : virtual public Interface
{
  public:

    LQuadElemInt() { }

    virtual void getGlobalNodes(const PATCH* t, Vector<int>& globalNodes) const;
    virtual void getGlobalMLNodes(const PATCH* t, Vector<int>& node, 
				  int depth) const;
 
    virtual void updateDirichletBCs(Real time) const;
    virtual void getNodeCoordinates(NodeCoordinates& nc) const;
    virtual void interpolateSolution(Vector<Num>& u) const;

    virtual void setHighOrderNodes(int* edNode);    

    virtual void solToNB(Vector<Num>& u);  // P:      solution to nodal basis
    virtual void rhsToNB(Vector<Num>& b);  // P**T:   rhs. to nodal basis
    virtual void solToHB(Vector<Num>& u); 
    virtual void rhsToHB(Vector<Num>& b); 

    virtual void setHBGeneration(Generation& gen);

  protected:

    virtual void setNodeNumbers();
};
//-------------------------------------------------------------------------


// --		   quadratic hierarchical elements


class HQuadElemInt : virtual public LQuadElemInt
{
   public:

    HQuadElemInt() { }
    virtual void updateDirichletBCs(Real time) const;
    virtual void getNodeCoordinates(NodeCoordinates& nc) const
      				{  LQuadElemInt:: getNodeCoordinates(nc); }
    virtual void interpolateSolution(Vector<Num>& u) const;

    virtual void setHighOrderNodes(int* edNode);    

  protected:

    virtual void setNodeNumbers();
};
//-------------------------------------------------------------------------


// --      quadratic tetra for (and only for) EF error estimator


class EFTetraInt : virtual public Interface
{
  public:

    EFTetraInt() { }
    virtual void getGlobalNodes(const PATCH* t, Vector<int>& globalNodes) const;
    virtual void setHighOrderNodes(int* edNode);

  protected:

    virtual void setNodeNumbers() { }
    virtual void updateDirichletBCs(Real /*time*/) const { }
};

#endif

