Points&Forces (survey)
Software tools facilitating the task of surveying architecture
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
a_structure Class Reference

structure class More...

#include <a_structure.h>

+ Collaboration diagram for a_structure:

Classes

class  range_error
 

Public Member Functions

 a_structure ()
 
 ~a_structure ()
 
void clear ()
 
int nb () const
 get number of blocks More...
 
int rb (const a_block *b) const
 get reference of a block (-1 if no block) More...
 
double V () const
 get volume of structure More...
 
a_point c () const
 get centre of mass More...
 
double m () const
 mass More...
 
double Ws () const
 get weight (scalar) More...
 
a_wrench W ()
 get weight (wrench) More...
 
a_wrench fe ()
 get external force on structure (wrench) More...
 
a_wrench ft ()
 get total force on structure fe+W (wrench) More...
 
double potential () const
 get potential energy More...
 
int add_block (a_block *b)
 add a block to the structure More...
 
void link_blocks (int b1, int f1, int b2, int f2)
 link 2 blocks: [b1: ref_block1, f1: ref_face1, b2:...] More...
 
a_blockb (const int i) const
 get pointer to the block i More...
 
bool connected () const
 check whether all blocks are connected More...
 
std::vector< int > out () const
 get list of extreme blocks (blocks connected only to 1 other block) More...
 
std::vector< int > in () const
 get list of internal blocks (blocks connected at least to 2 other blocks) More...
 
std::vector< int > nodes () const
 get list of blocks connected to more than 2 other blocks (sources of hyperstaticity) More...
 
void clearinternal ()
 clear all the internal face forces More...
 
void clearexternal ()
 clear all the external face forces More...
 
void clearall ()
 clear all the forces on faces More...
 
void objective (a_ocriteria *objective)
 set objective function (used for optimisation) More...
 
double objective () const
 get value of objective function More...
 
void criteria (a_fcriteria *criteria)
 set resistance criteria More...
 
bool ok () const
 check if forces on face are acceptable More...
 
double penalty () const
 penalty value used for optimization More...
 
void penalty_factor (const double v)
 set penalty factor More...
 
double penalty_factor () const
 get penalty factor More...
 
double objectivep () const
 get value of objective function + penalty*penalty_factor_ More...
 
void rotate (int rb, int f, const a_point &x, const a_point &dir, double r)
 rotate of angle r (rad) all blocks connected to rb, around x using axis dir More...
 
void rotate (int b, int f, double v, double r)
 rotate of angle r (rad) all blocks connected to b, around f, in the direction of opposite face to f More...
 
void slide (int b, int f, double u, double v)
 slide of (u,v) all blocks connected to b in the plane of f More...
 
void material (a_material *material)
 link a material More...
 
a_blockcompute (int b, int f)
 compute as far as possible the forces on the blocks, starting from block b, entrance face f, return the last block for which it succeeded More...
 
void compute (const int rb1, const int rf1, const double u1, const double v1, const int rb2, const int rf2, const double u2, const double v2, const int rb3, const int rf3, const double u3, const double v3)
 compute inside forces resulting in resistance line passing by 3 points More...
 
double min (const int face, const int rb1, const int rf1, const double u1, const int rb2, const int rf2, const double u2, const int rb3, const int rf3, const double u3)
 vary force on face to get a minimal objective function, respecting face criteria More...
 
double mindir (const a_point &dir, const int rb1, const int rf1, double &u1, const int rb2, const int rf2, double &u2, const int rb3, const int rf3, double &u3)
 vary force on faces (in proportion to dir) to get a minimal objective function, respecting face criteria More...
 
double max (const int face, const int rb1, const int rf1, const double u1, const int rb2, const int rf2, const double u2, const int rb3, const int rf3, const double u3)
 vary force on face to get a maximal objective function, respecting face criteria More...
 
void min (const int rb1, const int rf1, const int rb2, const int rf2)
 compute inside forces leading to a minimal objective function, respecting face criteria More...
 
void max (const int rb1, const int rf1, const int rb2, const int rf2)
 compute inside forces leading to a maximal objective function, respecting face criteria More...
 
void minsteep (const int rb1, const int rf1, const int rb2, const int rf2)
 
virtual void writetri (std::ostream &o) const
 write a triangle file More...
 
virtual void writeb (std::ostream &o) const
 write structure in blender format More...
 
virtual void writeg (std::ostream &o) const
 write structure in brlcad format More...
 
void trianglecloud (a_trianglecloud &) const
 
void polyline (a_linecloud &) const
 

Static Public Member Functions

static const std::string help ()
 get information about the class More...
 

Protected Member Functions

bool check_block (const int rb) const
 check whether references are in range More...
 
bool check_blockref (const int rb, const int rf) const
 check whether references are in range More...
 
bool faceonexit (const int rb1, const int rf1, const int rb2, const int rf2)
 check whether rf2 in an exit face More...
 
void midblock (const int rb1, const int rf1, const int rb2, const int rf2, a_block *&rb, int &rf)
 block and face in between two face blocks More...
 
void optimise (const bool is_min, const int rb1, const int rf1, const int rb2, const int rf2)
 compute inside forces leading to an optimal objective function, respecting face criteria More...
 
void storeexits (std::vector< int > &) const
 store face exits situation More...
 
void restoreexits (std::vector< int > &)
 restore face exits situation More...
 
double grad1 (const int rb1, const int rf1, const int rb2, const int rf2, const int rb3, const int rf3, const double *u)
 grad of objective function + penalty More...
 
double grad2 (const int rb1, const int rf1, const int rb2, const int rf2, const int rb3, const int rf3, const double *u)
 grad of objective function + penalty More...
 
double grad3 (const int rb1, const int rf1, const int rb2, const int rf2, const int rb3, const int rf3, const double *u)
 grad of objective function + penalty More...
 

Protected Attributes

std::vector< a_block * > blocks_
 
a_ocriteriaobjective_
 
double penalty_factor_
 

Friends

std::istream & operator>> (std::istream &i, a_structure &s)
 input/output More...
 
std::ostream & operator<< (std::ostream &o, const a_structure &s)
 

Detailed Description

structure class

Author
P.Smars
Date
2010-14
Warning
portability: ansi C++

Definition at line 32 of file a_structure.h.

Constructor & Destructor Documentation

◆ a_structure()

a_structure::a_structure ( )

Definition at line 37 of file a_structure.cxx.

◆ ~a_structure()

a_structure::~a_structure ( )

Definition at line 43 of file a_structure.cxx.

+ Here is the call graph for this function:

Member Function Documentation

◆ add_block()

int a_structure::add_block ( a_block b)

add a block to the structure

Definition at line 119 of file a_structure.cxx.

+ Here is the call graph for this function:

◆ b()

a_block * a_structure::b ( const int  i) const

get pointer to the block i

Definition at line 217 of file a_structure.cxx.

+ Here is the caller graph for this function:

◆ c()

a_point a_structure::c ( ) const

get centre of mass

Definition at line 144 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_block()

bool a_structure::check_block ( const int  rb) const
protected

check whether references are in range

check if range of rb is ok

Definition at line 439 of file a_structure.cxx.

+ Here is the call graph for this function:

◆ check_blockref()

bool a_structure::check_blockref ( const int  rb,
const int  rf 
) const
protected

check whether references are in range

check if range of rb is ok

check if range of rf is ok

Definition at line 448 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear()

void a_structure::clear ( )

Definition at line 48 of file a_structure.cxx.

+ Here is the caller graph for this function:

◆ clearall()

void a_structure::clearall ( )

clear all the forces on faces

Definition at line 278 of file a_structure.cxx.

◆ clearexternal()

void a_structure::clearexternal ( )

clear all the external face forces

Definition at line 272 of file a_structure.cxx.

◆ clearinternal()

void a_structure::clearinternal ( )

clear all the internal face forces

Definition at line 266 of file a_structure.cxx.

◆ compute() [1/2]

void a_structure::compute ( const int  rb1,
const int  rf1,
const double  u1,
const double  v1,
const int  rb2,
const int  rf2,
const double  u2,
const double  v2,
const int  rb3,
const int  rf3,
const double  u3,
const double  v3 
)

compute inside forces resulting in resistance line passing by 3 points

check if range of rb is ok

reset the forces on the exit faces of the arch

check whether b2 is in between b1 and b3 compute forces

face is on entrance b2 should be changed

weight in between 1&2 and 2&3

faces of passage

points of passage

compute in one direction

compute in other direction

Definition at line 460 of file a_structure.cxx.

+ Here is the call graph for this function:

◆ compute() [2/2]

a_block * a_structure::compute ( int  b,
int  f 
)

compute as far as possible the forces on the blocks, starting from block b, entrance face f, return the last block for which it succeeded

Definition at line 419 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ connected()

bool a_structure::connected ( ) const

check whether all blocks are connected

Definition at line 223 of file a_structure.cxx.

+ Here is the call graph for this function:

◆ criteria()

void a_structure::criteria ( a_fcriteria criteria)

