gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
frameSolver.h
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 
6 #ifndef FRAME_SOLVER_H
7 #define FRAME_SOLVER_H
8 
9 class GVertex;
10 
11 #include <map>
12 #include <string>
13 #include "PView.h"
14 #include "dofManager.h"
15 #include "fullMatrix.h"
16 #include "MLine.h"
17 
18 struct gmshBeam2d {
20  double _i, _a, _e, _l;
21  bool _rigidNodes[2];
22  double _forceVector[6];
23  double _displacement[6];
24  int _rotationTags[2];
26  gmshBeam2d(MLine *l, double E, double I, double A, int r[2])
27  : _element(l), _i(I), _a(A), _e(E)
28  {
30  _rotationTags[0] = _rotationTags[1] = 0;
31  _rigidNodes[0] = r[0];
32  _rigidNodes[1] = r[1];
33  for(int i = 0; i < 6; i++) _displacement[i] = 0.;
34  }
35  inline bool isRigid(MVertex *v) const
36  {
37  return _element->getVertex(0) == v ? _rigidNodes[0] : _rigidNodes[1];
38  }
39  inline void setRotationTag(MVertex *v, int tag)
40  {
41  _element->getVertex(0) == v ? _rotationTags[0] = tag :
42  _rotationTags[1] = tag;
43  }
44 };
45 
46 struct gmshFixation {
49  double _value;
50  gmshFixation(GVertex *v, int d, double val)
51  : _vertex(v), _direction(d), _value(val)
52  {
53  }
54 };
55 
56 // a solver that computes equilibriums of frames...
59  std::vector<gmshBeam2d> _beams;
60  std::vector<std::pair<GVertex *, std::vector<double> > > _nodalForces;
61  std::vector<gmshFixation> _fixations;
63  void computeStiffnessMatrix(int iBeam, fullMatrix<double> &K);
64  void createDofs();
65  void computeRotationTags();
66  void addBeamsOrBars(const std::vector<int> &modelEdges, double E, double I,
67  double A, int r[2]);
68 
69 public:
70  frameSolver2d(GModel *myModel);
71  void addBeams(const std::vector<int> &modelEdges, double E, double I,
72  double A);
73  void addBars(const std::vector<int> &modelEdges, double E, double I,
74  double A);
75  void addNodalForces(const std::vector<int> &modelVertices,
76  const std::vector<double> &force);
77  void addFixations(const std::vector<int> &dirs,
78  const std::vector<int> &modelVertices, double value);
79  void exportFrameData(const char *displ, const char *M);
80  void solve();
81 };
82 
83 #endif
distance
double distance(MVertex *v1, MVertex *v2)
Definition: MVertex.h:245
MLine::getVertex
virtual MVertex * getVertex(int num)
Definition: MLine.h:45
gmshBeam2d::gmshBeam2d
gmshBeam2d(MLine *l, double E, double I, double A, int r[2])
Definition: frameSolver.h:26
gmshBeam2d::_forceVector
double _forceVector[6]
Definition: frameSolver.h:22
MVertex
Definition: MVertex.h:24
frameSolver2d::pAssembler
dofManager< double > * pAssembler
Definition: frameSolver.h:58
frameSolver2d::_myModel
GModel * _myModel
Definition: frameSolver.h:62
gmshFixation::_vertex
GVertex * _vertex
Definition: frameSolver.h:47
PView.h
gmshBeam2d::_i
double _i
Definition: frameSolver.h:20
gmshBeam2d
Definition: frameSolver.h:18
frameSolver2d::_fixations
std::vector< gmshFixation > _fixations
Definition: frameSolver.h:61
frameSolver2d::addBars
void addBars(const std::vector< int > &modelEdges, double E, double I, double A)
Definition: frameSolver.cpp:78
MLine.h
gmshFixation::_direction
int _direction
Definition: frameSolver.h:48
MLine
Definition: MLine.h:21
frameSolver2d::_nodalForces
std::vector< std::pair< GVertex *, std::vector< double > > > _nodalForces
Definition: frameSolver.h:60
fullMatrix< double >
gmshBeam2d::_stiffness
fullMatrix< double > _stiffness
Definition: frameSolver.h:25
gmshBeam2d::_element
MLine * _element
Definition: frameSolver.h:19
GVertex
Definition: GVertex.h:23
frameSolver2d::frameSolver2d
frameSolver2d(GModel *myModel)
Definition: frameSolver.cpp:20
GModel
Definition: GModel.h:44
gmshBeam2d::_rotationTags
int _rotationTags[2]
Definition: frameSolver.h:24
frameSolver2d::_beams
std::vector< gmshBeam2d > _beams
Definition: frameSolver.h:59
gmshBeam2d::isRigid
bool isRigid(MVertex *v) const
Definition: frameSolver.h:35
gmshBeam2d::_rigidNodes
bool _rigidNodes[2]
Definition: frameSolver.h:21
gmshFixation::gmshFixation
gmshFixation(GVertex *v, int d, double val)
Definition: frameSolver.h:50
dofManager< double >
frameSolver2d::computeRotationTags
void computeRotationTags()
Definition: frameSolver.cpp:277
dofManager.h
frameSolver2d::exportFrameData
void exportFrameData(const char *displ, const char *M)
Definition: frameSolver.cpp:239
frameSolver2d::addBeamsOrBars
void addBeamsOrBars(const std::vector< int > &modelEdges, double E, double I, double A, int r[2])
Definition: frameSolver.cpp:47
frameSolver2d
Definition: frameSolver.h:57
gmshBeam2d::_displacement
double _displacement[6]
Definition: frameSolver.h:23
frameSolver2d::addBeams
void addBeams(const std::vector< int > &modelEdges, double E, double I, double A)
Definition: frameSolver.cpp:71
gmshFixation
Definition: frameSolver.h:46
frameSolver2d::addFixations
void addFixations(const std::vector< int > &dirs, const std::vector< int > &modelVertices, double value)
Definition: frameSolver.cpp:22
frameSolver2d::solve
void solve()
Definition: frameSolver.cpp:164
frameSolver2d::addNodalForces
void addNodalForces(const std::vector< int > &modelVertices, const std::vector< double > &force)
Definition: frameSolver.cpp:36
gmshBeam2d::_a
double _a
Definition: frameSolver.h:20
gmshBeam2d::setRotationTag
void setRotationTag(MVertex *v, int tag)
Definition: frameSolver.h:39
gmshBeam2d::_e
double _e
Definition: frameSolver.h:20
gmshFixation::_value
double _value
Definition: frameSolver.h:49
fullMatrix.h
frameSolver2d::createDofs
void createDofs()
Definition: frameSolver.cpp:94
frameSolver2d::computeStiffnessMatrix
void computeStiffnessMatrix(int iBeam, fullMatrix< double > &K)
Definition: frameSolver.cpp:126
gmshBeam2d::_l
double _l
Definition: frameSolver.h:20