pickle mesh-load also via ngsolve.Mesh('filename.vol.bin')

This commit is contained in:
Joachim Schoeberl 2021-06-17 07:58:17 +02:00
parent 4b40a7eb31
commit b51df253fd

View File

@ -146,13 +146,21 @@ void Ng_LoadMesh (const char * filename, ngcore::NgMPI_Comm comm)
if( id == 0) {
mesh.reset (new Mesh());
mesh->SetCommunicator(comm);
string fn(filename);
if (fn.substr (fn.length()-8, 8) == ".vol.bin")
{
mesh -> Load(fn);
SetGlobalMesh (mesh);
}
else
{
if (fn.substr (fn.length()-3, 3) == ".gz")
infile = new igzstream (filename);
else
infile = new ifstream (filename);
mesh.reset (new Mesh());
mesh->SetCommunicator(comm);
mesh -> Load(*infile);
SetGlobalMesh (mesh);
@ -167,6 +175,8 @@ void Ng_LoadMesh (const char * filename, ngcore::NgMPI_Comm comm)
memcpy(&buf[0], geom_part_string.c_str(), strs*sizeof(char));
delete infile;
}
if (ntasks > 1)
{