MeshKit
1.0
|
00001 /* 00002 * SizingFunctionVar.cpp 00003 * 00004 * Created on: Jun 24, 2011 00005 * Author: iulian 00006 */ 00007 00008 #include "meshkit/SizingFunctionVar.hpp" 00009 00010 namespace MeshKit { 00011 00012 SizingFunctionVar::SizingFunctionVar(MKCore *mkcore, int num_int, double int_size): 00013 SizingFunction(mkcore, num_int, int_size) 00014 { 00015 // TODO Auto-generated constructor stub 00016 00017 } 00018 00019 SizingFunctionVar::~SizingFunctionVar() 00020 { 00021 // TODO Auto-generated destructor stub 00022 } 00023 00024 void SizingFunctionVar::set_linear_coeff(double * fixedPoint, double * coeff) 00025 { 00026 fixed[0] = fixedPoint[0]; 00027 fixed[1] = fixedPoint[1]; 00028 fixed[2] = fixedPoint[2]; 00029 a = coeff[0]; b= coeff[1]; c=coeff[2]; d = coeff[3]; 00030 } 00031 00032 // another version, easier to pythonize 00033 // this is just because I don't understand swig 00034 void SizingFunctionVar::set_coeff(double x0, double y0, double z0, double a1, 00035 double b1, double c1, double d1) 00036 { 00037 fixed[0] = x0; 00038 fixed[1] = y0; 00039 fixed[2] = z0; 00040 a = a1; b= b1; c=c1; d = d1; 00041 } 00042 00043 double SizingFunctionVar::size(double *xyz ) const 00044 { 00045 double sz = d; 00046 if (xyz) 00047 { 00048 sz = sz+(xyz[0]-fixed[0])*a + (xyz[1]-fixed[1])*b + (xyz[2]-fixed[2])*c ; 00049 } 00050 return sz; 00051 } 00052 }