Reads in the geometry property file on rank 0 and distributes the information among the processes.
453 {
454 TRACE();
455
456 MInt noVariables = 0;
457 const char MPropertySeperator = '.';
458
460
462 m_log <<
" * reading rest of the properties" << endl;
463
464
466 vector<MString> varNames = parallelIo->getDatasetNames();
467 noVariables = varNames.size();
468
469 for(
MInt id = 0;
id < noVariables;
id++) {
470 varName = varNames[
id];
471
472 if(!strstr(varName.c_str(), ".")) {
473
474
475
476
477 DEBUG("GeometryIONetcdf::readNCPropertyFile default property : " << varName, MAIA_DEBUG_USER1);
480 p->name.append(varName);
482 }
483
484 else {
485 if(strstr(varName.c_str(), "_bodies.")) {
486 DEBUG("GeometryIONetcdf::readPropertyFile normal property: " << varName, MAIA_DEBUG_USER1);
488 noDims = parallelIo->getDatasetNoDims(varName);
491 DEBUG("GeometryIONetcdf::readPropertyFile no of dimensions = " << noDims, MAIA_DEBUG_USER1);
492 switch(noDims) {
493 case 0: {
494
496 parallelIo->readScalar(&buf, varName);
498 break;
499 }
500 case 1: {
501
504 parallelIo->setOffset(length, 0);
505 parallelIo->readArray(&buf, varName);
507 break;
508 }
509 case 2: {
510
512 dbodies = parallelIo->getArraySize(varName, 0);
513 noBodies = (
MInt)dbodies;
514 bodies =
new MString[noBodies];
516
517 for(
MInt i = 0; i < noBodies; i++) {
518 start = i;
519 parallelIo->setOffset(1, start, 2);
521 parallelIo->readArray(&buf, varName);
522 (bodies[i]).append(buf);
523 DEBUG("GeometryIONetcdf::readPropertyFile " << bodies[i], MAIA_DEBUG_USER1);
524 }
525 break;
526 }
527 default: {
528 }
529 }
530
531
532 list<MInt> segmentList;
533 for(
MInt i = 0; i != noBodies; i++) {
534 DEBUG("GeometryIONetcdf::readPropertyFile definition for body " << bodies[i], MAIA_DEBUG_USER1);
536
538
539 for(
MInt j = 0; j < zI->second->noSegments; j++)
540 segmentList.push_back(zI->second->segments[j]);
541 }
542
543 char* du;
544 du = strrchr(
const_cast<MChar*
>(varName.c_str()), MPropertySeperator);
546
547 dummy.replace(dummy.find("_bodies."), dummy.size(), du);
548 DEBUG("GeometryIONetcdf::readPropertyFile found property : " << dummy, MAIA_DEBUG_USER1);
549
550
551 list<MInt>::const_iterator it = segmentList.begin();
552 dummy.erase(dummy.find("."));
553
554 for(; it != segmentList.end(); it++) {
557 p->name.append(dummy);
559 DEBUG("GeometryIONetcdf::readPropertyFile created property for solver " << *it, MAIA_DEBUG_USER1);
560 }
561 }
562 else {
563
564 char* du;
565 du = strrchr(
const_cast<MChar*
>(varName.c_str()), MPropertySeperator) + 1;
566 MInt singleSegmentId = atoi(du);
567
569
570 if(singleSegmentId || *du == '0') {
571 DEBUG("Found single segment property definition for segment " << singleSegmentId, MAIA_DEBUG_IO);
573 p->segmentId = singleSegmentId;
574
576
577 dummyName.erase(dummyName.find("."));
578 p->name.append(dummyName);
580 }
581 }
582 }
583 }
584
586 DEBUG("GeometryIONetcdf::readPropertyFile ** Property check successful \n", MAIA_DEBUG_USER1);
587 }
588 }
589}
MBool checkGeometryPropertyConsistency()
bodyMap::const_iterator bodyIterator