[Gmsh] attractor and 3d algo

walter steffe walter.steffe at alice.it
Fri Mar 31 18:21:51 CEST 2017


Good morning,


I was trying to create a tetrahedral mesh with a mesh size specified by 
attractors.

The mesh is to be used for electromagnetic simulations and I wanted to 
increase the density near sharp metallic edges (where field becomes 
singular).


The meshing is done using the library and the edge refinement is defined 
in the code included below.

I have tried both isotropic and anisotropic versions (changing 
mesh_aniso flag)



What I have seen is that the 2D algorithms are sensible to the attractor 
field (but the

       if(mesh_aniso)

       for (ElistIt it=singElist.begin(); it!= singElist.end(); it++){
          int mshrefI=(*it).first;
          double emeshSize=10*meshsize/mshrefI;
         fieldNum++; mshFieldList.push_back(1+fieldNum);
        {
              Field *attractor=fields->newField(1+fieldNum, 
"AttractorAnisoCurve");
attractor->options["EdgesList"]->list((*it).second);
attractor->options["NNodesByEdge"]->numericalValue(40);
attractor->options["dMin"]->numericalValue(emeshSize*0.1);
attractor->options["dMax"]->numericalValue(meshsize*3.0);
attractor->options["lMinTangent"]->numericalValue(emeshSize/3.0);
attractor->options["lMinNormal"]->numericalValue(emeshSize/3.0);
attractor->options["lMaxTangent"]->numericalValue(meshsize);
attractor->options["lMaxNormal"]->numericalValue(meshsize);
         }
         }
       else for (ElistIt it=singElist.begin(); it!= singElist.end(); it++){
          int mshrefI=(*it).first;
         double emeshSize=10*meshsize/mshrefI;
         fieldNum++; mshFieldList.push_back(1+fieldNum);
         {
              Field *attractor=fields->newField(1+fieldNum, "Attractor");
attractor->options["EdgesList"]->list((*it).second);
attractor->options["NNodesByEdge"]->numericalValue(50);
              fieldNum++; mshFieldList.push_back(1+fieldNum);
              Field *thsld=fields->newField(1+fieldNum, "Threshold");
thsld->options["IField"]->numericalValue(fieldNum);
              thsld->options["DistMin"]->numericalValue(0);
thsld->options["DistMax"]->numericalValue(2*meshsize);
thsld->options["LcMin"]->numericalValue(emeshSize*0.3);
thsld->options["LcMax"]->numericalValue(meshsize);
         }
       }





More information about the gmsh mailing list