set resistance criteria

Definition at line 295 of file a_structure.cxx.

◆ faceonexit()

bool a_structure::faceonexit ( const int  rb1,
const int  rf1,
const int  rb2,
const int  rf2 
)
protected

check whether rf2 in an exit face

Definition at line 384 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fe()

a_wrench a_structure::fe ( )

get external force on structure (wrench)

Definition at line 181 of file a_structure.cxx.

◆ ft()

a_wrench a_structure::ft ( )

get total force on structure fe+W (wrench)

Definition at line 189 of file a_structure.cxx.

◆ grad1()

double a_structure::grad1 ( const int  rb1,
const int  rf1,
const int  rb2,
const int  rf2,
const int  rb3,
const int  rf3,
const double *  u 
)
protected

grad of objective function + penalty

Definition at line 651 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ grad2()

double a_structure::grad2 ( const int  rb1,
const int  rf1,
const int  rb2,
const int  rf2,
const int  rb3,
const int  rf3,
const double *  u 
)
protected

grad of objective function + penalty

Definition at line 664 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ grad3()

double a_structure::grad3 ( const int  rb1,
const int  rf1,
const int  rb2,
const int  rf2,
const int  rb3,
const int  rf3,
const double *  u 
)
protected

grad of objective function + penalty

Definition at line 677 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ help()

const std::string a_structure::help ( )
static

get information about the class

Definition at line 54 of file a_structure.cxx.

+ Here is the caller graph for this function:

◆ in()

std::vector< int > a_structure::in ( ) const

get list of internal blocks (blocks connected at least to 2 other blocks)

Definition at line 244 of file a_structure.cxx.

+ Here is the caller graph for this function:

◆ link_blocks()

void a_structure::link_blocks ( int  b1,
int  f1,
int  b2,
int  f2 
)

link 2 blocks: [b1: ref_block1, f1: ref_face1, b2:...]

Definition at line 205 of file a_structure.cxx.

+ Here is the call graph for this function:

◆ m()

double a_structure::m ( ) const

mass

Definition at line 157 of file a_structure.cxx.

◆ material()

void a_structure::material ( a_material material)

link a material

Definition at line 365 of file a_structure.cxx.

◆ max() [1/2]

double a_structure::max ( const int  face,
const int  rb1,
const int  rf1,
const double  u1,
const int  rb2,
const int  rf2,
const double  u2,
const int  rb3,
const int  rf3,
const double  u3 
)

vary force on face to get a maximal objective function, respecting face criteria

Definition at line 875 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ max() [2/2]

void a_structure::max ( const int  rb1,
const int  rf1,
const int  rb2,
const int  rf2 
)

compute inside forces leading to a maximal objective function, respecting face criteria

Definition at line 645 of file a_structure.cxx.

+ Here is the call graph for this function:

◆ midblock()

void a_structure::midblock ( const int  rb1,
const int  rf1,
const int  rb2,
const int  rf2,
a_block *&  rb,
int &  rf 
)
protected

block and face in between two face blocks

check if ranges are ok

get pointers

Definition at line 543 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ min() [1/2]

double a_structure::min ( const int  face,
const int  rb1,
const int  rf1,
const double  u1,
const int  rb2,
const int  rf2,
const double  u2,
const int  rb3,
const int  rf3,
const double  u3 
)

vary force on face to get a minimal objective function, respecting face criteria

Definition at line 792 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ min() [2/2]

void a_structure::min ( const int  rb1,
const int  rf1,
const int  rb2,
const int  rf2 
)

compute inside forces leading to a minimal objective function, respecting face criteria

Definition at line 769 of file a_structure.cxx.

+ Here is the call graph for this function:

◆ mindir()

double a_structure::mindir ( const a_point &  dir,
const int  rb1,
const int  rf1,
double &  u1,
const int  rb2,
const int  rf2,
double &  u2,
const int  rb3,
const int  rf3,
double &  u3 
)

vary force on faces (in proportion to dir) to get a minimal objective function, respecting face criteria

Definition at line 838 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ minsteep()

void a_structure::minsteep ( const int  rb1,
const int  rf1,
const int  rb2,
const int  rf2 
)

Definition at line 690 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nb()

int a_structure::nb ( ) const
inline

get number of blocks

Definition at line 41 of file a_structure.h.

+ Here is the caller graph for this function:

◆ nodes()

std::vector< int > a_structure::nodes ( ) const

get list of blocks connected to more than 2 other blocks (sources of hyperstaticity)

Definition at line 255 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ objective() [1/2]

double a_structure::objective ( ) const

