MeshKit
1.0
|
00001 /* 00002 * SizingFunctionVar.hpp 00003 * 00004 * Created on: Jun 24, 2011 00005 * Author: iulian 00006 */ 00007 00008 #ifndef SIZINGFUNCTIONVAR_HPP_ 00009 #define SIZINGFUNCTIONVAR_HPP_ 00010 00011 #include "meshkit/SizingFunction.hpp" 00012 00013 namespace MeshKit { 00014 00015 class SizingFunctionVar: public MeshKit::SizingFunction 00016 { 00017 public: 00018 SizingFunctionVar(MKCore *mkcore, int num_int = -1, double int_size = -1.0); 00019 virtual ~SizingFunctionVar(); 00020 00021 // the function would be something like 00022 // a(x-x0)+b(y-y0)+c(z-z0)+d 00023 // at fixed point, the mesh size returned would be d 00024 // these should be either read from a file, or 00025 // passed as arguments to the test / usage scenario 00026 void set_linear_coeff(double * fixedPoint, double * coeff); 00027 00028 // another version, easier to pythonize 00029 void set_coeff(double x0, double y0, double c0, double a, 00030 double b, double c, double d); 00031 00032 virtual double size(double *xyz = NULL) const; 00033 // will be used by edge meshers to decide are we or not variables 00034 // use a different edge mesh strategy then (different enum) 00035 virtual bool variable() {return true;} 00036 00037 private: 00038 double a, b, c, d; 00039 double fixed[3]; 00040 00041 }; 00042 00043 } 00044 00045 #endif /* SIZINGFUNCTIONVAR_HPP_ */