MeshKit
1.0
|
00001 #include "CAMALSizeEval.hpp" 00002 00003 namespace MeshKit 00004 { 00005 00006 CAMALSizeEval::CAMALSizeEval(double size, SizingFunction * szf) 00007 : meshSize(size), sizingFunc(szf) 00008 { 00009 } 00010 00011 CAMALSizeEval::~CAMALSizeEval() {} 00012 00013 bool CAMALSizeEval::size_at_point(double x, double y, double z, double& size, 00014 int level) 00015 { 00016 size = meshSize; 00017 if (sizingFunc) 00018 { 00019 double pos[3] = {x, y, z}; 00020 size = sizingFunc->size(pos); 00021 } 00022 return true; 00023 } 00024 00025 bool CAMALSizeEval::stretch_vector(double loc_x, double loc_y, double loc_z, 00026 double& vec_x, double& vec_y, double& vec_z) 00027 { 00028 vec_x = loc_x; 00029 vec_y = loc_y; 00030 vec_z = loc_z; 00031 return true; 00032 } 00033 00034 bool CAMALSizeEval::tensor_at_point(double x, double y, double z, 00035 double*& size) 00036 { 00037 for (int i = 0; i < 9; i++) { 00038 size[i] = meshSize; 00039 } 00040 return true; 00041 } 00042 00043 bool CAMALSizeEval::size_at_point(double u, double v, double& size, 00044 int level) 00045 { 00046 size = meshSize; 00047 return true; 00048 } 00049 00050 bool CAMALSizeEval::stretch_vector(double loc_u, double loc_v, 00051 double& vec_u, double& vec_v) 00052 { 00053 vec_u = loc_u; 00054 vec_v = loc_v; 00055 return true; 00056 } 00057 00058 bool CAMALSizeEval::tensor_at_point(double u, double v, 00059 double*& size) 00060 { 00061 for (int i = 0; i < 4; i++) { 00062 size[i] = meshSize; 00063 } 00064 return true; 00065 } 00066 00067 bool CAMALSizeEval::size_at_point(double u, double& size, 00068 int level) 00069 { 00070 size = meshSize; 00071 return true; 00072 } 00073 00074 bool CAMALSizeEval::is_anisotropic() 00075 { 00076 return false; 00077 } 00078 00079 } // namespace MeshKit