39 #ifndef TargetCalculator_hpp
40 #define TargetCalculator_hpp
54 class PatchDataParameters;
158 static const double SIXTH_ROOT_OF_TWO =
msq_stdc::pow(2., 1./6.);
160 const double v_tri[] = {1., 0.5, 0., 0.,
MSQ_SQRT_THREE/2., 0., 0., 0., 1.};
168 const double v_quad[] = {1., 0., 0., 0., 1., 0., 0., 0., 1.};
174 tet_M3D = m3 * SIXTH_ROOT_OF_TWO;
176 const double v_hex[] = {1., 0., 0., 0., 1., 0., 0., 0., 1.};
193 Vector3D a1(A[0][0], A[1][0], A[2][0]);
194 Vector3D a2(A[0][1], A[1][1], A[2][1]);
195 Vector3D a3(A[0][2], A[1][2], A[2][2]);
202 double a1_x_a2_norm = a1_x_a2.
length();
206 double det_A =
det(A);
212 Q[0][1] = fac * a1%a2 / (a1_norm*a2_norm);
213 Q[0][2] = fac * a1%a3 / (a1_norm*a3_norm);
214 Q[1][1] = fac * a1_x_a2_norm / (a1_norm*a2_norm);
215 Q[1][2] = fac * a1_x_a2 % a1_x_a3 / (a1_x_a2_norm * a1_norm * a3_norm);
216 Q[2][2] = fac * det_A / (a1_x_a2_norm*a3_norm);
218 if (!finite(Q[0][0]) || !finite(Q[0][1]) || !finite(Q[0][2]) ||
219 !finite(Q[1][0]) || !finite(Q[1][2]) || !finite(Q[2][2])) {
241 Delta[0][0] = fac * a1_norm;
242 Delta[1][1] = fac * a2_norm;
243 Delta[2][2] = fac * a3_norm;
252 #endif // TargetCalculator_hpp
void compute_default_target_matrices(PatchData &pd, MsqError &err)
Compute the default "isotropic" target matrices that are often used in the computation of reference-b...
virtual AlgorithmType get_algorithm_type()
Return the algorithm type (to avoid RTTI use).
virtual msq_std::string get_name()
Returns the algorithm name.
The Lambda coefficient is the average on the mesh.
Used to hold the error state and return it to the application.
PatchDataParameters & get_all_parameters()
Returns the PatchDataParameters object.
void compute_guide_matrices(enum guide_type type, PatchData &ref_pd, size_t elem_ind, Matrix3D A[], int num, MsqError &err)
Computes the guide corner matrices A for a given element index in the reference patch.
Vector3D is the object that effeciently stores information about about three-deminsional vectors...
Matrix3D compute_V_3D(const Matrix3D &A, MsqError &err)
Each element has a lambda coefficient.
This should be the parent class of all algorithms retrieving information from a MeshSet object...
Matrix3D compute_Q_3D(const Matrix3D &A, MsqError &err)
static double compute_Lambda(const Matrix3D &A, MsqError &err)
Note that this function is static, i.e. it can be used independently of an object.
Solution Feature-based Guide.
static const double MSQ_SQRT_TWO
Locally-smoothed IM Guide.
static void initialize_default_target_matrices(Matrix3D &tri_M3D, Matrix3D &quad_M3D, Matrix3D &tet_M3D, Matrix3D &hex_M3D)
void compute_reference_corner_matrices(PatchData &pd, MsqError &err)
Compute the corner matrices for the reference mesh refMesh.
3*3 Matric class, row-oriented, 0-based [i][j] indexing.
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
double column_length(int i) const
returns the column length – i is 0-based.
Base class that provides the interface for computing the target corner matrices used in the context b...
void set_global_patch_type()
void compute_target_matrices_and_check_det(PatchData &pd, MsqError &err)
This function wraps compute_target_matrices and checks that the determinant of each target is positiv...
double det(const Matrix3D &A)
Matrix3D compute_Delta_3D(const Matrix3D &A, MsqError &err)
object is in an invalid state
void reset_reference_meshset(MsqError &err)
Reset the reference mesh so it starts from the first vertex again.
double pow(double value, const Exponent &exp)
The MeshSet class stores one or more Mesquite::Mesh pointers and manages access to the mesh informati...
static const double MSQ_3RT_2_OVER_6RT_3
virtual ~TargetCalculator()
virtual destructor ensures use of polymorphism during destruction
virtual void compute_target_matrices(PatchData &pd, MsqError &err)=0
This function provides the corner matrices for all elements on the Patch.
virtual double loop_over_mesh(MeshSet &ms, MsqError &err)
This is the "run" function of PatchDataUser. It can do anything really.
Geometric Curvature Guide.
static const double MSQ_SQRT_THREE