Пример #1
0
 void test_ideal_element_eval()
 {
   tester.test_evaluate_unit_edge_element( &mMetric, TRIANGLE,      1.0 );
   tester.test_evaluate_unit_edge_element( &mMetric, QUADRILATERAL, 1.0 );
   tester.test_evaluate_unit_edge_element( &mMetric, TETRAHEDRON,   1.0 );
   tester.test_evaluate_unit_edge_element( &mMetric, PYRAMID,       1.0 );
   tester.test_evaluate_unit_edge_element( &mMetric, PRISM,         1.0 );
   tester.test_evaluate_unit_edge_element( &mMetric, HEXAHEDRON,    1.0 );
 }
Пример #2
0
 TMPQualityMetricTest() : 
   tester( QualityMetricTester::ALL_FE_EXCEPT_SEPTAHEDRON, &settings ),
   e_weight( 2.7182818284590451 ),
   faux_pi(3.14159), faux_zero(0.0), faux_two(2.0),
   num_metric( &test_metric ),
   test_qm( &ideal, &num_metric ),
   test_qm_surf( &surf_target, &num_metric ),
   zero_qm( &ideal, &faux_zero ),
   weight_qm( &ideal, &e_weight, &test_metric ),
   center_qm( &ideal, &test_metric ),
   triCenter( centerOnly.get_mapping_function_2D(TRIANGLE) ),
   quadCenter( centerOnly.get_mapping_function_2D(QUADRILATERAL) ),
   tetCenter( centerOnly.get_mapping_function_3D(TETRAHEDRON) ),
   pyrCenter( centerOnly.get_mapping_function_3D(PYRAMID) ),
   priCenter( centerOnly.get_mapping_function_3D(PRISM) ),
   hexCenter( centerOnly.get_mapping_function_3D(HEXAHEDRON) )
 {  
   centerOnly.set_mapping_function( &triCenter );
   centerOnly.set_mapping_function( &quadCenter );
   centerOnly.set_mapping_function( &tetCenter );
   centerOnly.set_mapping_function( &pyrCenter );
   centerOnly.set_mapping_function( &priCenter );
   centerOnly.set_mapping_function( &hexCenter );
   tester.ideal_pyramid_base_equals_height( true );
 }
Пример #3
0
 void get_nonideal_element( EntityTopology type, PatchData& pd )
   {
     tester.get_nonideal_element( type, pd, true );
       // Callers assume surface elements are in XY plane.
       // Verify this assumption.
     if (TopologyInfo::dimension(type) == 2) {
       for (size_t i = 0; i < pd.num_nodes(); ++i) {
         CPPUNIT_ASSERT_DOUBLES_EQUAL( pd.vertex_by_index(i)[2], 0.0, 1e-6 );
       }
     }
   }
  void test_ideal_element_eval()
  {
    tester.test_evaluate_unit_tris_about_vertex( &mMetric, 1.0 );
    tester.test_evaluate_unit_quads_about_vertex( &mMetric, 1.0 );
    tester.test_evaluate_unit_hexes_about_vertex( &mMetric, 1.0 );

    tester.test_evaluate_unit_edge_element( &mMetric, TRIANGLE, 1.0 );
    tester.test_evaluate_unit_edge_element( &mMetric, QUADRILATERAL, 1.0 );
    tester.test_evaluate_unit_edge_element( &mMetric, TETRAHEDRON, 1.0 );
    tester.test_evaluate_unit_edge_element( &mMetric, HEXAHEDRON, 1.0 );
  }
Пример #5
0
  void test_evaluate_2D_weight()
    {
      MsqPrintError err(cout);
      PatchData pd;
      bool rval;
      double value;

      QMType m( &ideal, &e_weight, &faux_pi );
      tester.get_ideal_element( TRIANGLE, true, pd );
      rval = m.evaluate( pd, 0, value, err );
      CPPUNIT_ASSERT(!MSQ_CHKERR(err));
      CPPUNIT_ASSERT(rval);
      CPPUNIT_ASSERT_DOUBLES_EQUAL( faux_pi.value*e_weight.value, value, DBL_EPSILON );
    }
Пример #6
0
  void test_surf_eval_ortho_quad()
    {
      MsqPrintError err(cout);
      PatchData pd;
      bool rval;
      double value;

      QMType m( &surf_target, &faux_zero );
      faux_zero.count = 0;

      tester.get_ideal_element( QUADRILATERAL, true, pd );
      rval = m.evaluate( pd, 0, value, err );
      CPPUNIT_ASSERT(!MSQ_CHKERR(err));
      CPPUNIT_ASSERT(rval);
      CPPUNIT_ASSERT_EQUAL( 1, faux_zero.count );
      CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, col_dot_prod(faux_zero.last_A_2D), DBL_EPSILON );
    }  
