MOAB: Mesh Oriented datABase  (version 5.2.1)
pyramid_test.cpp File Reference
#include <iostream>
#include <stdlib.h>
#include "Mesquite.hpp"
#include "MeshImpl.hpp"
#include "MsqError.hpp"
#include "InstructionQueue.hpp"
#include "TerminationCriterion.hpp"
#include "QualityAssessor.hpp"
#include "LPtoPTemplate.hpp"
#include "LInfTemplate.hpp"
#include "IdealWeightMeanRatio.hpp"
#include "IdealWeightInverseMeanRatio.hpp"
#include "UntangleBetaQualityMetric.hpp"
#include "FeasibleNewton.hpp"
#include "ConjugateGradient.hpp"
#include "TrustRegion.hpp"
#include "ConditionNumberQualityMetric.hpp"
#include "TestUtil.hpp"
+ Include dependency graph for pyramid_test.cpp:

Go to the source code of this file.

Defines

#define TOL   1e-5
#define CPPUNIT_ASSERT(A)

Functions

bool smooth_mesh (Mesh *mesh, Mesh *ref_mesh, Mesh::VertexHandle free_vertex_at_origin, Vector3D initial_free_vertex_position, QualityMetric *metric)
bool smooth_mixed_mesh (const char *filename)
int main (int argc, char *argv[])

Define Documentation

#define CPPUNIT_ASSERT (   A)
Value:
do                                                            \
    {                                                             \
        if( !( A ) )                                              \
        {                                                         \
            std::cout << "Assertion Failed: " << #A << std::endl; \
            std::cout << "  File: " << __FILE__ << std::endl;     \
            std::cout << "  Line: " << __LINE__ << std::endl;     \
            return true;                                          \
        }                                                         \
    } while( false )

Definition at line 58 of file pyramid_test.cpp.

Referenced by MsqHessianTest::accumulate_entries(), TopologyInfoTest::bad_type(), HigherOrderTest::basic_hex_test(), HigherOrderTest::basic_quad_test(), FileTokenizerTest::boolean_test(), VtkTest::check_4quad_block(), VtkTest::check_4quad_structured(), VtkTest::check_8hex_block(), VtkTest::check_8hex_structured(), AveragingQMTest::check_average_and_weights(), AveragingQMTest::check_average_and_weights_fails(), AveragingQMTest::check_average_gradient_fails(), DomainClassifierTest::check_domain(), VtkTest::check_field_attrib(), AveragingQMTest::check_hessian_diagonal_fails(), AveragingQMTest::check_hessian_fails(), ExodusTest::check_mesh(), check_no_zeros(), PMeanPTemplateTest::check_result(), PatchDataTest::check_sub_patch(), check_valid_indices(), TargetCalculatorTest::check_valid_Q(), QualityMetricTester::compare_analytical_and_numerical_diagonals(), TMPQualityMetricTest< QMType >::compare_analytical_and_numerical_diagonals(), QualityMetricTester::compare_analytical_and_numerical_gradients(), TMPQualityMetricTest< QMType >::compare_analytical_and_numerical_gradients(), QualityMetricTester::compare_analytical_and_numerical_hessians(), TMPQualityMetricTest< QMType >::compare_analytical_and_numerical_hessians(), BCDTest::compare_bcd(), compare_coefficients(), compare_derivatives(), ObjectiveFunctionTests::compare_diagonal_gradient(), QualityMetricTester::compare_eval_and_eval_with_indices(), QualityMetricTester::compare_eval_with_diag_and_eval_with_hessian(), QualityMetricTester::compare_eval_with_grad_and_eval_with_diagonal(), QualityMetricTester::compare_eval_with_grad_and_eval_with_hessian(), QualityMetricTester::compare_eval_with_indices_and_eval_with_diagonal(), QualityMetricTester::compare_eval_with_indices_and_eval_with_gradient(), QualityMetricTester::compare_eval_with_indices_and_eval_with_hessian(), QualityMetricTest::compare_gradient(), ObjectiveFunctionTests::compare_hessian_diagonal(), ObjectiveFunctionTests::compare_hessian_gradient(), QualityMetricTest::compare_indices(), ObjectiveFunctionTests::compare_numerical_gradient(), ObjectiveFunctionTests::compare_numerical_hessian(), TopologyInfoTest::compare_sides(), LinearMappingFunctionTest::do_coeff_test(), LinearMappingFunctionTest::do_deriv_test(), LinearMappingFunctionTest::do_ideal_test(), FileTokenizerTest::double_test(), ObjectiveFunctionTests::evaluate_internal(), MetricLogger::evaluate_with_gradient(), MetricLogger::evaluate_with_Hessian(), MetricLogger::evaluate_with_indices(), TopologyInfoTest::find_edge(), TopologyInfoTest::find_face(), TopologyInfoTest::find_side(), LVQDTargetTest::ConstantTarget::get_2D_target(), LVQDTargetTest::ConstantTarget::get_3D_target(), IdealTargetTest::get_calc_target(), get_edge_lengths(), CompositeOFTest::get_hessians(), PatchDataTest::get_higher_order_vertices(), QualityMetricTester::get_ideal_element(), QualityMetricTester::get_ideal_hexes(), QualityMetricTester::get_ideal_quads(), IdealTargetTest::get_ideal_target(), QualityMetricTester::get_ideal_tris(), QualityMetricTester::get_inverted_element(), LVQDTargetTest::ConstantTarget::get_surface_target(), QualityMetricTester::get_zero_element(), TopologyInfoTest::hex(), TopologyInfoTest::hex14(), TopologyInfoTest::hex15(), TopologyInfoTest::hex20(), TopologyInfoTest::hex21(), TopologyInfoTest::hex26(), TopologyInfoTest::hex27(), TopologyInfoTest::hex8(), TopologyInfoTest::hex9(), TopologyInfoTest::higher_order_from_side(), TCTFauxOptimizer::initialize(), FileTokenizerTest::line_number_test(), FileTokenizerTest::long_test(), DummyVertexSlaver::loop_over_mesh(), main(), FileTokenizerTest::make_file(), FakeTargetCalc::make_value(), FileTokenizerTest::match_multiple_test(), FileTokenizerTest::match_one_test(), iMeshTest::matchElementConnectivity(), iMeshTest::matchVertexCoordinates(), TriTauMetric::matrix(), FileTokenizerTest::newline_test(), TCTFauxOptimizer::optimize_vertex_positions(), ObjectiveFunctionTests::patch(), TopologyInfoTest::polygon(), TopologyInfoTest::polyhedron(), TopologyInfoTest::pyramid(), TopologyInfoTest::pyramid13(), TopologyInfoTest::pyramid5(), TopologyInfoTest::quad(), TopologyInfoTest::quad4(), TopologyInfoTest::quad5(), TopologyInfoTest::quad8(), TopologyInfoTest::quad9(), TargetReadWriteTest::read_write_2D_targets(), TargetReadWriteTest::read_write_3D_targets(), TargetReadWriteTest::read_write_surface_targets(), TargetReadWriteTest::read_write_weights(), TQualityMetricTest::regression_inverse_mean_ratio_grad(), TQualityMetricTest::regression_inverse_mean_ratio_hess(), CachingTargetTest::request_all_targets_2d(), CachingTargetTest::request_all_targets_3d(), CachingTargetTest::request_all_targets_surf(), PatchDataTestNormals::setUp(), PMeanPMetricTest::setUp(), TagVertexMeshTest::setUp(), TargetReadWriteTest::setUp(), DomainClassifierTest::setUp(), QualityMetricTest::setUp(), CachingTargetTest::setUp(), MsqHessianTest::setUp(), MeshInterfaceTest::setUp(), QualityAssessorTest::setUp(), InstructionQueueTest::setUp(), MsqMeshEntityTest::setUp(), iMeshTest::setUp(), PMeanPTemplateTest::setUp(), AddQualityMetricTest::setUp(), MultiplyQualityMetricTest::setUp(), TopologyInfoTest::side_from_higher_order(), MeshImplTest::skin_mesh_2D(), MeshImplTest::skin_mesh_3D(), MeshImplTest::skin_mesh_higher_order(), MeshImplTest::skin_mesh_mixed(), smooth_mesh(), smooth_mixed_mesh(), LVQDTargetTest::target(), TMPQualityMetricTest< AWQualityMetric >::test_2d_eval_ortho_quad(), CachingTargetTest::test_2d_target_subpatch(), CachingTargetTest::test_2d_target_values(), TMPQualityMetricTest< AWQualityMetric >::test_3d_eval_ortho_hex(), CachingTargetTest::test_3d_target_subpatch(), CachingTargetTest::test_3d_target_values(), TerminationCriterionTest::test_abs_vtx_movement_culling(), TerminationCriterionTest::test_absolute_vertex_movement_edge_length(), InstructionQueueTest::test_add_preconditioner(), InstructionQueueTest::test_add_quality_assessor(), InstructionQueueTest::test_add_remove_vertex_slaver(), TopologyInfoTest::test_adj(), MsqMeshEntityTest::test_all_nodes(), MsqHessianTest::test_axpy(), Matrix3DTest::test_B_times_invA(), test_bad_element(), PatchSetTest::test_bad_handle(), QualityAssessorTest::test_basic_stats_element(), QualityAssessorTest::test_basic_stats_sample(), QualityAssessorTest::test_basic_stats_vertex(), CachingTargetTest::test_cache_cleared(), MsqMeshEntityTest::test_centroid(), SphericalGeometryTest::test_cg_mesh_cond_sphere(), MsqHessianTest::test_cg_solver(), NumericalOFTest::test_changed(), MsqMeshEntityTest::test_check_element_orientation(), MsqHessianTest::test_cholesky_preconditioner(), GeomPrimTest::test_circle_closest_with_tangent(), GeomPrimTest::test_circle_from_three_points(), GeomPrimTest::test_circle_from_two_points(), DomainClassifierTest::test_classify_by_geometry(), DomainClassifierTest::test_classify_by_handle(), DomainClassifierTest::test_classify_by_tag(), DomainClassifierTest::test_classify_skin(), NodeSetTest::test_clear(), NodeSetTest::test_clear_all(), LinearMappingFunctionTest::test_coeff_fail(), CompositeOFTest::test_composite_clone(), ObjectiveFunctionTest::test_compute_ana_hessian_tet(), ObjectiveFunctionTest::test_compute_ana_hessian_tet_scaled(), Vector3DTest::test_copy_constructor(), QuadLagrangeShapeTest::test_corner_coeff(), TriLagrangeShapeTest::test_corner_coeff(), TetLagrangeShapeTest::test_corner_coeff(), HexLagrangeShapeTest::test_corner_coeff(), QuadLagrangeShapeTest::test_corner_derivs(), TriLagrangeShapeTest::test_corner_derivs(), TetLagrangeShapeTest::test_corner_derivs(), HexLagrangeShapeTest::test_corner_derivs(), TerminationCriterionTest::test_cpu_time_common(), BoundedCylinderDomainTest::test_create_curve_from_mesh(), Vector3DTest::test_default_constructor(), LinearMappingFunctionTest::test_deriv_fail(), PMeanPTemplateTest::test_diagonal(), QualityMetricTest::test_diagonal_constant(), QualityMetricTest::test_diagonal_linear(), QualityMetricTest::test_diagonal_parabolic(), QualityMetricTest::test_diagonal_tau(), QualityMetricTester::test_diagonal_with_fixed_vertex(), QualityMetricTester::test_domain_deviation_gradient(), QualityMetricTester::test_domain_deviation_quality(), BoundedCylinderDomainTest::test_domain_DoF(), CylinderDomainTest::test_domain_DoF(), ConicDomainTest::test_domain_DoF(), SphericalDomainTest::test_domain_DoF(), Vector3DTest::test_double_constructor(), QuadLagrangeShapeTest::test_edge_coeff(), TriLagrangeShapeTest::test_edge_coeff(), TetLagrangeShapeTest::test_edge_coeff(), HexLagrangeShapeTest::test_edge_coeff(), QuadLagrangeShapeTest::test_edge_derivs(), TriLagrangeShapeTest::test_edge_derivs(), TetLagrangeShapeTest::test_edge_derivs(), HexLagrangeShapeTest::test_edge_derivs(), PMeanPMetricTest::test_element_evaluate(), MeshInterfaceTest::test_element_get_attached_vertex_indices(), ArrayMeshTest::test_element_iterator(), VtkTest::test_elements(), ArrayMeshTest::test_elements_get_attached_vertices(), MeshInterfaceTest::test_elements_get_attached_vertices(), ArrayMeshTest::test_elements_get_attached_vertices_mixed(), ArrayMeshTest::test_elements_get_attached_vertices_mixed_one_based(), ArrayMeshTest::test_elements_get_topologies(), ArrayMeshTest::test_elements_get_topologies_mixed(), MeshInterfaceTest::test_elements_get_topology(), Matrix3DTest::test_equal(), PMeanPTemplateTest::test_evaluate(), CompositeMetricTestBase::test_evaluate(), CompositeOFTest::test_evaluate(), test_evaluate(), TMPQualityMetricTest< QMType >::test_evaluate_2D(), TMPQualityMetricTest< AWQualityMetric >::test_evaluate_2D_weight(), TMPQualityMetricTest< QMType >::test_evaluate_3D(), TMPQualityMetricTest< AWQualityMetric >::test_evaluate_3D_weight(), TMPQualityMetricTest< QMType >::test_evaluate_surface(), TMPQualityMetricTest< AWQualityMetric >::test_evaluate_surface_weight(), TetLagrangeShapeTest::test_face_coeff(), HexLagrangeShapeTest::test_face_coeff(), TetLagrangeShapeTest::test_face_derivs(), HexLagrangeShapeTest::test_face_derivs(), TopologyInfoTest::test_face_elem(), TargetCalculatorTest::test_factor_2D(), TargetCalculatorTest::test_factor_2D_zero(), TargetCalculatorTest::test_factor_3D(), TargetCalculatorTest::test_factor_3D_zero(), TargetCalculatorTest::test_factor_surface(), TargetCalculatorTest::test_factor_surface_zero(), PatchSetTest::test_fail_entities(), PatchSetTest::test_fail_handles(), SlaveBoundaryVerticesTest::test_fail_if_slaves_not_calculated(), Matrix3DTest::test_fill_lower_triangle(), PatchDataTest::test_fixed_by_geom_dim(), QualityMetricTest::test_fixed_vertex_list(), MsqVertexTest::test_flags(), QualityAssessorTest::test_free_only(), PatchDataTest::test_get_adj_elems_2d(), ArrayMeshTest::test_get_all_elements(), ArrayMeshTest::test_get_all_vertices(), ArrayMeshTest::test_get_all_vertices_one_based(), PatchDataTestNormals::test_get_corner_normals_bounded_domain(), PatchDataTestNormals::test_get_corner_normals_infinite_domain(), QualityMetricTester::test_get_edge_evaluations(), QualityMetricTester::test_get_edge_indices(), QualityMetricTester::test_get_element_evaluations(), QualityMetricTester::test_get_element_indices(), PatchDataTestNormals::test_get_element_normals_bounded_domain(), PatchDataTestNormals::test_get_element_normals_infinite_domain(), PatchDataTest::test_get_element_vertex_coordinates(), PatchDataTest::test_get_element_vertex_indices(), QualityMetricTester::test_get_in_element_evaluations(), QualityMetricTester::test_get_indices_fixed(), PMeanPMetricTest::test_get_metric_type(), PatchDataTest::test_get_minmax_element_area(), QualityMetricTester::test_get_sample_evaluations(), QualityMetricTester::test_get_sample_indices(), PatchDataTest::test_get_vertex_element_indices(), QualityMetricTester::test_get_vertex_evaluations(), QualityMetricTester::test_get_vertex_indices(), PatchSetTest::test_global_patch(), QualityMetricTester::test_grad_transform_invariant(), PMeanPTemplateTest::test_gradient(), PMeanPMetricTest::test_gradient(), TerminationCriterionTest::test_gradient_common(), QualityMetricTest::test_gradient_constant(), QualityMetricTest::test_gradient_linear(), QualityMetricTest::test_gradient_parabolic(), QualityMetricTester::test_gradient_reflects_quality(), QualityMetricTest::test_gradient_tau(), NumericalOFTest::test_gradient_values(), QualityMetricTester::test_gradient_with_fixed_vertex(), NumericalOFTest::test_handles_eval_failure(), NumericalOFTest::test_handles_eval_false(), ObjectiveFunctionTests::test_handles_invalid_qm(), ObjectiveFunctionTests::test_handles_qm_error(), MsqFreeVertexIndexIteratorTest::test_hard_fixed_flags(), NodeSetTest::test_have_any(), PMeanPTemplateTest::test_Hessian(), PMeanPMetricTest::test_hessian(), QualityMetricTest::test_Hessian_constant(), PMeanPMetricTest::test_hessian_diagonal(), NumericalOFTest::test_Hessian_fails(), StdDevTemplateTest::test_hessian_fails(), StdDevTemplateTest::test_hessian_fails_sqr(), QualityMetricTest::test_Hessian_linear(), QualityMetricTest::test_Hessian_parabolic(), QualityMetricTest::test_Hessian_tau(), QualityMetricTester::test_hessian_transform_invariant(), QualityMetricTester::test_hessian_with_fixed_vertex(), MsqVertexTest::test_hex_vertices(), MsqMeshEntityTest::test_hex_vertices(), QualityAssessorTest::test_histogram_known_range(), QualityAssessorTest::test_histogram_unknown_range(), MappingFunctionTest::test_ideal_2d(), MappingFunctionTest::test_ideal_3d(), QualityMetricTester::test_ideal_element_positive_definite_Hessian(), QualityMetricTester::test_ideal_element_zero_gradient(), QualityMetricTester::test_ideal_element_zero_vertex_gradient(), QuadLagrangeShapeTest::test_ideal_jacobian(), TriLagrangeShapeTest::test_ideal_jacobian(), TetLagrangeShapeTest::test_ideal_jacobian(), PMeanPMetricTest::test_indices(), NodeSetTest::test_init(), MsqHessianTest::test_initialize(), InstructionQueueTest::test_insert_preconditioner(), InstructionQueueTest::test_insert_quality_assessor(), QualityAssessorTest::test_invalid_count(), CompositeOFTest::test_invalid_eval(), TetLagrangeShapeTest::test_invalid_nodebits_coeff(), TetLagrangeShapeTest::test_invalid_nodebits_deriv(), MappingFunctionTest::test_jacobian_2d(), MappingFunctionTest::test_jacobian_3d(), SphericalGeometryTest::test_lapl_geo_sphere(), VertexCullingRegressionTest::test_laplacian_smoothing_with_cull(), GeomPrimTest::test_line_closest_to_line(), GeomPrimTest::test_line_intersect(), ObjectiveFunctionTest::test_LInf_value(), ObjectiveFunctionTest::test_LPtoP_value(), ObjectiveFunctionTest::test_max_negate_flag(), ObjectiveFunctionTest::test_max_value(), QualityMetricTester::test_measures_quality(), QualityMetricTester::test_measures_transform(), QualityMetricTester::test_measures_vertex_quality(), QuadLagrangeShapeTest::test_mid_coeff(), TriLagrangeShapeTest::test_mid_coeff(), TetLagrangeShapeTest::test_mid_coeff(), HexLagrangeShapeTest::test_mid_coeff(), QuadLagrangeShapeTest::test_mid_derivs(), TriLagrangeShapeTest::test_mid_derivs(), TetLagrangeShapeTest::test_mid_derivs(), HexLagrangeShapeTest::test_mid_derivs(), Matrix3DTest::test_minus(), QualityAssessorTest::test_modify_metric(), PatchDataTest::test_move_free_vertices_constrained(), PatchDataTest::test_movement_function(), Matrix3DTest::test_mult_element(), CompositeOFTest::test_multiply_hess_diagonal(), CompositeOFTest::test_multiply_hessian(), ObjectiveFunctionTests::test_negate_flag(), ExtraDataTest::test_notify_new_patch_fill(), ExtraDataTest::test_notify_new_patch_sub(), ExtraDataTest::test_notify_subpatch(), PatchDataTest::test_num_corners(), TerminationCriterionTest::test_number_of_iterates_inner(), TerminationCriterionTest::test_number_of_iterates_outer(), TMetricTest< Metric, DIM >::test_numerical_gradient_2D(), AWMetricTest::test_numerical_gradient_2D(), TMetricTest< Metric, DIM >::test_numerical_gradient_3D(), AWMetricTest::test_numerical_gradient_3D(), TMetricTest< Metric, DIM >::test_numerical_hessian_2D(), AWMetricTest::test_numerical_hessian_2D(), TMetricTest< Metric, DIM >::test_numerical_hessian_3D(), AWMetricTest::test_numerical_hessian_3D(), Matrix3DTest::test_outer_product(), QualityAssessorTest::test_output_control(), PatchDataTest::test_patch_contents(), GeomPrimTest::test_plane_intersect_line(), GeomPrimTest::test_plane_intersect_plane(), PlanarGeometryTest::test_plane_quad_tangled(), PlanarGeometryTest::test_plane_tri_tangled(), PlanarGeometryTest::test_plane_tri_xz(), Matrix3DTest::test_plus(), Matrix3DTest::test_plus_equal(), Matrix3DTest::test_plus_transpose(), Matrix3DTest::test_plus_transpose_equal(), TopologyInfoTest::test_poly(), QualityAssessorTest::test_power_mean(), QualityAssessorTest::test_print_stats(), PatchDataTest::test_quad8_patch(), HigherOrderTest::test_quad_basic_ideal(), HigherOrderTest::test_quad_basic_left_down(), HigherOrderTest::test_quad_basic_left_over(), HigherOrderTest::test_quad_basic_mid_convex(), HigherOrderTest::test_quad_basic_mid_spin(), HigherOrderTest::test_quad_basic_right_up(), HigherOrderTest::test_quad_basic_top_down(), TerminationCriterionTest::test_quality_common(), ExodusTest::test_read(), VtkTest::test_read_fixed_attrib(), VtkTest::test_read_quadratic(), VtkTest::test_read_simple_scalar_attrib(), VtkTest::test_read_unstructured(), VtkTest::test_read_vector_attrib(), InstructionQueueTest::test_remove_preconditioner(), InstructionQueueTest::test_remove_quality_assessor(), TopologyInfoTest::test_rev_adj(), NodeSetTest::test_set_get_clear_dim(), NodeSetTest::test_set_get_clear_simple(), IdealElementTest::test_side_height_pyr(), SlaveBoundaryVerticesTest::test_slaved_common(), SphericalGeometryTest::test_smart_lapl_sphere(), XYRectangleTest::test_snap_to(), MsqFreeVertexIndexIteratorTest::test_soft_fixed_flags(), GeomPrimTest::test_sphere_closest_to_point(), GeomPrimTest::test_sphere_intersect_plane(), GeomPrimTest::test_sphere_intersect_sphere(), PatchDataTest::test_sub_patch(), TMPQualityMetricTest< AWQualityMetric >::test_surf_eval_ortho_quad(), CachingTargetTest::test_surface_orient_flag(), CachingTargetTest::test_surface_target_subpatch(), CachingTargetTest::test_surface_target_values(), QualityMetricTester::test_symmetric_Hessian_diagonal_blocks(), ArrayMeshTest::test_tag_data(), QualityAssessorTest::test_tag_element(), HigherOrderTest::test_tet_basic_apex_down(), HigherOrderTest::test_tet_basic_apex_over(), HigherOrderTest::test_tet_basic_apex_up(), HigherOrderTest::test_tet_basic_ideal(), HigherOrderTest::test_tet_basic_mid_convex(), HigherOrderTest::test_tet_basic_mid_spin(), Matrix3DTest::test_times(), Matrix3DTest::test_times_equal_scalar(), Matrix3DTest::test_times_scalar(), Matrix3DTest::test_times_vector(), QualityMetricTester::test_transform_invariant(), Matrix3DTest::test_transpose(), HigherOrderTest::test_tri_basic_ideal(), HigherOrderTest::test_tri_basic_mid_convex(), HigherOrderTest::test_tri_basic_mid_spin(), HigherOrderTest::test_tri_basic_peak_down(), HigherOrderTest::test_tri_basic_peak_over(), HigherOrderTest::test_tri_basic_peak_up(), HigherOrderTest::test_tri_open_domain(), HigherOrderTest::test_tri_slac(), QualityMetricTester::test_type_is_not_supported(), QualityMetricTester::test_type_is_supported(), NumericalOFTest::test_unchanged(), IdealElementTest::test_unit_edge_hex(), IdealElementTest::test_unit_edge_pyr(), IdealElementTest::test_unit_edge_quad(), IdealElementTest::test_unit_edge_tet(), IdealElementTest::test_unit_edge_tri(), IdealElementTest::test_unit_edge_wdg(), IdealElementTest::test_unit_height_pyr(), IdealElementTest::test_unit_hex(), IdealElementTest::test_unit_pyr(), IdealElementTest::test_unit_quad(), IdealElementTest::test_unit_tet(), IdealElementTest::test_unit_tri(), IdealElementTest::test_unit_wdg(), MsqMeshEntityTest::test_unsigned_area(), TerminationCriterionTest::test_untangled_mesh(), DomainClassifierTest::test_valid_classification(), Matrix3DTest::test_vector_times(), TerminationCriterionTest::test_vertex_bound(), MeshInterfaceTest::test_vertex_byte(), PMeanPMetricTest::test_vertex_evaluate(), MeshInterfaceTest::test_vertex_get_attached_elements(), QualityMetricTester::test_vertex_gradient_reflects_quality(), MeshInterfaceTest::test_vertex_is_fixed(), ArrayMeshTest::test_vertex_iterator(), ArrayMeshTest::test_vertex_iterator_one_based(), TerminationCriterionTest::test_vertex_movement_common(), PatchSetTest::test_vertex_patches(), ArrayMeshTest::test_vertex_set_byte(), ArrayMeshTest::test_vertex_set_coordinates(), ArrayMeshTest::test_vertex_set_coordinates_one_based(), ArrayMeshTest::test_vertex_set_coordinates_two_d(), MeshInterfaceTest::test_vertices(), ArrayMeshTest::test_vertices_get_attached_elements(), ArrayMeshTest::test_vertices_get_attached_elements_mixed(), ArrayMeshTest::test_vertices_get_attached_elements_mixed_one_based(), ArrayMeshTest::test_vertices_get_attached_elements_one_based(), ArrayMeshTest::test_vertices_get_coordinates(), ArrayMeshTest::test_vertices_get_coordinates_one_based(), ArrayMeshTest::test_vertices_get_coordinates_two_d(), ArrayMeshTest::test_vertices_get_fixed_flag(), ArrayMeshTest::test_vertices_set_byte(), TopologyInfoTest::test_vol_elem(), ExodusTest::test_write(), VtkTest::test_write(), VtkTest::test_write_quadratic(), CylinderDomainTest::test_x_closest_point(), CylinderDomainTest::test_z_closest_point(), iMeshTest::testDoubleTag(), iMeshTest::testElementConnectivity(), iMeshTest::testElementTopology(), iMeshTest::testIntTag(), iMeshTest::testVertexAdjacency(), iMeshTest::testVertexByte(), iMeshTest::testVertexFlag(), iMeshTest::testVertexFlagNone(), TopologyInfoTest::tet(), TopologyInfoTest::tet10(), TopologyInfoTest::tet11(), TopologyInfoTest::tet14(), TopologyInfoTest::tet15(), TopologyInfoTest::tet4(), TopologyInfoTest::tet5(), TopologyInfoTest::tet8(), TopologyInfoTest::tet9(), FileTokenizerTest::token_test(), TopologyInfoTest::tri(), TopologyInfoTest::tri3(), TopologyInfoTest::tri4(), TopologyInfoTest::tri6(), TopologyInfoTest::tri7(), FileTokenizerTest::unget_test(), FakeMesh::vertices_get_slaved_flag(), TopologyInfoTest::wedge(), TopologyInfoTest::wedge15(), TopologyInfoTest::wedge6(), PatchTranslate::xform(), PatchScale::xform(), PatchRotate::xform(), LinearMappingFunctionTest::xi_at_edges(), and LinearMappingFunctionTest::xi_at_faces().


Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 79 of file pyramid_test.cpp.

