6 #include "GmshConfig.h"
15 #if defined(HAVE_POST)
23 const std::vector<int> &modelVertices,
26 for(std::size_t j = 0; j < modelVertices.size(); j++) {
29 for(std::size_t i = 0; i < dirs.size(); i++) {
37 const std::vector<double> &force)
39 for(std::size_t j = 0; j < modelVertices.size(); j++) {
48 double I,
double A,
int r[2])
50 int r_middle[2] = {1, 1}, r_left[2] = {r[0], 1}, r_right[2] = {0, r[1]};
52 for(std::size_t i = 0; i < modelEdges.size(); i++) {
56 for(std::size_t j = 0; j < ge->
lines.size(); ++j) {
58 if(j == 0 && j == ge->
lines.size() - 1)
62 else if(j == ge->
lines.size() - 1)
97 for(std::size_t i = 0; i <
_fixations.size(); ++i) {
101 MVertex *v =
f._vertex->mesh_vertices[0];
109 for(std::size_t i = 0; i <
_beams.size(); i++) {
112 for(std::size_t j = 0; j < 2; j++) {
129 const double BS = b.
_e * b.
_i / (b.
_l * b.
_l * b.
_l);
130 const double TS = b.
_e * b.
_a / b.
_l;
133 const double alpha = atan2(v2->
y() - v1->
y(), v2->
x() - v1->
x());
134 const double C = cos(alpha);
135 const double S = sin(alpha);
137 printf(
"beam %d %g %g %g\n", iBeam, alpha, C,
S);
140 R(0, 0) = R(1, 1) = R(3, 3) = R(4, 4) = C;
141 R(0, 1) = R(3, 4) =
S;
142 R(1, 0) = R(4, 3) = -
S;
143 R(2, 2) = R(5, 5) = 1.0;
148 k(0, 0) = k(3, 3) = TS;
149 k(0, 3) = k(3, 0) = -TS;
151 k(1, 1) = k(4, 4) = 12 * BS;
152 k(2, 2) = k(5, 5) = 4. * BS * b.
_l * b.
_l;
153 k(1, 2) = k(2, 1) = k(1, 5) = k(5, 1) = 6 * BS * b.
_l;
154 k(4, 2) = k(2, 4) = k(4, 5) = k(5, 4) = -6 * BS * b.
_l;
155 k(4, 1) = k(1, 4) = -12 * BS;
156 k(5, 2) = k(2, 5) = -2 * BS * b.
_l * b.
_l;
159 Rt.transposeInPlace();
166 #if defined(HAVE_PETSC)
168 #elif defined(HAVE_GMM)
186 MVertex *v = it->first->mesh_vertices[0];
187 const std::vector<double> &
F = it->second;
195 for(std::size_t i = 0; i <
_beams.size(); i++) {
209 Dof DOFS[6] = {U0, V0, theta0, U1, V1, theta1};
210 for(
int j = 0; j < 6; j++) {
211 for(
int k = 0; k < 6; k++) {
219 for(std::size_t i = 0; i <
_beams.size(); i++) {
230 Dof DOFS[6] = {U0, V0, theta0, U1, V1, theta1};
231 for(
int j = 0; j < 6; j++) {
241 #if defined(HAVE_POST)
243 std::map<int, std::vector<double> > data;
244 for(std::size_t i = 0; i <
_beams.size(); i++) {
245 std::vector<double> tmp;
250 for(
int j = 0; j < 6; j++) {
251 tmp.push_back(
_beams[i]._displacement[j]);
253 data[
_beams[i]._element->getNum()] = tmp;
260 std::map<int, std::vector<double> > data;
261 for(std::size_t i = 0; i <
_beams.size(); i++) {
262 std::vector<double> tmp;
264 _beams[i]._stiffness.mult(d,
F);
265 tmp.push_back(-
F(2));
267 data[
_beams[i]._element->getNum()] = tmp;
270 new PView(
"Momentum",
"ElementNodeData",
_myModel, data, 0.0, 1);
279 std::multimap<MVertex *, gmshBeam2d *> v2b;
280 for(std::size_t i = 0; i <
_beams.size(); i++) {
281 v2b.insert(std::make_pair(
_beams[i]._element->getVertex(0), &
_beams[i]));
282 v2b.insert(std::make_pair(
_beams[i]._element->getVertex(1), &
_beams[i]));
285 std::multimap<MVertex *, gmshBeam2d *>::iterator s_it;
286 for(
auto it = v2b.begin(); it != v2b.end(); it = s_it) {
289 std::pair<std::multimap<MVertex *, gmshBeam2d *>::iterator,
290 std::multimap<MVertex *, gmshBeam2d *>::iterator>
291 keyRange = v2b.equal_range(theKey);
292 int countRotules = 0;
293 for(s_it = keyRange.first; s_it != keyRange.second; ++s_it) {