ARudik / feelpp

Automatically exported from code.google.com/p/feelpp
0 stars 0 forks source link

gmsh - createGMSHMesh ( writting the .geo ) - problem with number of partition #47

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When using
    mesh = createGMSHMesh ( _mesh = new mesh_type,
                            _desc = MyGeo( ),
                            _update=MESH_RENUMBER|MESH_UPDATE_EDGES|MESH_UPDATE_FACES|MESH_CHECK );
with 

gmsh_ptrtype MyGeo()
{
    std::ostringstream costr;
    costr    << "hs=" << meshSize << ";\n"
                 << "Point(1) = {0, 0, 0, hs};\n"
     [...]
}

I don't really understand why yet, but it will always give you a mesh with only 
one partition. However in generate function of Gmsh ( gmsh.cpp ) M_partitions 
has the correct value.
In order to have a mesh with the good number of partitions, you should add this 
number in your .geo file like :

gmsh_ptrtype MyGeo()
{
    std::ostringstream costr;
    int nb_partition = Environment::worldComm().globalSize();
    costr <<" Mesh.NbPartitions=" << nb_partition << ";\n";
    costr << "hs=" << meshSize << ";\n"
              << "Point(1) = {0, 0, 0, hs};\n"
     [...]
}

Original issue reported on code.google.com by stephane...@gmail.com on 2 Sep 2012 at 8:35

GoogleCodeExporter commented 9 years ago
you need to add 

costr << this->preamble() 

Original comment by christop...@feelpp.org on 2 Sep 2012 at 9:40

GoogleCodeExporter commented 9 years ago
it is not this-> but the pointer to the gmsh_ptrtype structure that needs to be 
added for preamble

Original comment by christop...@feelpp.org on 2 Sep 2012 at 9:44

GoogleCodeExporter commented 9 years ago
see for example

http://code.google.com/p/feelpp/source/browse/doc/manual/heatns/convection_other
.cpp

Original comment by christop...@feelpp.org on 2 Sep 2012 at 9:55

GoogleCodeExporter commented 9 years ago

Original comment by christop...@feelpp.org on 2 Sep 2012 at 2:41