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

#ifndef ELEMENTS3MC_H
#define ELEMENTS3MC_H

#include "elements3.h"


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

			// Linear MC-Tetra:


class MCTetra : public Tetra
{

  public:

    MCTetra(Material* material, int nComp);
    virtual ~MCTetra() { }

    virtual int NoOfBaseNodes()const { return 4; }
    virtual int NoOfNodes()    const { return noOfNodes; }
    virtual int NodesOnPoint() const { return nComp; }
    

    //------------------- the special routines  ----------------------

    virtual void assembleConstEllip(const PATCH& elem, Matrix<Real>& A, 
				    const Jacobian& Jac, 
				    const Matrix<Bool>* pattern) const
	    { MCConstEllip3(elem, A, Jac, pattern, nComp, Node); } 

     virtual void assembleConstConvec(const PATCH& elem, Matrix<Real>& A, 
				     const Jacobian& Jac, 
				     const Matrix<Bool>* pattern) const
	    { MCConstConvec3(elem, A, Jac, pattern, nComp, Node); }

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

    virtual Bool assembleEllip(const PATCH& patch, Matrix<Real>& A, 
			       const Jacobian& Jac, 
			       const Matrix<Bool>* pattern) const
	    { return MCEllip(patch, A, Jac, pattern, nComp, Node); }

    virtual Bool assembleConvec (const PATCH& patch, Matrix<Real>& A, 
				 const Jacobian& Jac, 
				 const Matrix<Bool>* pattern) const
	    { return MCConvec(patch, A, Jac, pattern, nComp, Node); }

    virtual Bool assembleMass (const PATCH& patch, Matrix<Real>& A, 
			       const Jacobian& Jac, 
			       const Matrix<Bool>* pattern) const
	    { return MCMass(patch, A, Jac, pattern, nComp, Node); }

    virtual Bool assembleLumpedMass(const PATCH& patch, Matrix<Real>& A, 
				    const Jacobian& Jac, 
				    const Matrix<Bool>* pattern) const
	    { return MCLumpedMass(patch, A, Jac, pattern, nComp, Node); }

    virtual Bool assembleSource(const PATCH& patch, Vector<Real>& b, 
				const Jacobian& Jac, 
				const Matrix<Bool>* pattern,
				Real time=0.0) const
	    { return MCSource(patch, b, Jac, pattern, nComp, Node, time); }

    virtual void assembleL2Norm(const PATCH& patch, Matrix<Real>& A, 
				const Jacobian& Jac, 
				const Matrix<Bool>* pattern) const
	    { MCL2Norm(patch, A, Jac, pattern, nComp, Node); }

    virtual void assembleLNorm (const PATCH& patch, Vector<Real>& b, 
				const Jacobian& Jac, 
				const Matrix<Bool>* pattern) const
	    { MCLNorm(patch, b, Jac, pattern, nComp, Node); }

		   
  protected:

    const 	int nComp, noOfNodes;
    Matrix<int> Node;

    MCTetra(int /*nComp0*/) : Tetra(), nComp(0), noOfNodes(0), Node(1,1) { }  
};
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------


		// -- quadratic hierarchical element:


class HQuadMCTetra : public HQuadTetra
{

  public:

    HQuadMCTetra(Material* material, int nComp);

    virtual int NoOfBaseNodes() const { return 10; }
    virtual int NoOfNodes()     const { return noOfNodes; }
    virtual int NodesOnPoint()  const { return nComp; }
    virtual int NodesOnEdge()   const { return nComp; }

  protected:

    int 	nComp, noOfNodes;
    Matrix<int> Node;

    HQuadMCTetra(int /*nComp0*/): HQuadTetra(), nComp(0), noOfNodes(0), Node(1,1) { }

    virtual void setPatterns();


    //------------------- the special routines  ----------------------

    virtual void assembleConstEllip(const PATCH& elem, Matrix<Real>& A, 
				    const Jacobian& Jac, 
				    const Matrix<Bool>* pattern) const
	    { MCConstEllip3(elem, A, Jac, pattern, nComp, Node); } 

     virtual void assembleConstConvec(const PATCH& elem, Matrix<Real>& A, 
				     const Jacobian& Jac, 
				     const Matrix<Bool>* pattern) const
	    { MCConstConvec3(elem, A, Jac, pattern, nComp, Node); }

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

    virtual Bool assembleEllip(const PATCH& patch, Matrix<Real>& A, 
			       const Jacobian& Jac, 
			       const Matrix<Bool>* pattern) const
	    { return MCEllip(patch, A, Jac, pattern, nComp, Node); }

    virtual Bool assembleConvec (const PATCH& patch, Matrix<Real>& A, 
				 const Jacobian& Jac, 
				 const Matrix<Bool>* pattern) const
	    { return MCConvec(patch, A, Jac, pattern, nComp, Node); }

    virtual Bool assembleMass (const PATCH& patch, Matrix<Real>& A, 
			       const Jacobian& Jac, 
			       const Matrix<Bool>* pattern) const
	    { return MCMass(patch, A, Jac, pattern, nComp, Node); }

    virtual Bool assembleLumpedMass(const PATCH& patch, Matrix<Real>& A, 
				    const Jacobian& Jac, 
				    const Matrix<Bool>* pattern) const
	    { return MCLumpedMass(patch, A, Jac, pattern, nComp, Node); }

    virtual Bool assembleSource(const PATCH& patch, Vector<Real>& b, 
				const Jacobian& Jac, 
				const Matrix<Bool>* pattern,
				Real time=0.0) const
	    { return MCSource(patch, b, Jac, pattern, nComp, Node, time); }

    virtual void assembleL2Norm(const PATCH& patch, Matrix<Real>& A, 
				const Jacobian& Jac, 
				const Matrix<Bool>* pattern) const
	    { MCL2Norm(patch, A, Jac, pattern, nComp, Node); }

    virtual void assembleLNorm (const PATCH& patch, Vector<Real>& b, 
				const Jacobian& Jac, 
				const Matrix<Bool>* pattern) const
	    { MCLNorm(patch, b, Jac, pattern, nComp, Node); }
};

#endif
