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

Method write_element_graph

SRC/recorder/GmshRecorder.cpp:807–1001  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

805
806
807int
808GmshRecorder::write_element_graph()
809{
810 static bool do_only_once = true;
811
812 int rank = 0;
813 int nproc = 1;
814
815#ifdef _PARALLEL_PROCESSING
816 rank = theMachineBroker->getPID();
817 nproc = theMachineBroker->getNP();
818
819 // if (rank > 0)
820 // {
821 // return 0; // Only do this on proc0
822 // }
823
824 // DEBUGSTREAM << "Saving mesh for rank ---> " << rank << endln;
825
826 if (theDomain == 0) {
827 opserr << "WARNING: setDomain has not been called -- GmshRecorder\n";
828 return -1;
829 }
830
831 if(do_only_once)
832 {
833 // get time and part
834 std::stringstream ss;
835 ss.precision(precision);
836 ss << std::scientific;
837 ss << 0 << ' ' << timestep.back();
838 std::string stime, spart;
839 ss >> spart >> stime;
840
841
842 // open file
843 theFile.close();
844 std::stringstream ssmshname;
845 ssmshname << filename << ".graphnodes." << rank << ".msh";
846 std::string mshname = ssmshname.str();
847
848 // DEBUGSTREAM << "Opening " << mshname.c_str() << endln;
849
850
851 theFile.open(mshname.c_str(), std::ios::trunc | std::ios::out);
852 if (theFile.fail()) {
853 opserr << "WARNING: Failed to open file " << mshname.c_str() << "\n";
854 return -1;
855 }
856 theFile.precision(precision);
857 theFile << std::scientific;
858
859 write_header();
860
861
862 Graph& theGraph = theDomain->getElementGraph();
863 int numvertex = theGraph.getNumVertex();
864 int numedge = theGraph.getNumEdge();

Callers

nothing calls this directly

Calls 14

getPIDMethod · 0.80
getNPMethod · 0.80
getCrdsMethod · 0.80
precisionMethod · 0.45
closeMethod · 0.45
strMethod · 0.45
openMethod · 0.45
getNumVertexMethod · 0.45
getNumEdgeMethod · 0.45
getRefMethod · 0.45
getElementMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected