MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / mesh

Method mesh

SRC/element/PFEMElement/QuadMeshGenerator.cpp:41–190  ·  view source on GitHub ↗

mesh

Source from the content-addressed store, hash-verified

39
40// mesh
41int
42QuadMeshGenerator::mesh(double size)
43{
44 if (size <= 0) return -1;
45 if (line.size() != 4) {
46 opserr << "WARNING: must have four lines to mesh quad\n";
47 return -1;
48 }
49
50 // copy point to pointout
51 clearOutput();
52 pointout = point;
53
54 // the lines are assumed to be continues in a loop
55 int m = line[0].Size()-1;
56 int n = line[1].Size()-1;
57 if (m != line[2].Size()-1) {
58 opserr << "WARNING: opposite lines must have same number of points\n";
59 return -1;
60 }
61
62 if (n != line[3].Size()-1) {
63 opserr << "WARNING: opposite lines must have same number of points\n";
64 return -1;
65 }
66
67 // order of the lines
68 int order[4] = {0,0,0,0};
69 int next[4] = {0,0,0,0};
70 if (line[0][0] == line[1][0]) {
71 order[0] = 1;
72 order[1] = 0;
73 next[0] = 0;
74 next[1] = n;
75 } else if (line[0][0] == line[1][n]) {
76 order[0] = 1;
77 order[1] = 1;
78 next[0] = 0;
79 next[1] = 0;
80 } else if (line[0][m] == line[1][0]) {
81 order[0] = 0;
82 order[1] = 0;
83 next[0] = m;
84 next[1] = n;
85 } else if (line[0][m] == line[1][n]) {
86 order[0] = 0;
87 order[1] = 1;
88 next[0] = m;
89 next[1] = 0;
90 } else {
91 opserr << "WARNING: line 0 and 1 are not connected\n";
92 return -1;
93 }
94
95 if (line[1][next[1]] == line[2][0]) {
96 order[2] = 0;
97 next[2] = m;
98 } else if (line[1][next[1]] == line[2][m]) {

Callers

nothing calls this directly

Calls 4

push_backMethod · 0.80
sizeMethod · 0.45
SizeMethod · 0.45
addVectorMethod · 0.45

Tested by

no test coverage detected