Source: k2dgrflow/topoimp.h


Annotated List
Files
Globals
Hierarchy
Index
/***************************************************************************
                          topoimp.h  -  description
                             -------------------
    begin                : Mon May 28 2001
    copyright            : (C) 2001 by benny
    email                : bm@cage.rug.ac.be
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef TOPOIMP_H
#define TOPOIMP_H

#include "topology.h"
#include "vectorimp.h"

/**implementation of a line edge with two nodes on it, one in the beginning and one at the end
  *@author benny
  */
class TopoLineEdge2d:public TopoEdge2d {
public:
     /** a line edge is constructed with two nodes. On construction must be known if its a boundary or not. Standards it's no
         boundary */
     TopoLineEdge2d(TopoNode2d* n1, TopoNode2d* n2, bool noBoundary=true);
     ~TopoLineEdge2d();
#ifdef LIB_WITH_QT
     /** see abstract base class
       */
     virtual void draw(QPainter *p);
#endif
     /** see abstract base class
       */
     virtual bool robinEdge();
     /** see abstract base class
       */
     virtual bool neuEdge();
     /** see abstract base class
       */
     virtual bool dirEdge();
/* not implemented yet. not necesarry in present use of this class
     double normalCo1(){return normCoor1;};
     double normalCo2(){return normCoor2;};
private:
     //components of the normal on the edge. Should be calculated on construction of the edge
     double normCoor1, normCoor2;
*/
};

/**implementation of a triangle element with lines as edges, and 3 nodes in the corners
  *@author benny
  */
class TopoTriangle2d:public TopoElement2d {
public:
     /**construct a triangle by giving the edges and the nodes
           -> constructor will automatically add the triangle in the element list of the nodes
           ->      ....                                                            in the neiighbours list of the edges
         like this everything is kept in order (linking to each other)
     */
	TopoTriangle2d(TopoNode2d* n1, TopoNode2d* n2,TopoNode2d* n3, TopoLineEdge2d* e1,TopoLineEdge2d* e2, TopoLineEdge2d* e3);
	~TopoTriangle2d();
#ifdef LIB_WITH_QT
     /** see abstract base class
       */
     virtual void draw(QPainter *p);
#endif
     /** see abstract base class
       */
     virtual double surface();
     /** see abstract base class
       */
     virtual void setLocMat(uint localnodeI, uint localnodeJ, double value){localStiffMatrix(localnodeI,localnodeJ) = value ; };
     /** see abstract base class
       */
     virtual double locMat(uint localnodeI, uint localnodeJ){return localStiffMatrix(localnodeI,localnodeJ);} ;
     /** see abstract base class
       */
     virtual void setLocForce(uint localnodeJ, double value){localForceVect[localnodeJ] = value ; };
     /** see abstract base class
       */
     virtual double locForce( uint localnodeJ){return localForceVect[localnodeJ] ; } ;
     /** see abstract base class
       */
     virtual double localBasisFunc(int nodeI, double coor1, double coor2);
     /** see abstract base class
       */
     virtual double localBasisFuncD1(int nodeI, double coor1, double coor2);
     /** see abstract base class
       */
     virtual double localBasisFuncD2(int nodeI, double coor1, double coor2);
     /** see abstract base class
       */
     /** a test function of all the functionality
       */
     static bool testTopoTriangle2d();
private:
     /** the local stiffnessmatrix for a triangle is a 3x3 matrix
       */
     Matrix33 localStiffMatrix;
     /** the local force vector for a triangle is a vector of size 3
       */
     Vector3D localForceVect;

protected :
     /** method to calculate the surface of a triangle
       */
     void calcSurf();
};

/**implementation of an inner node
  *@author benny
  */
class TopoNodeInner2d:public TopoNode2d {
public:
     /** see abstract base class
       */
    TopoNodeInner2d(double co1, double co2):TopoNode2d(co1,co2){};
    ~TopoNodeInner2d(){};
#ifdef LIB_WITH_QT
     /** see abstract base class
       */
     virtual void draw(QPainter *p);
#endif
     /** see abstract base class
       */
     virtual Node nodeType(){return TopoNode2d::INNER;};
     /** see abstract base class
       */
     virtual bool innerNode(){return true;};
     /** see abstract base class
       */
     virtual bool robinNode(){return false;} ;
     /** see abstract base class
       */
     virtual bool neuNode(){return false;};
     /** see abstract base class
       */
     virtual bool dirNode(){return false;};
     /** see abstract base class
       */
     virtual bool cornerNode(){return false;}
};

