Skip to content
Snippets Groups Projects
Commit c554da69 authored by Gauthier Becker's avatar Gauthier Becker
Browse files

Install for Ubuntu + fix multiple print of meshFormat in case of a multiple view file

parent 7813811b
No related branches found
No related tags found
No related merge requests found
......@@ -156,22 +156,28 @@ bool PViewDataGModel::writeMSH(const std::string &fileName, bool binary, bool sa
}
}
else{
if(multipleView)
if(multipleView){
fp = fopen(fileName.c_str(), binary ? "ab" : "a");
else
fp = fopen(fileName.c_str(), binary ? "wb" : "w");
if(!fp){
Msg::Error("Unable to open file '%s'", fileName.c_str());
return false;
if(!fp){
Msg::Error("Unable to open file '%s'", fileName.c_str());
return false;
}
}
fprintf(fp, "$MeshFormat\n");
fprintf(fp, "%g %d %d\n", 2.2, binary ? 1 : 0, (int)sizeof(double));
if(binary){
int one = 1;
fwrite(&one, sizeof(int), 1, fp);
fprintf(fp, "\n");
else{
fp = fopen(fileName.c_str(), binary ? "wb" : "w");
if(!fp){
Msg::Error("Unable to open file '%s'", fileName.c_str());
return false;
}
fprintf(fp, "$MeshFormat\n");
fprintf(fp, "%g %d %d\n", 2.2, binary ? 1 : 0, (int)sizeof(double));
if(binary){
int one = 1;
fwrite(&one, sizeof(int), 1, fp);
fprintf(fp, "\n");
}
fprintf(fp, "$EndMeshFormat\n");
}
fprintf(fp, "$EndMeshFormat\n");
}
if(haveInterpolationMatrices()){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment