Points&Forces (survey)
Software tools facilitating the task of surveying architecture
a_face.h
Go to the documentation of this file.
1 /*
2 Copyright 2010-2016 Pierre SMARS (smars@yuntech.edu.tw)
3 This program is free software: you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation, either version 2 of the License, or
6 (at your option) any later version.
7 
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16 #ifndef _A_FACE_H_
17 #define _A_FACE_H_
18 
19 #include <vector>
20 #include "a_wrench.h"
21 #include "a_point.h"
22 #include "a_segment.h"
23 #include "a_plane.h"
24 #include "a_contact.h"
25 #include "a_fcriteria.h"
26 
27 class a_block;
28 
32 class a_face
33 {
34 public:
35  a_face();
36  a_face(a_block * b, int ref_face);
37  virtual ~a_face();
39  static const std::string help();
41  int nv() const {return r_vertices_.size();}
43  void av(int ref) {r_vertices_.push_back(ref);}
45  int rv(const int i) const;
47  int rf() const {return ref_;}
49  a_block * block() {return block_;}
51  a_point v(const int i) const;
53  a_point * vl(const int i);
54  a_point * vl(const int i) const;
56  a_point vc(const int i) const;
58  a_point c() const;
60  virtual a_point cl() const = 0;
62  virtual void grow(const double& val) = 0;
64  virtual a_point normale(const unsigned short i);
66  virtual a_point point(const double& u, const double& v = 0.) const;
68  virtual void slide(const double& u, const double& v);
70  void deform(const unsigned short& i, const double& val);
72  void exit(bool exit) {exit_face_ = exit;}
73  bool exit() const {return exit_face_;}
75  virtual double S() const = 0;
77  double Sx() const;
79  double Sy() const;
81  double Sz() const;
83  virtual a_point nx() const = 0;
85  virtual a_point ny() const = 0;
87  virtual a_point normal() const = 0;
89  double dxM() const;
91  double dxm() const;
93  virtual double dyM() const;
95  virtual double dym() const;
96  //distance from max x to max y
97  double dx() const;
98  //distance from max y to max y
99  double dy() const;
101  virtual a_plane plane() const = 0;
103  virtual double N() const;
104  virtual double N(const a_wrench&) const;
106  virtual double Qx() const;
108  virtual double Qy() const;
110  virtual double Mt() const;
112  virtual double Mx() const;
113  virtual double Mx(const a_wrench&) const;
115  virtual double My() const;
116  virtual double My(const a_wrench&) const;
118  double ax() const;
120  double ay() const;
122  virtual a_point x() const;
123  virtual a_point x(const a_wrench&) const;
125  double exx() const;
126  double exx(const a_wrench&) const;
128  double exy() const;
129  double exy(const a_wrench&) const;
131  double exn() const;
133  void f(const a_wrench& f) {*f_=f;}
135  void f(a_wrench * f);
137  void f(const a_point& f);
139  void f(const double fx, const double fy, const double fz);
141  a_wrench f() const {return *f_;}
143  a_wrench * fp() {return f_;}
145  virtual void clear();
149  bool ok() const;
151  double penalty() const;
153  void lface(a_face * f) {lface_ = f;}
155  a_face * lface() const {return lface_;}
157  a_block * lblock() const;
159  bool in() const {return lface_ != 0;}
161  bool out() const {return lface_ == 0;}
163  a_point hinge() const;
165  virtual int contacttype() const = 0;
167  virtual a_point contactpoint() const = 0;
169  virtual a_segment contactsegment() const = 0;
171  virtual a_contact contactface() const = 0;
172  virtual void read(std::istream &i);
173  virtual void write(std::ostream &o) const;
175  friend std::istream& operator>> (std::istream& i, a_face& b);
176  friend std::ostream& operator<< (std::ostream& o, const a_face& b);
177 
181 
182 protected:
184  void clear0();
188  int ref_;
190  std::vector<int> r_vertices_;
199 };
200 
201 #endif
202 
Definition: a_face.h:33
virtual a_point normal() const =0
normal to the face (in world coordinate)
virtual double Mt() const
get torque on the face
Definition: a_face.cxx:352
virtual double Qy() const
get shear force on the face
Definition: a_face.cxx:346
a_face * lface() const
get connected face
Definition: a_face.h:155
friend std::ostream & operator<<(std::ostream &o, const a_face &b)
Definition: a_face.cxx:519
a_wrench * f_
force on the face
Definition: a_face.h:193
virtual a_point contactpoint() const =0
return point of contact if faces just touch by one point
virtual void slide(const double &u, const double &v)
slide the face in its plane
Definition: a_face.cxx:217
a_face * lface_
face in contact
Definition: a_face.h:196
std::vector< int > r_vertices_
references to the points of the block defining the face
Definition: a_face.h:190
virtual double dyM() const
distance from center to max y
Definition: a_face.cxx:151
void clear0()
clear the object
virtual a_point nx() const =0
direction of face (in world coordinate)
virtual double Qx() const
get shear force on the face
Definition: a_face.cxx:340
virtual void read(std::istream &i)
Definition: a_face.cxx:492
virtual a_point normale(const unsigned short i)
return the edge normal
Definition: a_face.cxx:187
int rv(const int i) const
get vertex reference
Definition: a_face.cxx:294
bool exit() const
Definition: a_face.h:73
a_point hinge() const
hinge opening: rotation vector
Definition: a_face.cxx:475
double dy() const
Definition: a_face.cxx:182
virtual ~a_face()
Definition: a_face.cxx:41
virtual void grow(const double &val)=0
grow the face centered on middle point
bool ok() const
check if forces on face are acceptable
Definition: a_face.cxx:245
bool in() const
face is connected to other faces, inside the structure
Definition: a_face.h:159
double exy() const
excentricity in y direction
Definition: a_face.cxx:446
virtual void clear()
set force to 0
Definition: a_face.cxx:48
void lface(a_face *f)
set connected face
Definition: a_face.h:153
int nv() const
get number of vertices
Definition: a_face.h:41
virtual a_segment contactsegment() const =0
return edge of contact if faces touch by one edge: hinge
a_point c() const
centre of mass (in world coordinate)
Definition: a_face.cxx:311
virtual double Mx() const
get torque on the face
Definition: a_face.cxx:358
void exit(bool exit)
set as an exit face
Definition: a_face.h:72
virtual a_point x() const
application point of f on face
Definition: a_face.cxx:400
void deform(const unsigned short &i, const double &val)
slide a given edge
Definition: a_face.cxx:228
int rf() const
get face reference in connected block
Definition: a_face.h:47
virtual a_plane plane() const =0
plane defined by face
a_point vc(const int i) const
vertex (relative to centre of gravity)
Definition: a_face.cxx:119
bool exit_face_
Definition: a_face.h:191
static const std::string help()
get information about the class
Definition: a_face.cxx:54
int ref_
reference of face in a_block
Definition: a_face.h:188
double ay() const
get angle of incidence in yn plane
Definition: a_face.cxx:393
virtual void write(std::ostream &o) const
Definition: a_face.cxx:505
double Sx() const
projection of surface perp to x (in world coordinate)
Definition: a_face.cxx:271
double dxm() const
distance from center to min x
Definition: a_face.cxx:138
double Sy() const
projection of surface perp to y (in world coordinate)
Definition: a_face.cxx:277
double dx() const
Definition: a_face.cxx:177
double exn() const
excentricity in normal direction (should be 0)
Definition: a_face.cxx:460
virtual a_contact contactface() const =0
return common surface of contact
virtual double S() const =0
Surface.
a_point * vl(const int i)
get vertex (in local coordinate)
Definition: a_face.cxx:301
virtual double N() const
get normal force on the face
Definition: a_face.cxx:328
virtual int contacttype() const =0
contact type: (-2: no sister face, -1: not touching, 2: plane contact, 1: edge contact,...
virtual a_point point(const double &u, const double &v=0.) const
get point on face given excentricities
Definition: a_face.cxx:212
a_wrench * fp()
get point of the force on the face
Definition: a_face.h:143
a_point v(const int i) const
get vertex (in world coordinate)
Definition: a_face.cxx:289
virtual double My() const
get torque on the face
Definition: a_face.cxx:372
double ax() const
get angle of incidence in xn plane
Definition: a_face.cxx:386
double Sz() const
projection of surface perp to z (in world coordinate)
Definition: a_face.cxx:283
friend std::istream & operator>>(std::istream &i, a_face &b)
: input/output
Definition: a_face.cxx:513
double dxM() const
distance from center to max x
Definition: a_face.cxx:124
a_wrench f() const
get force on the face
Definition: a_face.h:141
a_face()
Definition: a_face.cxx:24
bool f_original_
Definition: a_face.h:194
a_fcriteria * criteria_
resistance criteria
Definition: a_face.h:198
void f(const a_wrench &f)
set force on the face
Definition: a_face.h:133
void av(int ref)
add a vertex reference
Definition: a_face.h:43
virtual a_point ny() const =0
normal to the vertices of the block (in world coordinate)
bool out() const
face is not connected to other faces, on the boudary
Definition: a_face.h:161
virtual double dym() const
distance from center to min y
Definition: a_face.cxx:164
a_block * lblock() const
get connected block
Definition: a_face.cxx:467
double exx() const
excentricity in x direction
Definition: a_face.cxx:432
a_block * block_
block to which the face belongs
Definition: a_face.h:186
double penalty() const
penalty value used for optimization
Definition: a_face.cxx:254
virtual a_point cl() const =0
centre of mass (in local system)
a_block * block()
get block
Definition: a_face.h:49
void criteria(a_fcriteria *criteria)
set resistance criteria
Definition: a_face.h:147
a wrench class
Definition: a_wrench.h:30