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

Method gridNodes

SRC/element/PFEMElement/BackgroundMesh.cpp:1269–1512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1267}
1268
1269int 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

Callers

nothing calls this directly

Calls 15

normVDoubleFunction · 0.85
toVectorFunction · 0.85
push_backMethod · 0.80
getCrdsMethod · 0.80
OPS_GetNDMFunction · 0.70
OPS_GetDomainFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getTypeMethod · 0.45
getVelMethod · 0.45
getPressureMethod · 0.45

Tested by

no test coverage detected