/* $Id: materialstr.h,v 1.3 1996/11/19 10:03:34 bzferdma Exp $ */

#ifndef MATERIALSTR_H
#define MATERIALSTR_H

#include "materialsA.h"

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


class TransPeakSource : public PeakSource
{
  public:
 
    TransPeakSource(const char* fileName, int spaceDim0);
    virtual ~TransPeakSource() { }

    virtual Real S(int type, Vector<Real>* x=0, Real time=0.0);

  protected:
    virtual Real S1d(Real x, Real time);
    virtual Real S2d(Real x, Real y, Real time);
    virtual Real S3d(Real x, Real y, Real z, Real time);
};

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


class StepSource : public DefaultMaterial
{
  public:
 
    StepSource(const char* fileName, int spaceDim);

    virtual Bool SourceTerm     (int /*type*/) { return True; }
    virtual Bool constSourceTerm(int /*type*/) { return False; }
    
    virtual Real S(int type, Vector<Real>* x=0, Real time=0.0);
};
//-------------------------------------------------------------------------

class UserTransMaterial : public DefaultMaterial
{
  public:
 
    UserTransMaterial(const char* fileName, int spaceDim);

    virtual Bool EllipticTerm     (int /*type*/) { return True;  }
    virtual Bool constEllipticTerm(int /*type*/) { return False; }    

    virtual Bool MassTerm     (int /*type*/) { return True;  }
    virtual Bool constMassTerm(int /*type*/) { return False; }    

    virtual Bool PTerm     (int /*type*/) { return True;  }
    virtual Bool constPTerm(int /*type*/) { return False; }    

    virtual Bool SourceTerm     (int /*type*/) { return True;  }
    virtual Bool constSourceTerm(int /*type*/) { return False; }    

    virtual Bool constNeumannTerm(int /*type*/) { return False; }    
    virtual Bool constCauchyTerm(int /*type*/)  { return False; }    

    // Derived class: Redefine setMaterialType() due to overloaded E
    virtual void setMaterialType();
    virtual Real E(int type, Vector<Real>* x=0, int i=1, int j=1);
    virtual Real M(int type, Vector<Real>* x=0, int i=1, int j=1);
    virtual Real P(int type, Vector<Real>* x=0, int i=1, int j=1);
    virtual Real S(int type, Vector<Real>* x=0, Real time=0.0);
    virtual Real Neumann(int type, Vector<Real>* x=0, Real time=0.0);
    virtual Real Cauchy(int type, Vector<Real>* x=0, Real time=0.0);

    virtual Num trueSolInPoint(const Vector<Real>& x, const Real time);
    virtual Bool trueSolKnown();

  protected:
    virtual Real E1d(Real x);
    virtual Real E2d(Real x, Real y);
    virtual Real E3d(Real x, Real y, Real z);

    virtual Real P1d(Real x);
    virtual Real P2d(Real x, Real y);
    virtual Real P3d(Real x, Real y, Real z);

    virtual Real S1d(Real x, Real time);
    virtual Real S2d(Real x, Real y, Real time);
    virtual Real S3d(Real x, Real y, Real z, Real time);
};
//-------------------------------------------------------------------------

class CastingMaterial : public DefaultMaterial
{
  public:
 
    CastingMaterial(const char* fileName, int spaceDim);

    virtual Bool constNeumannTerm(int /*type*/) { return False; }    
    virtual Real Neumann(int type, Vector<Real>* x=0, Real time=0.0);

    virtual Bool constCauchyTerm(int /*type*/) { return False; }
    virtual Real Cauchy (int type, Vector<Real>* x=0, Real time=0.0);

  private:
    Real qMold, qSpray;

};
//-------------------------------------------------------------------------

class StefanSource : public VarSourceMaterial
{
  protected:

    Real kappa0, kappa1, c0, c1, s0, s1, theta1;

  public:
 
    StefanSource(const char* fileName, int spaceDim0);

    virtual Real S(int type, Vector<Real>* x=0, Real time=0.0);

  protected:
    //virtual Real S1d(Real x);
    virtual Real S2d(Real x, Real y, Real time);
    //virtual Real S3d(Real x, Real y, Real z);
};

#endif
