28 return "Plugin(DiscretizationError) computes the error between the mesh "
29 "and the geometry. It does so by supersampling the elements and "
31 "the distance between the supersampled points dans their projection "
50 double paramQuandt = 1.0 / (nEdgeNodes - 1) - 10 * tol;
51 double paramQuandtQuad = 2.0 / (nEdgeNodes - 1) - 10 * tol;
54 double startEstimate[2] = {0.5, 0.5};
57 std::vector<std::pair<SPoint3, double> > quadDist(nEdgeNodes * nEdgeNodes);
58 std::vector<std::pair<SPoint3, double> > triDist((nEdgeNodes + 1) *
72 for(
auto itQuad = (*itFace)->quadrangles.begin();
73 itQuad != (*itFace)->quadrangles.end(); ++itQuad) {
74 for(j = 0; j < nEdgeNodes; j++) {
75 for(i = 0; i < nEdgeNodes; i++) {
76 (*itQuad)->pnt(-1 + 5 * tol + paramQuandtQuad * i,
77 -1 + 5 * tol + paramQuandtQuad * j, 0.0,
78 quadDist[j * (nEdgeNodes) + i].first);
79 SPoint3 *point = &quadDist[j * (nEdgeNodes) + i].first;
80 GPoint closest = (*itFace)->closestPoint(*point, startEstimate);
84 quadDist[j * (nEdgeNodes) + i].second =
85 sqrt(dx * dx + dy * dy + dz * dz);
88 for(j = 0; j < nEdgeNodes - 1; j++) {
89 for(i = 0; i < nEdgeNodes - 1; i++) {
91 int indices[4] = {i + j * nEdgeNodes, i + j * nEdgeNodes + 1,
92 i + (j + 1) * nEdgeNodes + 1,
93 i + (j + 1) * nEdgeNodes};
94 for(k = 0; k < 4; k++) out->push_back(quadDist[indices[k]].first.x());
95 for(k = 0; k < 4; k++) out->push_back(quadDist[indices[k]].first.y());
96 for(k = 0; k < 4; k++) out->push_back(quadDist[indices[k]].first.z());
97 for(k = 0; k < 4; k++) out->push_back(quadDist[indices[k]].second);
108 for(
auto itTri = (*itFace)->triangles.begin();
109 itTri != (*itFace)->triangles.end(); ++itTri) {
111 for(i = 0; i < nEdgeNodes; i++) {
112 for(j = 0; j < (i + 1); j++) {
113 (*itTri)->pnt(5 * tol + paramQuandt * (i - j),
114 5 * tol + paramQuandt * j, 0.0, triDist[counter].first);
116 &triDist[counter].first;
117 GPoint closest = (*itFace)->closestPoint(*point, startEstimate);
121 triDist[counter].second = sqrt(dx * dx + dy * dy + dz * dz);
127 for(j = 0; j < nEdgeNodes - 1; j++) {
129 for(i = 0; i < j * 2 + 1; i++) {
131 indices[0] = i / 2 + (j + 1) * j / 2;
132 indices[1] = i / 2 + (j + 1) * j / 2 + j + 1;
133 indices[2] = i / 2 + (j + 1) * j / 2 + j + 2;
136 indices[0] = (i - 1) / 2 + (j + 1) * j / 2;
137 indices[1] = (i - 1) / 2 + (j + 1) * j / 2 + j + 2;
138 indices[2] = (i - 1) / 2 + (j + 1) * j / 2 + 1;
141 for(k = 0; k < 3; k++) out->push_back(triDist[indices[k]].first.x());
142 for(k = 0; k < 3; k++) out->push_back(triDist[indices[k]].first.y());
143 for(k = 0; k < 3; k++) out->push_back(triDist[indices[k]].first.z());
144 for(k = 0; k < 3; k++) out->push_back(triDist[indices[k]].second);
153 data2->
setName(
"Discretization Error");