Skip to content
Snippets Groups Projects
Commit fb8b55a0 authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

added automaticmeshsizefield

parent 8b4035a6
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ set(SRC ...@@ -32,6 +32,7 @@ set(SRC
Field.cpp Field.cpp
filterElements.cpp filterElements.cpp
gmshCrossFields.cpp gmshCrossFields.cpp
automaticMeshSizeField.cpp
) )
file(GLOB HDR RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h) file(GLOB HDR RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h)
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "BackgroundMeshTools.h" #include "BackgroundMeshTools.h"
#include "STensor3.h" #include "STensor3.h"
#include "ExtrudeParams.h" #include "ExtrudeParams.h"
#include "automaticMeshSizeField.h"
#include "nanoflann.hpp" #include "nanoflann.hpp"
#if defined(HAVE_POST) #if defined(HAVE_POST)
...@@ -2956,6 +2957,7 @@ FieldManager::FieldManager() ...@@ -2956,6 +2957,7 @@ FieldManager::FieldManager()
map_type_name["AttractorAnisoCurve"] = new FieldFactoryT<AttractorAnisoCurveField>(); map_type_name["AttractorAnisoCurve"] = new FieldFactoryT<AttractorAnisoCurveField>();
#endif #endif
map_type_name["MaxEigenHessian"] = new FieldFactoryT<MaxEigenHessianField>(); map_type_name["MaxEigenHessian"] = new FieldFactoryT<MaxEigenHessianField>();
map_type_name["AutomaticMeshSizeField"] = new FieldFactoryT<automaticMeshSizeField>();
_background_field = -1; _background_field = -1;
} }
......
#include "automaticMeshSizeField.h"
double automaticMeshSizeField:: operator()(double X, double Y, double Z, GEntity *ge) {
return _hbulk;
}
void automaticMeshSizeField:: update(){
}
#ifndef _AUTOMATIC_MESH_SIZE_FIELD_H_
#define _AUTOMATIC_MESH_SIZE_FIELD_H_
#include "Field.h"
class automaticMeshSizeField : public Field {
int _nPointsPerCircle;
int _nPointsPerGap;
double _hmin, _hmax;
double _hbulk;
double _gradientMax;
char fileName[256];
public:
automaticMeshSizeField()
{
_nPointsPerCircle = 15;
_nPointsPerGap = 5;
_hmin = 1.e-8;// update needed
_hmax = 1.e+8;// update needed
_hbulk = 0.1; // update needed
_gradientMax =1.4;
options["nPointsPerCircle"] = new FieldOptionInt(_nPointsPerCircle,
"Number of points per circle (adapt to curvature of surfaces)");
options["nPointsPerGap"] = new FieldOptionInt(_nPointsPerGap,
"Number of points in thin layers");
options["hBulk"] = new FieldOptionDouble(_hbulk,
"Size everywhere no size is prescribed", &update_needed);
options["gradientMax"] = new FieldOptionDouble(_gradientMax,
"Maximun gradient of the size field");
}
const char *getName() { return "AutomaticMeshSizeField"; }
std::string getDescription(){
return "Compute a mesh size field that is quite automatic "
"Takes into account surface curvatures and closeness of objects";
}
void update();
virtual double operator()(double X, double Y, double Z, GEntity *ge = 0);
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment