/*
 $Id: dirichlet.cc,v 1.2 1996/10/04 15:06:27 roitzsch Exp $
 (C)opyright 1996 by Konrad-Zuse-Center, Berlin
 All rights reserved.
 Part of the Kaskade distribution
*/

#include "dirichlet.h"
#include "numerics.h"


DirichletBCs:: DirichletBCs () : Id(1), Values(1)   { }

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

void DirichletBCs:: notImplemented() const
{
    cout << "\n class DirichletBCs: function not implemented \n"; cout.flush(); abort(); 
}
//-------------------------------------------------------------------------

Real DirichletBCs:: initialValue(Vector<Real>& /*x*/, Real /*time*/, int /*comp*/) const 
						{ notImplemented(); return 0.0; }
//-------------------------------------------------------------------------

int DirichletBCs:: noOfConstraints() const
{
    int i, no=0;
    FORALL(Id,i)  { if (Id[i]) ++no; }
    return no;
}
//-------------------------------------------------------------------------

void DirichletBCs:: setValuesToZero()
{
    int i;
    FORALL(Values,i) Values[i] = 0.0;
}
//-------------------------------------------------------------------------

void DirichletBCs:: extend(int noOfNodes)
{
    static const float huge = -machMax(float(0.0));

    if (noOfNodes == Id.high()) return;

    Id.resize(noOfNodes);
    Values.resize(noOfNodes);

    int i;
    FORALL(Id,i) 
    {
	Id[i] = 0;
	Values[i] = huge;
    }
}
