Commit fac85f33 by Christophe Geuzaine

new option Mesh.BoundaryLayerFanPoints + removed some debug output

parent a5db7fa7
Pipeline #1224 passed with stage
in 35 minutes 44 seconds
......@@ -35,7 +35,7 @@ struct contextMeshOptions {
std::map<int,int> algo2dPerFace;
std::map<int,int> curvatureControlPerFace;
int NewtonConvergenceTestXYZ;
int ignorePeriodicity;
int ignorePeriodicity, boundaryLayerFanPoints;
int maxNumThreads1D, maxNumThreads2D, maxNumThreads3D;
// mesh IO
int fileFormat;
......
......@@ -986,8 +986,8 @@ StringXNumber MeshOptions_Number[] = {
"Field format for Nastran BDF files (0=free, 1=small, 2=large)" },
{ F|O, "Binary" , opt_mesh_binary , 0. ,
"Write mesh files in binary format (if possible)" },
{ F|O, "SmoothCrossField" , opt_mesh_smooth_cross_field , 0. ,
"Apply n barycentric smoothing passes to the cross field" },
{ F|O, "BoundaryLayerFanPoints" , opt_mesh_boundary_layer_fan_points, 5. ,
"Number of interior points (> 1) in 2D boundary layer fans" },
{ F|O, "CgnsImportOrder" , opt_mesh_cgns_import_order , 1. ,
"Enable the creation of high-order mesh from CGNS structured meshes"
......@@ -1241,6 +1241,8 @@ StringXNumber MeshOptions_Number[] = {
"Should second order vertices simply be created by linear interpolation?" },
{ F|O, "Smoothing" , opt_mesh_nb_smoothing , 1. ,
"Number of smoothing steps applied to the final mesh" },
{ F|O, "SmoothCrossField" , opt_mesh_smooth_cross_field , 0. ,
"Apply n barycentric smoothing passes to the cross field" },
{ F|O, "SmoothNormals" , opt_mesh_smooth_normals , 0. ,
"Smooth the mesh normals?" },
{ F|O, "SmoothRatio" , opt_mesh_smooth_ratio , 1.8 ,
......
......@@ -5814,6 +5814,16 @@ double opt_mesh_binary(OPT_ARGS_NUM)
return CTX::instance()->mesh.binary;
}
double opt_mesh_boundary_layer_fan_points(OPT_ARGS_NUM)
{
if(action & GMSH_SET){
int fanPoints = (int)val;
if(fanPoints < 1) fanPoints = 1;
CTX::instance()->mesh.boundaryLayerFanPoints = fanPoints;
}
return CTX::instance()->mesh.boundaryLayerFanPoints;
}
double opt_mesh_smooth_cross_field(OPT_ARGS_NUM)
{
if(action & GMSH_SET)
......
......@@ -489,6 +489,7 @@ double opt_mesh_partition_create_ghost_cells(OPT_ARGS_NUM);
double opt_mesh_binary(OPT_ARGS_NUM);
double opt_mesh_smooth_cross_field(OPT_ARGS_NUM);
double opt_mesh_bdf_field_format(OPT_ARGS_NUM);
double opt_mesh_boundary_layer_fan_points(OPT_ARGS_NUM);
double opt_mesh_nb_smoothing(OPT_ARGS_NUM);
double opt_mesh_algo2d(OPT_ARGS_NUM);
double opt_mesh_algo3d(OPT_ARGS_NUM);
......
......@@ -21,26 +21,21 @@ class BoundaryLayerField;
const int USEFANS__ = 1;
struct BoundaryLayerData
{
struct BoundaryLayerData {
SVector3 _n;
std::vector<MVertex*> _column;
// std::vector<SMetric3> _metrics;
// std::vector<GFace*> _joint;
BoundaryLayerData(){}
BoundaryLayerData(const SVector3 & dir,
std::vector<MVertex*> column/*,
std::vector<SMetric3> metrics*/)
: _n(dir), _column(column) /*,_metrics(metrics)*/{}
BoundaryLayerData(const SVector3 & dir, std::vector<MVertex*> column)
: _n(dir), _column(column){}
};
struct BoundaryLayerFan
{
struct BoundaryLayerFan {
MEdge _e1, _e2;
bool sense;
BoundaryLayerFan(MEdge e1, MEdge e2 , bool s = true)
: _e1(e1),_e2(e2) , sense (s){}
};
struct edgeColumn {
const BoundaryLayerData &_c1, &_c2;
edgeColumn(const BoundaryLayerData &c1, const BoundaryLayerData &c2)
......@@ -50,11 +45,10 @@ struct edgeColumn {
class BoundaryLayerColumns
{
std::map<MVertex*, BoundaryLayerFan> _fans;
public:
public:
// Element columns
std::map<MElement*,MElement*> _toFirst;
std::map<MElement*,std::vector<MElement*> > _elemColumns;
std::map<MElement*,std::vector<MElement*> > _elemColumns;
std::map<MFace, GFace*, Less_Face> _inverse_classification;
std::multimap<MVertex*, BoundaryLayerData> _data;
size_t size () const {return _data.size();}
......@@ -62,7 +56,8 @@ public:
typedef std::map<MVertex*, BoundaryLayerFan>::iterator iterf;
std::multimap<MVertex*, MVertex*> _non_manifold_edges;
std::multimap<MEdge, SVector3, Less_Edge> _normals;
void clearData () {
void clearData ()
{
_toFirst.clear();
_elemColumns.clear();
_inverse_classification.clear();
......@@ -72,39 +67,33 @@ public:
_elemColumns.clear();
_fans.clear();
}
void clearElementData () {
void clearElementData ()
{
_toFirst.clear();
_elemColumns.clear();
}
iter begin() { return _data.begin(); }
iter end() { return _data.end(); }
iterf beginf() { return _fans.begin(); }
iterf endf() { return _fans.end(); }
BoundaryLayerColumns (){}
inline void addColumn(const SVector3 &dir, MVertex* v,
std::vector<MVertex*> _column//,
// std::vector<SMetric3> _metrics,
// std::vector<GFace*> _joint
)
std::vector<MVertex*> _column)
{
_data.insert (std::make_pair(v,BoundaryLayerData(dir, _column/*,_metrics,_joint*/)));
_data.insert (std::make_pair(v, BoundaryLayerData(dir, _column)));
}
inline void addFan(MVertex *v, MEdge e1, MEdge e2, bool s)
{
_fans.insert(std::make_pair(v,BoundaryLayerFan(e1,e2,s)));
_fans.insert(std::make_pair(v, BoundaryLayerFan(e1, e2, s)));
}
inline const BoundaryLayerFan *getFan(MVertex *v) const{
inline const BoundaryLayerFan *getFan(MVertex *v) const
{
std::map<MVertex*,BoundaryLayerFan>::const_iterator it = _fans.find(v);
if (it != _fans.end()){
return &it->second;
}
return 0;
}
// const BoundaryLayerData &getColumn(MVertex *v, MFace f) const;
inline const BoundaryLayerData &getColumn(MVertex *v, MEdge e) const
{
std::map<MVertex*,BoundaryLayerFan>::const_iterator it = _fans.find(v);
......@@ -122,13 +111,12 @@ public:
return error;
}
edgeColumn getColumns(MVertex *v1, MVertex *v2 , int side);
// faceColumn getColumns(GFace *gf, MVertex *v1, MVertex *v2 , MVertex* v3, int side);
inline int getNbColumns(MVertex *v) const { return _data.count(v); }
inline const BoundaryLayerData &getColumn(MVertex *v, int iColumn) const
{
int count = 0;
for(std::multimap<MVertex*,BoundaryLayerData>::const_iterator itm = _data.lower_bound(v);
itm != _data.upper_bound(v); ++itm){
for(std::multimap<MVertex*, BoundaryLayerData>::const_iterator itm =
_data.lower_bound(v); itm != _data.upper_bound(v); ++itm){
if (count++ == iColumn) return itm->second;
}
static BoundaryLayerData error;
......@@ -137,8 +125,8 @@ public:
};
BoundaryLayerField* getBLField(GModel *gm);
bool buildAdditionalPoints2D (GFace *gf ) ;
bool buildAdditionalPoints3D (GRegion *gr) ;
bool buildAdditionalPoints2D(GFace *gf ) ;
bool buildAdditionalPoints3D(GRegion *gr) ;
void buildMeshMetric(GFace *gf, double *uv, SMetric3 &m, double metric[3]);
#endif
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