|
|
Representation of the Border. We define first the astract class BorderBase wich will be the basis of all possible borders a domain can have. It defines the common interface of all borders.
enum BorderType {Line,SinCurve} | BorderType |
every border is of a certain type
enum BorderCondition {NotSet, DIRICHLET, NEUMANN , ROBIN } | BorderCondition |
BorderCondition is a state of the border. Every Border has a BorderCondition
enum BorderCondDirType {DirZ, DirAx_B} | BorderCondDirType |
when we have a dirichletcondition, we distinguish 2 types for now
K2dBorderBase ()
| K2dBorderBase |
Constructor, a border is constructed with bordercondition NotSet
~K2dBorderBase ()
| ~K2dBorderBase |
[virtual]
void draw (QPainter*, bool meshed = false )
| draw |
[pure virtual]
Draw the border on a painter, also meshed or not
BorderPoint* firstPoint ()
| firstPoint |
[const virtual]
Every border has a first and a last point, pointers to these are returned
BorderPoint* lastPoint ()
| lastPoint |
[const virtual]
Every border has a first and a last point, pointers to these are returned
BorderPoint* atPoint (uint index)
| atPoint |
[const]
return a pointer to a certain point of the border, defined by index
bool onBorder (const double &co1, const double &co2, bool meshed)
| onBorder |
[const pure virtual]
see if a certain given point is on the border (or the meshed border if meshed = true ) Remark : since we work with double, we take the defined TOPONUMEPS as allowed difference to be equal
bool endPoint (const double &co1, const double &co2)
| endPoint |
[virtual]
see if a given point is an endpoint of the border (a corner)
void minCo (uint coordIndex, double &valueMin)
| minCo |
[const pure virtual]
we want to be able to retrieve the min and maximum values of border coordIndex is the index, eg 0 for the first, 1 for the second; and value is the present min or max the function changes this if necessary.
void maxCo (uint coordIndex, double &valueMax)
| maxCo |
[const pure virtual]
uint nrPointsOnBorder ()
| nrPointsOnBorder |
[const]
Return the number of points we have on our border for the starting mesh
void setBorderCond (BorderCondition bc, BorderCondDirType dirT=DirZ, double a=0,
double b=0)
| setBorderCond |
change the bordercondition to bc, if dirichlet, you must specify a and b parameter as in g(x,z) = ax + b, if not these are unimportant PS : this has to be changed later to a bordercondition object that encapsulates everything
BorderCondition getBorderCondition ()
| getBorderCondition |
return the present bordercondition
double gDirichlet (const double &co1, const double &co2)
| gDirichlet |
[const virtual]
depending of the bordercondition, there are associated functions -> if dirichlet : a g_dir()function, value on dir border : u(x,y) = g_dir(x,y) -> if neuman : a neuman g_neu function : Du(u,y) = g_neu -> if robin : a combination. For now only dirichlet and neuman are implemented.
double gNeumann (const double &co1, const double &co2)
| gNeumann |
[const virtual]
BorderCondDirType getBorderCondDirType ()
| getBorderCondDirType |
we allow for now two types of dirichlet border condition. when it is g(x,z)=z, we return true
double getBorderCondDirLineA ()
| getBorderCondDirLineA |
return the A parameter of a dirichletcondition ax + b should be replaced later by a function that returns a Bordercondition object
double getBorderCondDirLineB ()
| getBorderCondDirLineB |
return the B parameter of a dirichletcondition ax + b should be replaced later by a function that returns a Bordercondition object
BorderType type ()
| type |
[pure virtual]
return the type of the Border (something like the name)
void printBorder (QTextStream &)
| printBorder |
[virtual]
write a border to the ouputstream in a nice text format, a virtual function it is not possible to make the << a virtual function, so a virtual function has to be provided. In the childclasses this should just do a call to <<
QArray<BorderPoint*> points | points |
[protected]
BorderCondition borderCond | borderCond |
[protected]
BorderCondDirType dirType | dirType |
[protected]
double dirLineA | dirLineA |
[protected]
double dirLineB | dirLineB |
[protected]