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

#ifndef ELEMENTS1MC_H
#define ELEMENTS1MC_H

#include "elements1.h"


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

			// Linear MC-Line:


class MCLine : public Line
{

  public:

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

    virtual int NoOfBaseNodes()const { return 2; }
    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
	    { MCConstEllip1(elem, A, Jac, pattern, nComp, Node); } 

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

    virtual Bool assembleNeumannBCs(const PATCH& elem, Vector<Real>& b, 
				    const Matrix<Bool>* pattern,
				    Real time=0.0) const
	    { return MCNeumannBCs1(elem, b, pattern, nComp, Node, time); }

    virtual Bool assembleCauchyBCs(const PATCH& elem, Matrix<Real>& A, 
				   Vector<Real>& b,const Matrix<Bool>* pattern, 
				   Real time=0.0) const
	    { return MCCauchyBCs1(elem, A, b, pattern, nComp, Node, time); }

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


    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;

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


		// -- quadratic hierarchical element:


class HQuadMCLine : public HQuadLine
{

  public:

    HQuadMCLine(Material* material, int nComp);

    virtual int NoOfBaseNodes() const { return 3; }
    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;

    HQuadMCLine(int /*nComp0*/): HQuadLine(), 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
	    { MCConstEllip1(elem, A, Jac, pattern, nComp, Node); } 

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

    virtual Bool assembleNeumannBCs(const PATCH& elem, Vector<Real>& b, 
				    const Matrix<Bool>* pattern,
				    Real time=0.0) const
	    { return MCNeumannBCs1(elem, b, pattern, nComp, Node, time); }

    virtual Bool assembleCauchyBCs(const PATCH& elem, Matrix<Real>& A, 
				   Vector<Real>& b,const Matrix<Bool>* pattern, 
				   Real time=0.0) const
	    { return MCCauchyBCs1(elem, A, b, pattern, nComp, Node, time); }

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


    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