/** now the border nodes.
     To prevent a too long inheritance tree we don't make a special abstract boundary node class.
     Boundary nodes are on boundary with number borderNr .
     The controller object must take care this number means something.
     As a special case, a boundarynode can be a corner, meaning it is were 2 boundaries intersect. Such a
        node is on 2 boundaries. The boundary number only refers to one. If the second is necerry, the borders must be
        looked up by the controller to look for that other boundary
    This is the implementation of a dirichlet node
   */
class TopoNodeDir2d:public TopoNode2d {
public:
    /**constructor of dir node.
        extra to base class : add bordernumber (value=0 to  number of borders-1) on wich the node lays
                                       add if border is a corner (=where 2 borders meet).
      */
    TopoNodeDir2d(double co1, double co2, int border, bool cor):TopoNode2d(co1,co2), borderNr(border), corner(cor){};
    ~TopoNodeDir2d(){};
#ifdef LIB_WITH_QT
     virtual void draw(QPainter *p);
#endif
     virtual Node nodeType(){return DIRICHLET;};
     virtual bool innerNode(){return false;};
     virtual bool robinNode(){return false;} ;
     virtual bool neuNode(){return false;};
     virtual bool dirNode(){return true;};
     virtual bool cornerNode(){return corner;};
     /**return the number of the border the node is on
       */
     int onBorder(){return borderNr;};

private :
     int borderNr;
     bool corner;
};
/** now the border nodes.
     To prevent a too long inheritance tree we don't make a special abstract boundary node class.
     Boundary nodes are on boundary with number borderNr .
     The controller object must take care this number means something.
     As a special case, a boundarynode can be a corner, meaning it is were 2 boundaries intersect. Such a
        node is on 2 boundaries. The boundary number only refers to one. If the second is necerry, the borders must be
        looked up by the controller to look for that other boundary
    This is the implementation of a Neumann node
   */
class TopoNodeNeu2d:public TopoNode2d {
public:
    /**constructor of neumann node.
        extra to base class : add bordernumber (value=0 to  number of borders-1) on wich the node lays
                                       add if border is a corner (=where 2 borders meet).
      */
    TopoNodeNeu2d(double co1, double co2, int border, bool cor):TopoNode2d(co1,co2), borderNr(border), corner(cor){};
    ~TopoNodeNeu2d(){};
#ifdef LIB_WITH_QT
     virtual void draw(QPainter *p);
#endif
     virtual Node nodeType(){return NEUMANN;};
     virtual bool innerNode(){return false;};
     virtual bool robinNode(){return false;} ;
     virtual bool neuNode(){return true;};
     virtual bool dirNode(){return false;};
     virtual bool cornerNode(){return corner;} ;
     /**return the number of the border the node is on
       */
     int onBorder(){return borderNr;};

private:
     int borderNr;
     bool corner;
};
/** now the border nodes.
     To prevent a too long inheritance tree we don't make a special abstract boundary node class.
     Boundary nodes are on boundary with number borderNr .
     The controller object must take care this number means something.
     As a special case, a boundarynode can be a corner, meaning it is were 2 boundaries intersect. Such a
        node is on 2 boundaries. The boundary number only refers to one. If the second is necerry, the borders must be
        looked up by the controller to look for that other boundary
    This is the implementation of a Robin node
   */
class TopoNodeRobin2d:public TopoNode2d {
public:
    /**constructor of Robin node.
        extra to base class : add bordernumber (value=0 to  number of borders-1) on wich the node lays
                                       add if border is a corner (=where 2 borders meet).
      */
    TopoNodeRobin2d(double co1, double co2, int border, bool cor):TopoNode2d(co1,co2), borderNr(border), corner(cor){};
    ~TopoNodeRobin2d(){};
#ifdef LIB_WITH_QT
     virtual void draw(QPainter *p);
#endif
     virtual Node nodeType(){return ROBIN ;};
     virtual bool innerNode(){return false;};
     virtual bool robinNode(){return true;} ;
     virtual bool neuNode(){return false;};
     virtual bool dirNode(){return false;};
     virtual bool cornerNode(){return corner;} ;
     /**return the number of the border the node is on
       */
     int onBorder(){return borderNr;};

private:
     int borderNr;
     bool corner;
};

#endif

Generated by: benny@okidoki on Thu Jun 21 10:41:51 2001, using kdoc 2.0a53.