Пример #7
0
  void test_3d_eval_ortho_hex()
    {
      MsqPrintError err(cout);
      PatchData pd;
      bool rval;
      double value;

      QMType m( &ideal, &faux_zero );
      faux_zero.count = 0;

      tester.get_ideal_element( HEXAHEDRON, true, pd );
      rval = m.evaluate( pd, 0, value, err );
      CPPUNIT_ASSERT(!MSQ_CHKERR(err));
      CPPUNIT_ASSERT(rval);
      CPPUNIT_ASSERT_EQUAL( 1, faux_zero.count );

        // test that columns are orthogonal for ideal hex element
      MsqMatrix<3,3> A = faux_zero.last_A_3D;
      CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, A.column(0) % A.column(1), 1e-6 );
      CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, A.column(0) % A.column(2), 1e-6 );
      CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, A.column(1) % A.column(2), 1e-6 );
    }  
 void test_valid_hessian()
   { tester.test_symmetric_Hessian_diagonal_blocks( &mMetric ); }
 void test_ideal_element_grad()
   { tester.test_ideal_element_zero_gradient( &mMetric, false ); }
 IdealWeightInverseMeanRatioTest() 
   : tester(QualityMetricTester::ALL_FE_EXCEPT_SEPTAHEDRON)
   { tester.ideal_pyramid_base_equals_height( true ); }
 void test_scale_invariant()
 {
   tester.test_scale_invariant( &mMetric );
 }
 void test_eval_with_hessian_diagonal()
 {
   tester.compare_eval_with_diag_and_eval_with_hessian( &mMetric );
 }
 void test_eval_with_gradient()
 {
   tester.compare_eval_with_indices_and_eval_with_gradient( &mMetric );
   tester.compare_analytical_and_numerical_gradients( &mMetric );
 }
 void test_get_evaluations()
   { tester.test_get_vertex_evaluations( &mMetric ); }
 void test_ideal_element_eval()
 {
   tester.test_evaluate_unit_edge_tris_about_vertex( &mMetric, 6.0 );
   tester.test_evaluate_unit_quads_about_vertex( &mMetric, 4.0 );
   tester.test_evaluate_unit_hexes_about_vertex( &mMetric, 6.0 );
 }
 void test_get_fixed_indices()
   { tester.test_get_indices_fixed( &mMetric ); }
 void test_eval_with_indices()
   { tester.compare_eval_and_eval_with_indices( &mMetric ); }
 void test_get_vertex_indices()
   { tester.test_get_vertex_indices( &mMetric ); }
 void test_eval_with_hessian()
 {
   tester.compare_eval_with_indices_and_eval_with_hessian( &mMetric );
   tester.compare_eval_with_grad_and_eval_with_hessian( &mMetric );
   tester.compare_analytical_and_numerical_hessians( &mMetric );
 }
 void test_gradient_reflects_quality()
   { tester.test_gradient_reflects_quality( &mMetric ); }
 void test_location_invariant()
 {
   tester.test_location_invariant( &mMetric );
   tester.test_grad_location_invariant( &mMetric );
   tester.test_hessian_location_invariant( &mMetric );
 }
 void test_domain_deviation()
 {
   tester.test_domain_deviation_quality( &mMetric );
   tester.test_domain_deviation_gradient( &mMetric );
 }
 void test_orient_invariant()
 {
   tester.test_orient_invariant( &mMetric );
   tester.test_grad_orient_invariant( &mMetric );
 }
 void test_inverted_elements()
   { tester.test_evaluate_inverted_element( &mMetric, false ); }
 void test_supported_types()
   { tester.test_supported_element_types( &mMetric ); }
 void test_degenerate_elements()
   { tester.test_evaluate_degenerate_element( &mMetric, false ); }
 void test_ideal_element_hess()
   { tester.test_ideal_element_positive_definite_Hessian( &mMetric, false ); }
 void test_get_evaluations()
   { tester.test_get_element_evaluations( &mMetric ); }
 void test_measures_quality()
   { tester.test_measures_quality( &mMetric ); }
 void test_get_element_indices()
   { tester.test_get_element_indices( &mMetric ); }