From aaa3a57a27e7eb5e7e17c85c7b9757f13bb5dc1f Mon Sep 17 00:00:00 2001 From: Emilie Marchandise <emilie.marchandise@uclouvain.be> Date: Thu, 19 Aug 2010 15:35:12 +0000 Subject: [PATCH] Incompressible NS with stabilisation depending on correct meshsize h --- Geo/GFaceCompound.cpp | 64 +++++++++++++++++------------------ Geo/GModel.cpp | 1 + benchmarks/boolean/sphere.lua | 4 +-- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/Geo/GFaceCompound.cpp b/Geo/GFaceCompound.cpp index df6946665f..3361f31aff 100644 --- a/Geo/GFaceCompound.cpp +++ b/Geo/GFaceCompound.cpp @@ -2169,38 +2169,38 @@ void GFaceCompound::printStuff() const //debug cecile rbf - it = _compound.begin(); - char nameM[256], nameF[256]; - sprintf(nameM, "mappedMesh-%d.msh", (*it)->tag()); - sprintf(nameF, "XYZfunction-%d.txt", (*it)->tag()); - FILE * myF = fopen(nameM,"w"); - FILE * myF2 = fopen(nameF,"w"); - fprintf(myF,"$MeshFormat\n"); - fprintf(myF,"2.2 0 8\n"); - fprintf(myF,"$EndMeshFormat\n"); - fprintf(myF,"$Nodes\n"); - fprintf(myF,"%d\n", (int)allNodes.size()); - for(std::set<MVertex *>::iterator itv = allNodes.begin(); itv !=allNodes.end() ; ++itv){ - std::map<MVertex*,SPoint3>::const_iterator it0 = coordinates.find(*itv); - fprintf(myF,"%d %g %g %g \n", (*itv)->getNum(), it0->second.x(), it0->second.y(), 0.0); - fprintf(myF2,"%d %g %g %g \n", (*itv)->getNum(), (*itv)->x(), (*itv)->y(), (*itv)->z()); - } - fprintf(myF,"$EndNodes\n"); - fprintf(myF,"$Elements\n"); - int nbTris = 0; - for( ; it != _compound.end() ; ++it) nbTris += (*it)->triangles.size(); - fprintf(myF, "%d \n", nbTris); - int k = 1; - for(it = _compound.begin(); it != _compound.end() ; ++it){ - for(unsigned int i = 0; i < (*it)->triangles.size(); ++i){ - MTriangle *t = (*it)->triangles[i]; - fprintf(myF,"%d 2 2 0 1 %d %d %d \n", k, t->getVertex(0)->getNum(), t->getVertex(1)->getNum(), t->getVertex(2)->getNum()); - k++; - } - } - fprintf(myF,"$EndElements\n"); - fclose(myF); - fclose(myF2); + // it = _compound.begin(); + // char nameM[256], nameF[256]; + // sprintf(nameM, "mappedMesh-%d.msh", (*it)->tag()); + // sprintf(nameF, "XYZfunction-%d.txt", (*it)->tag()); + // FILE * myF = fopen(nameM,"w"); + // FILE * myF2 = fopen(nameF,"w"); + // fprintf(myF,"$MeshFormat\n"); + // fprintf(myF,"2.2 0 8\n"); + // fprintf(myF,"$EndMeshFormat\n"); + // fprintf(myF,"$Nodes\n"); + // fprintf(myF,"%d\n", (int)allNodes.size()); + // for(std::set<MVertex *>::iterator itv = allNodes.begin(); itv !=allNodes.end() ; ++itv){ + // std::map<MVertex*,SPoint3>::const_iterator it0 = coordinates.find(*itv); + // fprintf(myF,"%d %g %g %g \n", (*itv)->getNum(), it0->second.x(), it0->second.y(), 0.0); + // fprintf(myF2,"%d %g %g %g \n", (*itv)->getNum(), (*itv)->x(), (*itv)->y(), (*itv)->z()); + // } + // fprintf(myF,"$EndNodes\n"); + // fprintf(myF,"$Elements\n"); + // int nbTris = 0; + // for( ; it != _compound.end() ; ++it) nbTris += (*it)->triangles.size(); + // fprintf(myF, "%d \n", nbTris); + // int k = 1; + // for(it = _compound.begin(); it != _compound.end() ; ++it){ + // for(unsigned int i = 0; i < (*it)->triangles.size(); ++i){ + // MTriangle *t = (*it)->triangles[i]; + // fprintf(myF,"%d 2 2 0 1 %d %d %d \n", k, t->getVertex(0)->getNum(), t->getVertex(1)->getNum(), t->getVertex(2)->getNum()); + // k++; + // } + // } + // fprintf(myF,"$EndElements\n"); + // fclose(myF); + // fclose(myF2); } diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp index aeab49b505..f252cb603e 100644 --- a/Geo/GModel.cpp +++ b/Geo/GModel.cpp @@ -1275,6 +1275,7 @@ void GModel::createTopologyFromMesh() void GModel::createTopologyFromFaces(std::vector<discreteFace*> &discFaces) { + std::vector<discreteEdge*> discEdges; for(eiter it = firstEdge(); it != lastEdge(); it++){ if((*it)->geomType() == GEntity::DiscreteCurve) diff --git a/benchmarks/boolean/sphere.lua b/benchmarks/boolean/sphere.lua index 1d3c979de7..f179218ca6 100644 --- a/benchmarks/boolean/sphere.lua +++ b/benchmarks/boolean/sphere.lua @@ -1,10 +1,10 @@ options = gmshOptions() -options:numberSet('Mesh', 0, 'CharacteristicLengthFactor', 0.6) +options:numberSet('Mesh', 0, 'CharacteristicLengthFactor', 1.5) myTool = GModel(); myTool:addSphere(0.0,0.0,0.0,1); myTool:mesh(1) myTool:mesh(2) -myTool:save('sphere.msh') \ No newline at end of file +myTool:save('sphere.msh') -- GitLab