References MBMesquite::arrptr(), CPPUNIT_ASSERT, MBMesquite::MeshImpl::elements_get_attached_vertices(), MBMesquite::MeshImpl::elements_get_topologies(), MBMesquite::MeshImpl::get_all_elements(), input_file, MBMesquite::length(), mesh, metrics, MBMesquite::PYRAMID, MBMesquite::MeshImpl::read_vtk(), MBMesquite::Vector3D::set(), smooth_mesh(), smooth_mixed_mesh(), and MBMesquite::MeshImpl::vertices_get_coordinates().

{
    unsigned i;
    std::string input_file = TestDir + "/3D/vtk/mixed/tangled/mixed-hex-pyr-tet.vtk";
    if( argc == 2 )
        input_file = argv[1];
    else if( argc != 1 )
    {
        std::cerr << "Invalid arguments.\n";
        return 2;
    }

    MBMesquite::MsqPrintError err( cout );
    IdealWeightMeanRatio m1;
    IdealWeightInverseMeanRatio m2( err );
    ConditionNumberQualityMetric m3;
    QualityMetric* metrics[] = { &m1, &m2, &m3, 0 };

    // Read Mesh
    std::string mesh_file  = TestDir + "/3D/vtk/pyramids/untangled/12-pyramid-unit-sphere.vtk";
    std::string imesh_file = TestDir + "/3D/vtk/pyramids/untangled/12-pyramid-unit-sphere.vtk";
    MBMesquite::MeshImpl mesh;
    mesh.read_vtk( mesh_file.c_str(), err );
    CPPUNIT_ASSERT( !err );
    MBMesquite::MeshImpl ideal_mesh;
    ideal_mesh.read_vtk( imesh_file.c_str(), err );
    CPPUNIT_ASSERT( !err );

    // Check that the mesh read correctly, and contains what is
    // expected later.

    // Get mesh data
    // Expecting file to contain 12 pyramid elements constructed
    // from 15 vertices.
    std::vector< Mesh::VertexHandle > vert_array;
    std::vector< Mesh::ElementHandle > elem_array;
    std::vector< size_t > conn_offsets;
    mesh.get_all_elements( elem_array, err );
    CPPUNIT_ASSERT( !err );
    CPPUNIT_ASSERT( elem_array.size() == 12 );
    mesh.elements_get_attached_vertices( arrptr( elem_array ), elem_array.size(), vert_array, conn_offsets, err );
    CPPUNIT_ASSERT( !err );
    CPPUNIT_ASSERT( vert_array.size() == 60 );
    CPPUNIT_ASSERT( conn_offsets.size() == 13 );
    EntityTopology type_array[12];
    mesh.elements_get_topologies( arrptr( elem_array ), type_array, 12, err );
    CPPUNIT_ASSERT( !err );

    // Verify element types and number of vertices
    for( i = 0; i < 12; ++i )
    {
        CPPUNIT_ASSERT( type_array[i] == PYRAMID );
        CPPUNIT_ASSERT( conn_offsets[i] == 5 * i );
    }

    // All pyramids should share a common apex, at the
    // center of the sphere
    Mesh::VertexHandle apex_handle = vert_array[4];
    for( i = 1; i < 12; ++i )
    {
        CPPUNIT_ASSERT( vert_array[5 * i + 4] == apex_handle );
    }

    // Verify that apex is at origin and all other vertices are
    // on unit sphere
    MsqVertex vertices[60];
    mesh.vertices_get_coordinates( arrptr( vert_array ), vertices, 60, err );
    CPPUNIT_ASSERT( !err );
    for( i = 0; i < 60; ++i )
    {
        if( vert_array[i] == apex_handle )
            CPPUNIT_ASSERT( vertices[i].within_tolerance_box( Vector3D( 0, 0, 0 ), 1e-6 ) );
        else
            CPPUNIT_ASSERT( fabs( 1.0 - vertices[i].length() ) < 1e-6 );
    }

    // Try smoothing w/out moving the free vertex and verify that
    // the smoother didn't move the vertex
    Vector3D position( 0, 0, 0 );
    for( i = 0; metrics[i] != NULL; ++i )
        CPPUNIT_ASSERT( !smooth_mesh( &mesh, &ideal_mesh, apex_handle, position, metrics[i] ) );

    // Now try moving the vertex and see if the smoother moves it back
    // to the origin
    position.set( 0.1, 0.1, 0.1 );
    for( i = 0; metrics[i] != NULL; ++i )
        CPPUNIT_ASSERT( !smooth_mesh( &mesh, &ideal_mesh, apex_handle, position, metrics[i] ) );

    // Now try moving the vertex further and see if the smoother moves it back
    // to the origin
    position.set( 0.3, 0.3, 0.3 );
    for( i = 0; metrics[i] != NULL; ++i )
        CPPUNIT_ASSERT( !smooth_mesh( &mesh, &ideal_mesh, apex_handle, position, metrics[i] ) );

    // Now try smoothing a real mixed mesh
    CPPUNIT_ASSERT( !smooth_mixed_mesh( input_file.c_str() ) );

    return 0;
}
bool smooth_mesh ( Mesh mesh,
Mesh ref_mesh,
Mesh::VertexHandle  free_vertex_at_origin,
Vector3D  initial_free_vertex_position,
QualityMetric metric 
)

