57 o <<
"********" << std::endl;
58 o <<
"a_face:" << std::endl;
59 o <<
"********" << std::endl;
60 o <<
"This class is used to model the face of a 'a_block' (see a_block_help for more information)" << std::endl;
61 o <<
"This is a virtual class, it cannot be used directly, see a_face_... for usable classes" << std::endl;
62 o <<
"Commands:" << std::endl;
63 o <<
"--------" << std::endl;
64 o <<
"c: centre of gravity" << std::endl;
65 o <<
"cl: centre of gravity (in local coordinate system)" << std::endl;
66 o <<
"dx: x dimension of face" << std::endl;
67 o <<
"dy: y dimension of face" << std::endl;
68 o <<
"dxM: maximum x-distance between centre of gravity and vertices" << std::endl;
69 o <<
"dxm: minimum x-distance between centre of gravity and vertices" << std::endl;
70 o <<
"dyM: maximum y-distance between centre of gravity and vertices" << std::endl;
71 o <<
"dym: minimum y-distance between centre of gravity and vertices" << std::endl;
72 o <<
"point 'u' 'v': get point given excentricities u and v" << std::endl;
73 o <<
"exit 'bool': set face as an exit face" << std::endl;
74 o <<
"exit: check whether face is an exit face" << std::endl;
75 o <<
"S: surface" << std::endl;
76 o <<
"Sx: projection of surface perpendicular to x" << std::endl;
77 o <<
"Sy: projection of surface perpendicular to y" << std::endl;
78 o <<
"Sz: projection of surface perpendicular to z" << std::endl;
79 o <<
"nx: direction x" << std::endl;
80 o <<
"ny: direction y" << std::endl;
81 o <<
"normal: normal to the face" << std::endl;
82 o <<
"normale 'i': normal to edge i" << std::endl;
83 o <<
"plane: gets a a_plane" << std::endl;
84 o <<
"N: normal force" << std::endl;
85 o <<
"Qx: shear force" << std::endl;
86 o <<
"Qy: shear force" << std::endl;
87 o <<
"Mx: torque (bending)" << std::endl;
88 o <<
"My: torque (bending)" << std::endl;
89 o <<
"Mt: torque (torsion)" << std::endl;
90 o <<
"ax: angle of incidence" << std::endl;
91 o <<
"ay: angle of incidence" << std::endl;
92 o <<
"x: application point of f on face" << std::endl;
93 o <<
"exx: excentricity in x direction" << std::endl;
94 o <<
"exy: excentricity in y direction" << std::endl;
95 o <<
"exn: excentricity in normal direction (should be 0)" << std::endl;
96 o <<
"nv: get number of vertices" << std::endl;
97 o <<
"av 'ref': add reference to a vertex" << std::endl;
98 o <<
"rv 'i': gets vertex reference" << std::endl;
99 o <<
"block: gets block to which the face belongs" << std::endl;
100 o <<
"f 'a_wrench': apply wrench to face" << std::endl;
101 o <<
"f 'a_point': apply force to centre of gravity of face" << std::endl;
102 o <<
"f 'fx' 'fy' 'fz': apply force to centre of gravity of face" << std::endl;
103 o <<
"f: gets force applied to face" << std::endl;
104 o <<
"lface: gets connected face" << std::endl;
105 o <<
"lblock: gets connected block" << std::endl;
106 o <<
"in: face is connected to other faces, inside the structure" << std::endl;
107 o <<
"out: face is not connected to other faces, on the boudary" << std::endl;
108 o <<
"hinge: hinge opening: rotation vector" << std::endl;
109 o <<
"contacttype: contact type: (-2: no sister face, -1: not touching, 2: plane contact, 1: edge contact, 0: point contact)" << std::endl;
110 o <<
"contactpoint: return point of contact if faces just touch by one point" << std::endl;
111 o <<
"contactsegment: return edge of contact if faces touch by one edge: hinge" << std::endl;
112 o <<
"contactface: return common surface of contact" << std::endl;
113 o <<
"grow 'val': incread the size of the face" << std::endl;
114 o <<
"slide 'u' 'v': slide face in its own plane (values are relative excentricities)" << std::endl;
115 o <<
"deform 'i' 'val': move edge 'i' perpendicularly to itself" << std::endl;
121 return this->
v(i)-this->
c();
127 a_point
c = this->
c();
128 for (
unsigned short i=0; i<this->
nv(); i++)
131 d = (this->
vc(i))*(this->
nx());
141 for (
unsigned short i=0; i<this->
nv(); i++)
144 d = (this->
vc(i))*(this->
nx());
154 for (
unsigned short i=0; i<this->
nv(); i++)
157 d = (this->
vc(i))*(this->
ny());
167 for (
unsigned short i=0; i<this->
nv(); i++)
170 d = (this->
vc(i))*(this->
ny());
179 return this->
dxM()+this->
dxm();
184 return this->
dyM()+this->
dym();
190 a_point
c = this->
c();
191 a_point p0 = this->
v(ref);
195 return (p0-
c).normalise();
200 int ref1 = (ref+1)%this->
nv();
201 a_point p1 = this->
v(ref1);
205 a_point n = this->
normal();
206 a_point ne = cross(n,l);
208 return ne.normalise();
214 return this->
c()+(u*this->
dx()/2.)*this->
nx()+(v*this->
dy()/2.)*this->
ny();
219 a_point d = (u*this->
dx()/2.)*this->
nx()+(v*this->
dy()/2.)*this->
ny();
220 for (
unsigned short i=0; i<this->
nv(); i++)
222 a_point pn = this->
v(i)+d;
224 this->
block()->
v(r)->set(pn.x(),pn.y(),pn.z());
232 a_point d = val*this->
normale(ref);
233 a_point p0n = this->
v(ref)+d;
234 this->
block()->
v(r0)->set(p0n.x(),p0n.y(),p0n.z());
238 int ref1 = (ref+1)%this->
nv();
240 a_point p1n = this->
v(ref1)+d;
241 this->
block()->
v(r1)->set(p1n.x(),p1n.y(),p1n.z());
273 double c = fabs(this->
normal().
x());
274 return (this->
S())*
c;
279 double c = fabs(this->
normal().y());
280 return (this->
S())*
c;
285 double c = fabs(this->
normal().z());
286 return (this->
S())*
c;
318 a_point
c = this->
c();
322 void a_face::f(
const double fx,
const double fy,
const double fz)
330 a_point
f =
f_->
p1();
342 a_point
f =
f_->
p1();
343 return -
f*this->
nx();
348 a_point
f =
f_->
p1();
361 m -= cross(this->
c(),
f_->
F());
368 m -= cross(this->
c(),f.
F());
375 m -= cross(this->
c(),
f_->
F());
382 m -= cross(this->
c(),f.
F());
388 double n = this->
N();
389 double qx = this->
Qx();
390 return atan2(-qx,-n);
395 double n = this->
N();
396 double qy = this->
Qx();
397 return atan2(-qy,-n);
402 a_point
c = this->
c();
403 double N = this->
N();
404 double Mx = this->
Mx();
405 double My = this->
My();
413 return c+
x*this->
nx()+y*this->
ny();
418 a_point
c = this->
c();
419 double N = this->
N(f);
420 double Mx = this->
Mx(f);
421 double My = this->
My(f);
429 return c+
x*this->
nx()+y*this->
ny();
434 a_point
x = this->
x()-this->
c();
435 a_point d = this->
nx();
441 a_point
x = this->
x(f)-this->
c();
442 a_point d = this->
nx();
448 a_point
x = this->
x()-this->
c();
449 a_point d = this->
ny();
455 a_point
x = this->
x(f)-this->
c();
456 a_point d = this->
ny();
462 a_point
x = this->
x()-this->
c();
463 a_point d = this->
normal();
477 a_point n1 = this->
normal();
480 return a_point(0,0,0);
481 a_point n2 = f2->
normal();
486 double angle = acos(
v);
487 a_point n = cross(n1,-n2);
497 for (
int i=0; i<
nv; i++)
507 o << this->
nv() <<
" ";
508 for (
int i=0; i<this->
nv(); i++)
509 o << this->
rv(i) <<
" ";
std::istream & operator>>(std::istream &in, a_face &f)
std::ostream & operator<<(std::ostream &o, const a_face &f)
a_twist * pos() const
get pointer to position handle
a_point * v(const int i)
get pointer to vertex
virtual a_point normal() const =0
normal to the face (in world coordinate)
virtual double Mt() const
get torque on the face
virtual double Qy() const
get shear force on the face
a_face * lface() const
get connected face
a_wrench * f_
force on the face
virtual void slide(const double &u, const double &v)
slide the face in its plane
a_face * lface_
face in contact
std::vector< int > r_vertices_
references to the points of the block defining the face
virtual double dyM() const
distance from center to max y
virtual a_point nx() const =0
direction of face (in world coordinate)
virtual double Qx() const
get shear force on the face
virtual void read(std::istream &i)
virtual a_point normale(const unsigned short i)
return the edge normal
int rv(const int i) const
get vertex reference
a_point hinge() const
hinge opening: rotation vector
bool ok() const
check if forces on face are acceptable
bool in() const
face is connected to other faces, inside the structure
double exy() const
excentricity in y direction
virtual void clear()
set force to 0
int nv() const
get number of vertices
a_point c() const
centre of mass (in world coordinate)
virtual double Mx() const
get torque on the face
virtual a_point x() const
application point of f on face
void deform(const unsigned short &i, const double &val)
slide a given edge
a_point vc(const int i) const
vertex (relative to centre of gravity)
static const std::string help()
get information about the class
double ay() const
get angle of incidence in yn plane
virtual void write(std::ostream &o) const
double Sx() const
projection of surface perp to x (in world coordinate)
double dxm() const
distance from center to min x
double Sy() const
projection of surface perp to y (in world coordinate)
double exn() const
excentricity in normal direction (should be 0)
virtual double S() const =0
Surface.
a_point * vl(const int i)
get vertex (in local coordinate)
virtual double N() const
get normal force on the face
virtual a_point point(const double &u, const double &v=0.) const
get point on face given excentricities
a_point v(const int i) const
get vertex (in world coordinate)
virtual double My() const
get torque on the face
double ax() const
get angle of incidence in xn plane
double Sz() const
projection of surface perp to z (in world coordinate)
double dxM() const
distance from center to max x
a_wrench f() const
get force on the face
a_fcriteria * criteria_
resistance criteria
virtual a_point ny() const =0
normal to the vertices of the block (in world coordinate)
virtual double dym() const
distance from center to min y
a_block * lblock() const
get connected block
double exx() const
excentricity in x direction
a_block * block_
block to which the face belongs
double penalty() const
penalty value used for optimization
virtual a_point cl() const =0
centre of mass (in local system)
a_block * block()
get block
virtual double penalty(const a_face *f) const
penalty value used in minimisation
virtual bool ok(const a_face *f) const
return true if forces on the face are acceptable (derived class makes it interesting....
void set(const a_point &p, a_point f, double m=0)
apply a force f at p, possibly with a moment having same direction