| 1267 | } |
| 1268 | |
| 1269 | int BackgroundMesh::gridNodes() { |
| 1270 | // get domain |
| 1271 | int ndm = OPS_GetNDM(); |
| 1272 | Domain* domain = OPS_GetDomain(); |
| 1273 | if (domain == 0) return 0; |
| 1274 | |
| 1275 | // vector of iterators |
| 1276 | std::vector<std::map<VInt, BNode>::iterator> iters; |
| 1277 | iters.reserve(bnodes.size()); |
| 1278 | for (std::map<VInt, BNode>::iterator it = bnodes.begin(); |
| 1279 | it != bnodes.end(); ++it) { |
| 1280 | iters.push_back(it); |
| 1281 | } |
| 1282 | |
| 1283 | // vector of new objects |
| 1284 | int ndtag = Mesh::nextNodeTag(); |
| 1285 | std::vector<Node*> newnodes(iters.size(), 0), |
| 1286 | newpnodes(iters.size(), 0); |
| 1287 | std::vector<Pressure_Constraint*> newpcs(iters.size(), 0); |
| 1288 | |
| 1289 | int res = 0; |
| 1290 | |
| 1291 | #pragma omp parallel for |
| 1292 | for (int j = 0; j < (int)iters.size(); ++j) { |
| 1293 | // get iterator |
| 1294 | std::map<VInt, BNode>::iterator it = iters[j]; |
| 1295 | |
| 1296 | // get cell |
| 1297 | const VInt& index = it->first; |
| 1298 | BNode& bnode = it->second; |
| 1299 | if (bnode.getType() == BACKGROUND_FIXED) { |
| 1300 | continue; |
| 1301 | } |
| 1302 | |
| 1303 | // coordinates |
| 1304 | VDouble crds; |
| 1305 | getCrds(index, crds); |
| 1306 | |
| 1307 | // get particles |
| 1308 | VParticle pts; |
| 1309 | VInt minind = index; |
| 1310 | VInt maxind = index; |
| 1311 | minind -= numave; |
| 1312 | maxind += numave; |
| 1313 | gatherParticles(minind, maxind, pts); |
| 1314 | |
| 1315 | // get information |
| 1316 | double wt = 0.0, pre = 0.0, pdot = 0.0; |
| 1317 | VDouble vel(ndm), accel(ndm); |
| 1318 | for (int i = 0; i < (int)pts.size(); ++i) { |
| 1319 | // get particle |
| 1320 | if (pts[i] == 0) { |
| 1321 | continue; |
| 1322 | } |
| 1323 | |
| 1324 | // particle coordinates |
| 1325 | const VDouble& pcrds = pts[i]->getCrds(); |
| 1326 |
nothing calls this directly
no test coverage detected