Definition at line 179 of file pyramid_test.cpp.

References MBMesquite::TerminationCriterion::add_absolute_vertex_movement(), MBMesquite::TerminationCriterion::add_iteration_limit(), CPPUNIT_ASSERT, MBMesquite::QualityMetric::get_name(), origin, MBMesquite::IQInterface::run_instructions(), MBMesquite::QualityImprover::set_inner_termination_criterion(), MBMesquite::InstructionQueue::set_master_quality_improver(), MBMesquite::QualityImprover::set_outer_termination_criterion(), TOL, MBMesquite::PatchSetUser::use_global_patch(), MBMesquite::Mesh::vertex_set_coordinates(), MBMesquite::Mesh::vertices_get_coordinates(), vtx(), and MBMesquite::Vector3D::within_tolerance_box().

Referenced by main().

{
    MBMesquite::MsqPrintError err( cout );
    const Vector3D origin( 0, 0, 0 );

    // print a little output so we know when we died
    std::cout << "**************************************************************************" << std::endl
              << "* Smoothing..." << std::endl
              << "* Metric: " << metric->get_name() << std::endl
              << "* Apex position: " << initial_free_vertex_position
              << std::endl  //<<
              //"**************************************************************************"
              << std::endl;

    // Set free vertex to specified position
    mesh->vertex_set_coordinates( free_vertex_at_origin, initial_free_vertex_position, err );
    CPPUNIT_ASSERT( !err );

    // Create an InstructionQueue
    InstructionQueue Q;

    // Set up objective function
    LPtoPTemplate obj_func( metric, 1, err );
    CPPUNIT_ASSERT( !err );

    // Create solver
    FeasibleNewton solver( &obj_func );
    CPPUNIT_ASSERT( !err );
    solver.use_global_patch();
    CPPUNIT_ASSERT( !err );

    // Set stoping criteria for solver
    TerminationCriterion tc_inner;
    tc_inner.add_absolute_vertex_movement( 1e-6 );
    solver.set_inner_termination_criterion( &tc_inner );

    TerminationCriterion tc_outer;
    tc_outer.add_iteration_limit( 1 );
    solver.set_outer_termination_criterion( &tc_outer );

    // Add solver to queue
    Q.set_master_quality_improver( &solver, err );
    CPPUNIT_ASSERT( !err );

    // And smooth...
    Q.run_instructions( mesh, err );
    CPPUNIT_ASSERT( !err );

    // Verify that vertex was moved back to origin
    MsqVertex vtx;
    mesh->vertices_get_coordinates( &free_vertex_at_origin, &vtx, 1, err );
    CPPUNIT_ASSERT( !err );
    Vector3D position = vtx;

    // print a little output so we know when we died
    std::cout  //<<
               //"**************************************************************************"
        << std::endl
        << "* Done Smoothing:" << std::endl
        << "* Metric: " << metric->get_name() << std::endl
        << "* Apex position: " << position << std::endl
        << "**************************************************************************" << std::endl;

    CPPUNIT_ASSERT( position.within_tolerance_box( Vector3D( 0, 0, 0 ), TOL ) );
    return false;
}
bool smooth_mixed_mesh ( const char *  filename)