get value of objective function

Definition at line 284 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ objective() [2/2]

void a_structure::objective ( a_ocriteria objective)
inline

set objective function (used for optimisation)

Definition at line 81 of file a_structure.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ objectivep()

double a_structure::objectivep ( ) const

get value of objective function + penalty*penalty_factor_

Definition at line 290 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ok()

bool a_structure::ok ( ) const

check if forces on face are acceptable

Definition at line 301 of file a_structure.cxx.

◆ optimise()

void a_structure::optimise ( const bool  is_min,
const int  rb1,
const int  rf1,
const int  rb2,
const int  rf2 
)
protected

compute inside forces leading to an optimal objective function, respecting face criteria

Definition at line 724 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ out()

std::vector< int > a_structure::out ( ) const

get list of extreme blocks (blocks connected only to 1 other block)

Definition at line 233 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ penalty()

double a_structure::penalty ( ) const

penalty value used for optimization

Definition at line 311 of file a_structure.cxx.

+ Here is the caller graph for this function:

◆ penalty_factor() [1/2]

double a_structure::penalty_factor ( ) const
inline

get penalty factor

Definition at line 93 of file a_structure.h.

◆ penalty_factor() [2/2]

void a_structure::penalty_factor ( const double  v)
inline

set penalty factor

Definition at line 91 of file a_structure.h.

◆ polyline()

void a_structure::polyline ( a_linecloud &  li) const

Definition at line 961 of file a_structure.cxx.

+ Here is the call graph for this function:

◆ potential()

double a_structure::potential ( ) const

get potential energy

Definition at line 197 of file a_structure.cxx.

◆ rb()

int a_structure::rb ( const a_block b) const

get reference of a block (-1 if no block)

Definition at line 125 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ restoreexits()

void a_structure::restoreexits ( std::vector< int > &  exits)
protected

restore face exits situation

Definition at line 377 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rotate() [1/2]

void a_structure::rotate ( int  b,
int  f,
double  v,
double  r 
)

rotate of angle r (rad) all blocks connected to b, around f, in the direction of opposite face to f

Definition at line 337 of file a_structure.cxx.

+ Here is the call graph for this function:

◆ rotate() [2/2]

void a_structure::rotate ( int  rb,
int  f,
const a_point &  x,
const a_point &  dir,
double  r 
)

rotate of angle r (rad) all blocks connected to rb, around x using axis dir

Definition at line 324 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ slide()

void a_structure::slide ( int  b,
int  f,
double  u,
double  v 
)

slide of (u,v) all blocks connected to b in the plane of f

Definition at line 348 of file a_structure.cxx.

+ Here is the call graph for this function:

◆ storeexits()

void a_structure::storeexits ( std::vector< int > &  exits) const
protected

store face exits situation

Definition at line 371 of file a_structure.cxx.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ trianglecloud()

void a_structure::trianglecloud ( a_trianglecloud &  tri) const

Definition at line 954 of file a_structure.cxx.

+ Here is the caller graph for this function:

◆ V()

double a_structure::V ( ) const

get volume of structure

Definition at line 136 of file a_structure.cxx.

◆ W()

a_wrench a_structure::W ( )

get weight (wrench)

Definition at line 173 of file a_structure.cxx.

◆ writeb()

void a_structure::writeb ( std::ostream &  o) const
virtual

write structure in blender format

Definition at line 930 of file a_structure.cxx.

◆ writeg()

void a_structure::writeg ( std::ostream &  o) const
virtual

write structure in brlcad format

Definition at line 939 of file a_structure.cxx.

◆ writetri()

void a_structure::writetri ( std::ostream &  o) const
virtual

write a triangle file

Definition at line 922 of file a_structure.cxx.

+ Here is the call graph for this function:

◆ Ws()

double a_structure::Ws ( ) const

get weight (scalar)

Definition at line 165 of file a_structure.cxx.

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  o,
const a_structure s 
)
friend

Definition at line 1004 of file a_structure.cxx.

◆ operator>>

std::istream& operator>> ( std::istream &  i,
a_structure s 
)
friend

input/output

Definition at line 991 of file a_structure.cxx.

Member Data Documentation

◆ blocks_

std::vector<a_block *> a_structure::blocks_
protected

Definition at line 187 of file a_structure.h.

◆ objective_

a_ocriteria* a_structure::objective_
protected

Definition at line 188 of file a_structure.h.

◆ penalty_factor_

double a_structure::penalty_factor_
protected

Definition at line 189 of file a_structure.h.


The documentation for this class was generated from the following files: