Index

NAME

AlgebraicDofBase - algebraic equation, constraint


INCLUDE

include "AlgebraicDofBase.h"

SYNTAX

 //-----------------------------------------------------------------------------
 class AlgebraicDofBase
 //-----------------------------------------------------------------------------
 {
 protected:

   int glob_idx;               // Global eqn/dof treated by this object
   SetOfNo(NUMT)     coeffs;   // Coefficients for this unknown
   SetDistinct(int)  pos_idx;  // Global positions for this unknown


 public :

   AlgebraicDofBase ();
   AlgebraicDofBase (const AlgebraicDofBase& alg_dof);
   AlgebraicDofBase (int glob_idx_);
   AlgebraicDofBase (int glob_idx_,
                      const VecSimple(NUMT)& coeffs_,
                      const VecSimple(int)&  pos_idx_);

   virtual ~AlgebraicDofBase () {}

   AlgebraicDofBase& operator= (const AlgebraicDofBase& alg_dof);

   bool redim (int glob_idx_,
               const VecSimple(NUMT)& coeffs_,
               const VecSimple(int)&  pos_idx_);

   void update (int old_base, int new_base);

   int getIndexNo()     const;

   void setIndexNo (int glob_idx_);

   int getNoEntries() const;


   // Coefficients and index numbers, direct numbering
         NUMT& coeff (int i);
   const NUMT& coeff (int i) const;

         int& position (int i);
   const int& position (int i) const;

   void setCoeff (int i, NUMT  coeff, int  pos);
   void getCoeff (int i, NUMT& coeff, int& pos) const;


   // Add one or more new entries

   void insert (NUMT coeff, int pos);

   void fill (int glob_idx_,
              const VecSimple(NUMT)& coeffs_,
              const VecSimple(int)&  pos_idx_);

   int find (int pos);

   virtual void print (Os os) const =0;
   virtual void scan  (Is is) =0;

   CLASS_INFO

 };



KEYWORDS

algerbraic equation, constraint,



DESCRIPTION

The  class  implements  an  algebraic  equations  that  typically
extends the algebraic problem posed by the  discretization  of  a
PDE-based model.


CONSTRUCTORS AND INITIALIZATION

The  constructor  with  integer arguments allocates the indicated
number of coefficients and sets all these coefficents to be zero.
It also initializes the global size of the matrix row correspond­
ing to this equation (the sum of the number of PDE  unknowns  and
the  number  of  extra  algebraic  unknowns), and sets the global
equation number.



MEMBER FUNCTIONS

bool redim - Redimensions the equation data, i.e., sets the total
number  of columns for this equation (including PDE and algebraic
unknowns), the equation number for this equation (usually in  the
range  n+1,...,n+q where n is the number of PDE unknowns and q is
the number of algebraic equations), and  the  number  of  nonzero
coefficients  in  this  equation.  An  overloaded version of this
function also accepts pre-filled coefficient  and  index  arrays,
copying these data into the equation object.

coeff  -  Provides  access to the i-th coefficient in the current
equation.

columnIndex - Provides access to the column  index  corresponding
to the i-th coefficient in the current equation.

setCoeff  -  Allows  the  setting of the i-th coefficient and its
column index.

getCoeff - Allows reading of the i-th coefficient and its  column
index.

size - Returns the number of columns in this equation.

getNoOfCoeffs  -  Returns  the  number of nonzero coefficients in
this equation.

print - Prints the contents of this equation object to the speci­
fied output stream.

scan  -  The  format read by scan is same as written by the print
member function.




SEE ALSO

class AlgebraicDofBase, class AlgebraicContrib.


DEVELOPED BY

Numerical Objects AS


AUTHOR

Are Magnus Bruaset, Numerical Objects AS