/* $Id: problemnl.h,v 1.1.1.1 1996/10/02 10:35:53 roitzsch Exp $ */

#ifndef PROBLEMNL_H
#define PROBLEMNL_H

#include "problemtr.h"

class NonLinearity;

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


class NonLinearProblem :  virtual public Problem
{
  protected:

    NonLinearProblem();
    virtual ~NonLinearProblem();

    NonLinearity* nonLinearity;

    virtual NonLinearity* getNonLinearity() { return nonLinearity; }

    virtual DirichletBCs* newDirichletBCs();
    virtual void newMaterial();
    virtual void newPreconditioner();

    virtual void assembleGlobal(Real time);
};
//-------------------------------------------------------------------------


class StaticNonLinearProblem :  public NonLinearProblem
{
  public:

    StaticNonLinearProblem() { }

  protected:

    virtual void assemble(const Element& elem, const PATCH& t, 
			  const Jacobian& Jac, Matrix<Num>& A, 
			  Vector<Num>& b, const Matrix<Bool>* pattern, 
			  Bool errorEstimatorCall=False);
};
//-------------------------------------------------------------------------


class TransientNonLinearProblem :  public NonLinearProblem,
				   virtual public TransientProblem
{
  public:

    TransientNonLinearProblem() { }

  protected:

    virtual void assembleGlobal(Real time);
    virtual void assemble(const Element& elem, const PATCH& t, 
			  const Jacobian& Jac, Matrix<Num>& A, 
			  Vector<Num>& b, const Matrix<Bool>* APattern, 
			  Bool errorEstimatorCall=False);

    virtual Real compUNorm(Vector<Num>& u, Vector<Num>* MDiag);

    friend class RK1;
    friend class RK2;
};

#endif


