MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / read

Method read

Src/Particle/AMReX_ParticleHeader.cpp:79–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79ParticleHeader
80ParticleHeader::read (const std::string& dir, const std::string& file)
81{
82 AMREX_ASSERT(!dir.empty());
83 AMREX_ASSERT(!file.empty());
84
85 std::string fullname = dir;
86 if (!fullname.empty() && fullname.back() != '/') {
87 fullname += '/';
88 }
89 fullname += file;
90
91 std::string HdrFileName = fullname;
92 if (!HdrFileName.empty() && HdrFileName.back() != '/') {
93 HdrFileName += '/';
94 }
95 HdrFileName += "Header";
96
97 Vector<char> fileCharPtr;
98 ParallelDescriptor::ReadAndBcastFile(HdrFileName, fileCharPtr);
99 std::string fileCharPtrString(fileCharPtr.dataPtr());
100 std::istringstream HdrFile(fileCharPtrString, std::istringstream::in);
101
102 ParticleHeader header;
103 header.parse(HdrFile);
104 return header;
105}
106
107}

Callers 1

InitFromBinaryFileMethod · 0.45

Calls 4

ReadAndBcastFileFunction · 0.85
parseMethod · 0.80
emptyMethod · 0.45
dataPtrMethod · 0.45

Tested by

no test coverage detected