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

Method write_element_data

SRC/recorder/GmshRecorder.cpp:651–800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649
650
651int
652GmshRecorder::write_element_data()
653{
654
655 int rank = 0;
656 int nproc = 1;
657
658#ifdef _PARALLEL_PROCESSING
659 rank =theMachineBroker->getPID();
660 nproc =theMachineBroker->getNP();
661#endif
662
663 DEBUGSTREAM << "GmshRecorder -- Saving mesh for rank ---> " << rank << endln;
664
665 if (theDomain == 0) {
666 opserr << "GmshRecorder::write_data() - WARNING: setDomain has not been called -- GmshRecorder\n";
667 return -1;
668 }
669
670 // get time and part
671 std::stringstream ss;
672 ss.precision(precision);
673 ss << std::scientific;
674 ss << 0 << ' ' << timestep.back();
675 std::string stime, spart;
676 ss >> spart >> stime;
677
678
679 // open file
680 std::stringstream ssmshname;
681 ssmshname << filename << ".eledata." << rank << ".msh";
682 std::string mshname = ssmshname.str();
683
684
685 DEBUGSTREAM << "mshname = " << mshname.c_str() << endln;
686
687 if(!theFile.is_open())
688 {
689 if(write_binary_mode)
690 {
691 theFile.open(mshname.c_str(), std::ios::trunc | std::ios::out | std::ios::binary);
692 }
693 else
694 {
695 theFile.open(mshname.c_str(), std::ios::trunc | std::ios::out | std::ios::binary);
696 }
697
698
699 if (theFile.fail()) {
700 opserr << "WARNING: Failed to open file " << mshname.c_str() << "\n";
701 return -1;
702 }
703 theFile.precision(precision);
704 theFile << std::scientific;
705
706 write_header();
707 }
708

Callers

nothing calls this directly

Calls 11

getPIDMethod · 0.80
getNPMethod · 0.80
precisionMethod · 0.45
strMethod · 0.45
openMethod · 0.45
sizeMethod · 0.45
getElementsMethod · 0.45
getElementResponseMethod · 0.45
getTagMethod · 0.45
SizeMethod · 0.45
getNumElementsMethod · 0.45

Tested by

no test coverage detected