Definition at line 247 of file pyramid_test.cpp.

References MBMesquite::TerminationCriterion::add_iteration_limit(), MBMesquite::InstructionQueue::add_preconditioner(), MBMesquite::QualityAssessor::add_quality_assessment(), MBMesquite::InstructionQueue::add_quality_assessor(), MBMesquite::TerminationCriterion::add_relative_quality_improvement(), CPPUNIT_ASSERT, mesh, MBMesquite::MeshImpl::read_vtk(), MBMesquite::IQInterface::run_instructions(), MBMesquite::QualityImprover::set_inner_termination_criterion(), MBMesquite::InstructionQueue::set_master_quality_improver(), MBMesquite::QualityImprover::set_outer_termination_criterion(), MBMesquite::PatchSetUser::use_element_on_vertex_patch(), and MBMesquite::PatchSetUser::use_global_patch().

Referenced by main().

{
    MBMesquite::MsqPrintError err( cout );

    // print a little output so we know when we died
    std::cout << "**************************************************************************" << std::endl
              << "* Smoothing: " << filename << std::endl
              << "**************************************************************************" << std::endl;

    // The instruction queue to set up
    InstructionQueue Q;

    // Use numeric approx of derivitives until analytic solutions
    // are working for pyramids
    IdealWeightInverseMeanRatio mr_metric( err );
    // sRI_DFT dft_metric;
    UntangleBetaQualityMetric un_metric( 0 );
    CPPUNIT_ASSERT( !err );

    // Create Mesh object
    MBMesquite::MeshImpl mesh;
    mesh.read_vtk( filename, err );
    CPPUNIT_ASSERT( !err );

    // Set up a preconditioner
    LInfTemplate pre_obj_func( &un_metric );
    ConjugateGradient precond( &pre_obj_func, err );
    CPPUNIT_ASSERT( !err );
    precond.use_element_on_vertex_patch();
    TerminationCriterion pre_term, pre_outer;
    // pre_term.add_relative_quality_improvement( 0.1 );
    pre_term.add_iteration_limit( 3 );
    pre_outer.add_iteration_limit( 1 );
    CPPUNIT_ASSERT( !err );
    precond.set_inner_termination_criterion( &pre_term );
    precond.set_outer_termination_criterion( &pre_outer );
    // precond.use_element_on_vertex_patch();

    // Set up objective function
    LPtoPTemplate obj_func( &mr_metric, 1, err );
    CPPUNIT_ASSERT( !err );

    // Create solver
    FeasibleNewton solver( &obj_func );
    CPPUNIT_ASSERT( !err );
    solver.use_global_patch();
    CPPUNIT_ASSERT( !err );

    // Set stoping criteria for solver
    TerminationCriterion tc_inner;
    tc_inner.add_relative_quality_improvement( 0.25 );
    solver.set_inner_termination_criterion( &tc_inner );

    TerminationCriterion tc_outer;
    tc_outer.add_iteration_limit( 1 );
    CPPUNIT_ASSERT( !err );
    solver.set_outer_termination_criterion( &tc_outer );

    // Create a QualityAssessor
    MBMesquite::QualityAssessor qa;
    qa.add_quality_assessment( &mr_metric );
    qa.add_quality_assessment( &un_metric );
    Q.add_quality_assessor( &qa, err );
    CPPUNIT_ASSERT( !err );

    // Add untangler to queue
    Q.add_preconditioner( &precond, err );
    CPPUNIT_ASSERT( !err );
    Q.add_quality_assessor( &qa, err );
    CPPUNIT_ASSERT( !err );

    // Add solver to queue
    Q.set_master_quality_improver( &solver, err );
    CPPUNIT_ASSERT( !err );
    Q.add_quality_assessor( &qa, err );
    CPPUNIT_ASSERT( !err );

    // And smooth...
    Q.run_instructions( &mesh, err );
    CPPUNIT_ASSERT( !err );

    return false;
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines