| 282 | } |
| 283 | |
| 284 | int |
| 285 | PVDRecorder::vtu() |
| 286 | { |
| 287 | if (theDomain == 0) { |
| 288 | opserr << "WARNING: failed to get domain -- PVDRecorder::vtu\n"; |
| 289 | return -1; |
| 290 | } |
| 291 | // get node ndf |
| 292 | NodeIter& theNodes = theDomain->getNodes(); |
| 293 | Node* theNode = 0; |
| 294 | int nodendf = 0; |
| 295 | while ((theNode = theNodes()) != 0) { |
| 296 | if(nodendf < theNode->getNumberDOF()) { |
| 297 | nodendf = theNode->getNumberDOF(); |
| 298 | } |
| 299 | } |
| 300 | if (nodendf < 3) { |
| 301 | nodendf = 3; |
| 302 | } else if (nodendf > 3) { |
| 303 | nodendf = 3; |
| 304 | } |
| 305 | |
| 306 | // get parts |
| 307 | this->getParts(); |
| 308 | |
| 309 | // get background mesh |
| 310 | VInt gtags; |
| 311 | TaggedObjectIter& meshes = OPS_getAllMesh(); |
| 312 | Mesh* mesh = 0; |
| 313 | while((mesh = dynamic_cast<Mesh*>(meshes())) != 0) { |
| 314 | ParticleGroup* group = dynamic_cast<ParticleGroup*>(mesh); |
| 315 | if (group == 0) { |
| 316 | continue; |
| 317 | } |
| 318 | gtags.push_back(group->getTag()); |
| 319 | } |
| 320 | |
| 321 | |
| 322 | // part 0: all nodes |
| 323 | ID partno(0, (int)parts.size()+(int)gtags.size()+1); |
| 324 | partno[0] = 0; |
| 325 | if (this->savePart0(nodendf) < 0) { |
| 326 | return -1; |
| 327 | } |
| 328 | |
| 329 | // particle parts |
| 330 | for (int i=0; i<(int)gtags.size(); ++i) { |
| 331 | partno[1+i] = 1+i; |
| 332 | if (this->savePartParticle(1+i, gtags[i],nodendf) < 0) { |
| 333 | return -1; |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | // save other parts |
| 338 | // int index = 1; |
| 339 | for(std::map<int,ID>::iterator it=parts.begin(); it!=parts.end(); it++) { |
| 340 | // int& no = partnum[it->first]; |
| 341 | // if (no == 0) { |
nothing calls this directly
no test coverage detected