Commit 94d1cb43 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts

fix2

parent 304f7071
Pipeline #2088 passed with stage
in 36 minutes and 32 seconds
......@@ -456,10 +456,10 @@ static void loadMSH2(const char *fileName, std::ifstream &input, LoadMesh &mesh,
static void loadMSH3(const char *fileName, std::ifstream &input, LoadMesh &mesh, bool sequentialLoad)
{
printf("loading mesh format 3 %i\n",__line__);
printf("loading mesh format 3 %i\n",__LINE__);
std::string line;
if (!(input>>line)) ferror;
printf("loading mesh format 3 %i\n",__line__);
printf("loading mesh format 3 %i\n",__LINE__);
if (line=="$PhysicalNames"){
int nphys;
if (!(input>>nphys)) ferror;
......@@ -477,7 +477,7 @@ static void loadMSH3(const char *fileName, std::ifstream &input, LoadMesh &mesh,
if (!(input>>line)) ferror;
if (line!="$EndPhysicalNames") ferror;
}
printf("loading mesh format 3 %i\n",__line__);
printf("loading mesh format 3 %i\n",__LINE__);
if (!(input>>line)) ferror;
if (line!="$Entities") ferror;
int nent[4];
......@@ -497,9 +497,9 @@ static void loadMSH3(const char *fileName, std::ifstream &input, LoadMesh &mesh,
getline(input, line);
}
}
printf("loading mesh format 3 %i\n",__line__);
printf("loading mesh format 3 %i\n",__LINE__);
getline(input, line);
printf("loading mesh format 3 %i\n",__line__);
printf("loading mesh format 3 %i\n",__LINE__);
if (line!="$EndEntities") ferror;
getline (input, line);
if (line!="$Nodes") ferror;
......@@ -546,12 +546,12 @@ static void loadMSH3(const char *fileName, std::ifstream &input, LoadMesh &mesh,
keep |= (tmp-1 == Msg::GetCommRank());
}
}
printf("loading mesh format 3 %i\n",__line__);
printf("loading mesh format 3 %i\n",__LINE__);
if (fs->dimension > mesh.dimension)
mesh.dimension = fs->dimension;
printf("loading mesh format 3 %i\n",__line__);
printf("loading mesh format 3 %i\n",__LINE__);
evertices.reserve(nNodes);
printf("loading mesh format 3 %i\n",__line__);
printf("loading mesh format 3 %i\n",__LINE__);
for (int j = 0; j < nNodes; ++j) {
Vertex &v = vmap[tags[j]];
if (v.id == -1 && keep)
......@@ -563,11 +563,11 @@ static void loadMSH3(const char *fileName, std::ifstream &input, LoadMesh &mesh,
mesh.elements[key].push_back(MElement(evertices, num));
}
}
printf("loading mesh format 3 %i\n",__line__);
printf("loading mesh format 3 %i\n",__LINE__);
if (!(input >> line)) ferror;
if (line!="$EndElements") ferror;
mesh.nodes.resize(cid, 3);
printf("loading mesh format 3 %i\n",__line__);
printf("loading mesh format 3 %i\n",__LINE__);
for (auto &it : vmap) {
Vertex &v = it.second;
if (v.id != -1) {
......@@ -577,7 +577,7 @@ static void loadMSH3(const char *fileName, std::ifstream &input, LoadMesh &mesh,
mesh.nodes(v.id, 2) = v.z;
}
}
printf("loading mesh format 3 %i\n",__line__);
printf("loading mesh format 3 %i\n",__LINE__);
}
static void loadMSH(const char *fileName, LoadMesh &mesh, bool sequentialLoad)
......@@ -619,19 +619,19 @@ static dgFullMatrix<double> copyCoordinates(const std::vector<MElement> &element
dgMesh::dgMesh(const std::string filename, int dimension, const std::vector<std::string> physicalTags, bool sequentialLoad, const std::string periodicFile)
{
printf("loading mesh %i\n",__line__);
printf("loading mesh %i\n",__LINE__);
LoadMesh mesh;
_octree = NULL;
sequentialLoad |= (Msg::GetCommSize() == 1);
_sequentialLoad = sequentialLoad;
printf("loading mesh %i\n",__line__);
printf("loading mesh %i\n",__LINE__);
loadMSH(filename.c_str(), mesh, sequentialLoad);
printf("loading mesh %i\n",__line__);
printf("loading mesh %i\n",__LINE__);
_spaceTransform = NULL;
if (dimension == 0)
dimension = mesh.dimension;
_dimension = dimension;
printf("loading mesh %i\n",__line__);
printf("loading mesh %i\n",__LINE__);
for (auto &it : mesh.elements) {
int type = it.first.type;
int dim = ElementType::DimensionFromTag(type);
......@@ -640,14 +640,14 @@ dgMesh::dgMesh(const std::string filename, int dimension, const std::vector<std:
if(!physicalTags.empty() && std::find(physicalTags.begin(), physicalTags.end(),tag) == physicalTags.end()) continue;
int iGroup = _elements.size();
if (it.first.partition != Msg::GetCommRank()) continue;
printf("loading mesh %i\n",__line__);
printf("loading mesh %i\n",__LINE__);
_elements.push_back(new dgElementVector(iGroup, it.second, tag, type, copyCoordinates(it.second, mesh.nodes), it.first.partition));
printf("loading mesh %i\n",__line__);
printf("loading mesh %i\n",__LINE__);
for (size_t i = 0; i < it.second.size(); ++i)
_elementMap[it.second[i].num()] = std::make_pair(iGroup, i);
printf("loading mesh %i\n",__line__);
printf("loading mesh %i\n",__LINE__);
}
printf("loading mesh %i\n",__line__);
printf("loading mesh %i\n",__LINE__);
for (auto &it : mesh.elements) {
int type = it.first.type;
int dim = ElementType::DimensionFromTag(type);
......@@ -656,21 +656,21 @@ dgMesh::dgMesh(const std::string filename, int dimension, const std::vector<std:
if(!physicalTags.empty() && std::find(physicalTags.begin(), physicalTags.end(),tag) == physicalTags.end()) continue;
int iGroup = _elements.size() + _ghostElements.size();
if (it.first.partition == Msg::GetCommRank()) continue;
printf("loading mesh %i\n",__line__);
printf("loading mesh %i\n",__LINE__);
_ghostElements.push_back(new dgElementVector(iGroup, it.second, tag, type, copyCoordinates(it.second, mesh.nodes), it.first.partition));
printf("loading mesh %i\n",__line__);
printf("loading mesh %i\n",__LINE__);
for (size_t i = 0; i < it.second.size(); ++i)
_elementMap[it.second[i].num()] = std::make_pair(iGroup, i);
}
printf("loading mesh %i\n",__line__);
printf("loading mesh %i\n",__LINE__);
if(_elements.size() == 0)
Msg::Fatal("no element loaded in dgMesh !");
_gmshVertexId.resize(mesh.mshToVertexId.size());
for (auto it : mesh.mshToVertexId)
_gmshVertexId[it.second] = it.first;
printf("loading mesh %i\n",__line__);
printf("loading mesh %i\n",__LINE__);
buildInterfaces(*this, mesh, _interfaces, _interfaceMap, _periodicMap, sequentialLoad, periodicFile);
printf("loading mesh %i\n",__line__);
printf("loading mesh %i\n",__LINE__);
}
void dgMesh::findElement(int mElementId, int &iGroup, int &iElement) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment