Rectangle#
To define a rectangle, as for parallelograms, give 3 vertices (defining two orthogonal segments)
There is a parameter for each of them: _v1 , _v2 , and _v4 , as for Parallelogram . These parameters take 2D or 3D points.
For rectangles in plane z=0, where sides are parallel to x-axis and y-axis, the rectangle may be defined by its center (\(c\) in the figure) and its lengths or \(p_1\) (recalled origin in this case) and its lengths.
To do it, use _center, _xlength and _ylength or _origin, _xlength and _ylength keys.
_origin and _center keys take 2D or 3D points and _xlength and _ylength keys take one single positive value.
There is another possibility : defining the rectangle by its bounds : _xmin , _xmax , _ymin and _ymax keys taking one single value.
_nnodes can take one single value or an explicit list of 2 or 4 values (or a Numbers object) and _hsteps can take one real value or an explicit list of 4 real values (or a Reals object).
If required, give the names of main domain and side domains as explained in Geometry definition:
Rectangle r1(_v1=Point(0.,0.), _v2=Point(2.,0.), _v4=Point(0.,1.) , _nnodes={20, 10},
_domain_name="Omega", _side_names={"Gamma1", "Gamma2", "Gamma1", "Gamma2"});
Rectangle r2(_center=Point(1.,0.5), _xlength=2., _ylength=1. , _nnodes={20, 10},
_domain_name="Omega", _side_names={"Gamma1", "Gamma2", "Gamma1", "Gamma2"});
Rectangle r3(_origin=Point(0.,0.), _xlength=2., _ylength=1. , _nnodes={20, 10},
_domain_name="Omega" , _side_names={"Gamma1", "Gamma2", "Gamma1", "Gamma2"});
Rectangle r4(_xmin=0., _xmax=2., _ymin=0., _ymax=1., _nnodes={20, 10},
_domain_name="Omega", _side_names={"Gamma1", "Gamma2", "Gamma1", "Gamma2"});
This is 4 definitions of the same Rectangle object.
Let’s summarize information about geometrical keys on rectangles:
key(s) |
authorized types |
examples |
|---|---|---|
|
|
|
|
|
|
|
single unsigned integer or real positive value |
|
|
single integer or real value |
|
Hint
Parametrization of the rectangle \((v_1,v_2,v_4)\) is :