MOAB: Mesh Oriented datABase
(version 5.5.0)
|
#include "moab/Core.hpp"
#include "moab/Range.hpp"
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <map>
#include <vector>
#include <algorithm>
#include <sstream>
#include "TestUtil.hpp"
Go to the source code of this file.
Classes | |
struct | test_data |
Macros | |
#define | DECLARE_TEST(A) |
#define | CHECK(A) if( is_error( ( A ) ) ) return do_error( #A, __LINE__ ) |
Typedefs | |
typedef bool(* | test_ptr) () |
Variables | |
std::string | poly_example = TestDir + "unittest/io/poly8-10.vtk" |
std::string | polyhedra_example = TestDir + "unittest/io/polyhedra.vtk" |
size_t | num_tests = 0 |
test_data * | test_array = 0 |
const double | grid_3x3 [] |
const int | quad_structured_conn [] |
const double | grid_2x2x2 [] |
const int | hex_structured_conn [] |
const char | two_quad_mesh [] |
const double | two_quad_mesh_coords [] = { -1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 1, 0, 0, 1, 0, 1, 1, 0 } |
const int | two_quad_mesh_conn [] = { 0, 1, 4, 3, 1, 2, 5, 4 } |
const int | vertex_values [] |
const int | element_values [] |
Definition at line 189 of file VtkTest.cpp.
#define DECLARE_TEST | ( | A | ) |
Definition at line 20 of file VtkTest.cpp.
typedef bool( * test_ptr) () |
Definition at line 24 of file VtkTest.cpp.
bool check_elements | ( | Interface * | iface, |
EntityType | moab_type, | ||
unsigned | num_elem, | ||
unsigned | vert_per_elem, | ||
const double * | coords, | ||
unsigned | num_vert, | ||
const int * | connectivity | ||
) |
Definition at line 926 of file VtkTest.cpp.
References CHECK, iface, and match_vertices_and_elements().
Referenced by test_read_write_element(), test_structured_2d(), and test_structured_3d().
bool check_tag_data | ( | const char * | file, |
DataType | type, | ||
int | vals_per_ent | ||
) |
Definition at line 1151 of file VtkTest.cpp.
References CHECK, check_tag_values(), read_file(), and write_and_read().
Referenced by test_scalar_attrib(), test_tensor_attrib(), and test_vector_attrib().
bool check_tag_values | ( | Interface * | iface, |
DataType | tag_type, | ||
int | tag_length, | ||
int | num_entities, | ||
const EntityHandle * | entities, | ||
const int * | values | ||
) |
Definition at line 1067 of file VtkTest.cpp.
References CHECK, entities, ErrorCode, iface, MB_TYPE_BIT, MB_TYPE_DOUBLE, MB_TYPE_INTEGER, MB_TYPE_OPAQUE, size, moab::Interface::tag_get_bytes(), moab::Interface::tag_get_data(), moab::Interface::tag_get_handle(), and moab::Interface::tag_get_length().
Referenced by check_tag_data(), and check_tag_values().
Definition at line 1137 of file VtkTest.cpp.
References CHECK, check_tag_values(), element_values, iface, match_vertices_and_elements(), MBQUAD, two_quad_mesh_conn, two_quad_mesh_coords, and vertex_values.
bool compare_connectivity | ( | EntityType | , |
const int * | conn1, | ||
const int * | conn2, | ||
unsigned | len | ||
) |
|
static |
Definition at line 191 of file VtkTest.cpp.
|
inlinestatic |
Definition at line 196 of file VtkTest.cpp.
|
inlinestatic |
Definition at line 208 of file VtkTest.cpp.
References MB_SUCCESS.
int main | ( | int | argc, |
char * | argv[] | ||
) |
bool match_vertices_and_elements | ( | Interface * | iface, |
EntityType | moab_type, | ||
unsigned | num_vert, | ||
unsigned | num_elem, | ||
unsigned | vert_per_elem, | ||
const double * | coords, | ||
const int * | connectivity, | ||
EntityHandle * | vert_handles, | ||
EntityHandle * | elem_handles | ||
) |
Definition at line 825 of file VtkTest.cpp.
References moab::Range::begin(), CHECK, compare_connectivity(), moab::Range::end(), ErrorCode, moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::Interface::get_entities_by_type(), iface, MBVERTEX, and moab::Range::size().
Referenced by check_elements(), check_tag_values(), and test_unstructured_field().
bool read_file | ( | Interface * | iface, |
const char * | file | ||
) |
Definition at line 794 of file VtkTest.cpp.
References CHECK, ErrorCode, fname, iface, and moab::Interface::load_mesh().
Referenced by check_tag_data(), test_cone_curve_facet(), test_cube_curve_facet(), test_free_vertices(), test_read_write_element(), test_structured_2d(), test_structured_3d(), and test_unstructured_field().
int register_test | ( | test_ptr | test, |
const char * | name | ||
) |
Definition at line 33 of file VtkTest.cpp.
References test_data::name, num_tests, test_data::result, test, test_data::test, and test_array.
bool test_edge2 | ( | ) |
bool test_edge3 | ( | ) |
bool test_free_nodes | ( | ) |
bool test_free_vertices | ( | const char * | file | ) |
Definition at line 455 of file VtkTest.cpp.
References CHECK, and read_file().
Referenced by test_free_nodes().
bool test_hex20 | ( | ) |
Definition at line 373 of file VtkTest.cpp.
References grid_2x2x2, MBHEX, and test_read_write_element().
bool test_hex27 | ( | ) |
Definition at line 381 of file VtkTest.cpp.
References grid_2x2x2, MBHEX, and test_read_write_element().
bool test_hex8 | ( | ) |
Definition at line 356 of file VtkTest.cpp.
References CHECK, grid_2x2x2, hex_structured_conn, MBHEX, and test_read_write_element().
bool test_polygon | ( | ) |
bool test_polygon_mix | ( | ) |
Definition at line 304 of file VtkTest.cpp.
References ErrorCode, moab::Core::load_file(), mb, MB_SUCCESS, and poly_example.
bool test_polyhedra | ( | ) |
Definition at line 315 of file VtkTest.cpp.
References ErrorCode, moab::Core::get_entities_by_type(), moab::Core::load_file(), mb, MB_SUCCESS, MBPOLYHEDRON, polyhedra_example, and moab::Range::size().
bool test_pyramid | ( | ) |
bool test_pyramid13 | ( | ) |
Definition at line 419 of file VtkTest.cpp.
References MBPYRAMID, and test_read_write_element().
bool test_quad4 | ( | ) |
Definition at line 264 of file VtkTest.cpp.
References grid_3x3, MBQUAD, quad_structured_conn, and test_read_write_element().
bool test_quad8 | ( | ) |
bool test_quad9 | ( | ) |
bool test_read_write_element | ( | const double * | coords, |
unsigned | num_coords, | ||
const int * | vtk_conn, | ||
const int * | moab_conn, | ||
unsigned | num_conn, | ||
unsigned | num_elem, | ||
unsigned | vtk_type, | ||
EntityType | moab_type | ||
) |
Definition at line 941 of file VtkTest.cpp.
References CHECK, check_elements(), read_file(), and write_and_read().
Referenced by test_edge2(), test_edge3(), test_hex20(), test_hex27(), test_hex8(), test_polygon(), test_pyramid(), test_pyramid13(), test_quad4(), test_quad8(), test_quad9(), test_tet10(), test_tet4(), test_tri3(), test_tri6(), test_wedge(), and test_wedge15().
bool test_rectilinear_grid_2d | ( | ) |
bool test_rectilinear_grid_3d | ( | ) |
bool test_scalar_attrib | ( | const char * | vtk_type, |
DataType | mb_type, | ||
int | count | ||
) |
Definition at line 1167 of file VtkTest.cpp.
References check_tag_data(), element_values, two_quad_mesh, vertex_values, and write_data().
Referenced by test_scalar_attrib_1_bit(), test_scalar_attrib_1_char(), test_scalar_attrib_1_double(), test_scalar_attrib_1_float(), test_scalar_attrib_1_int(), test_scalar_attrib_1_long(), test_scalar_attrib_1_short(), test_scalar_attrib_1_uchar(), test_scalar_attrib_1_uint(), test_scalar_attrib_1_ulong(), test_scalar_attrib_1_ushort(), test_scalar_attrib_4_bit(), test_scalar_attrib_4_char(), test_scalar_attrib_4_double(), test_scalar_attrib_4_float(), test_scalar_attrib_4_int(), test_scalar_attrib_4_long(), test_scalar_attrib_4_short(), test_scalar_attrib_4_uchar(), test_scalar_attrib_4_uint(), test_scalar_attrib_4_ulong(), and test_scalar_attrib_4_ushort().
bool test_scalar_attrib_1_bit | ( | ) |
Definition at line 579 of file VtkTest.cpp.
References MB_TYPE_BIT, and test_scalar_attrib().
bool test_scalar_attrib_1_char | ( | ) |
Definition at line 589 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_1_double | ( | ) |
Definition at line 629 of file VtkTest.cpp.
References MB_TYPE_DOUBLE, and test_scalar_attrib().
bool test_scalar_attrib_1_float | ( | ) |
Definition at line 624 of file VtkTest.cpp.
References MB_TYPE_DOUBLE, and test_scalar_attrib().
bool test_scalar_attrib_1_int | ( | ) |
Definition at line 609 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_1_long | ( | ) |
Definition at line 619 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_1_short | ( | ) |
Definition at line 599 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_1_uchar | ( | ) |
Definition at line 584 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_1_uint | ( | ) |
Definition at line 604 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_1_ulong | ( | ) |
Definition at line 614 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_1_ushort | ( | ) |
Definition at line 594 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_4_bit | ( | ) |
Definition at line 634 of file VtkTest.cpp.
References MB_TYPE_BIT, and test_scalar_attrib().
bool test_scalar_attrib_4_char | ( | ) |
Definition at line 644 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_4_double | ( | ) |
Definition at line 684 of file VtkTest.cpp.
References MB_TYPE_DOUBLE, and test_scalar_attrib().
bool test_scalar_attrib_4_float | ( | ) |
Definition at line 679 of file VtkTest.cpp.
References MB_TYPE_DOUBLE, and test_scalar_attrib().
bool test_scalar_attrib_4_int | ( | ) |
Definition at line 664 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_4_long | ( | ) |
Definition at line 674 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_4_short | ( | ) |
Definition at line 654 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_4_uchar | ( | ) |
Definition at line 639 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_4_uint | ( | ) |
Definition at line 659 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_4_ulong | ( | ) |
Definition at line 669 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_scalar_attrib_4_ushort | ( | ) |
Definition at line 649 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_scalar_attrib().
bool test_structured_2d | ( | const char * | file | ) |
Definition at line 993 of file VtkTest.cpp.
References CHECK, check_elements(), grid_3x3, MBQUAD, quad_structured_conn, and read_file().
Referenced by test_rectilinear_grid_2d(), test_structured_grid_2d(), and test_structured_points_2d().
bool test_structured_3d | ( | const char * | file | ) |
Definition at line 1005 of file VtkTest.cpp.
References CHECK, check_elements(), grid_2x2x2, hex_structured_conn, MBHEX, and read_file().
Referenced by test_rectilinear_grid_3d(), test_structured_grid_3d(), and test_structured_points_3d().
bool test_structured_grid_2d | ( | ) |
Definition at line 504 of file VtkTest.cpp.
References grid_3x3, and test_structured_2d().
bool test_structured_grid_3d | ( | ) |
Definition at line 545 of file VtkTest.cpp.
References grid_2x2x2, and test_structured_3d().
bool test_structured_points_2d | ( | ) |
bool test_structured_points_3d | ( | ) |
bool test_subset | ( | ) |
Definition at line 1214 of file VtkTest.cpp.
References CHECK, ErrorCode, MB_SUCCESS, MBQUAD, MBVERTEX, moab::Range::size(), moab::subtract(), and moab::Interface::UNION.
bool test_tensor_attrib | ( | const char * | vtk_type, |
DataType | mb_type | ||
) |
Definition at line 1199 of file VtkTest.cpp.
References check_tag_data(), element_values, two_quad_mesh, vertex_values, and write_data().
Referenced by test_tensor_attrib_char(), test_tensor_attrib_double(), test_tensor_attrib_float(), test_tensor_attrib_int(), test_tensor_attrib_long(), test_tensor_attrib_short(), test_tensor_attrib_uchar(), test_tensor_attrib_uint(), test_tensor_attrib_ulong(), and test_tensor_attrib_ushort().
bool test_tensor_attrib_char | ( | ) |
Definition at line 749 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_tensor_attrib().
bool test_tensor_attrib_double | ( | ) |
Definition at line 789 of file VtkTest.cpp.
References MB_TYPE_DOUBLE, and test_tensor_attrib().
bool test_tensor_attrib_float | ( | ) |
Definition at line 784 of file VtkTest.cpp.
References MB_TYPE_DOUBLE, and test_tensor_attrib().
bool test_tensor_attrib_int | ( | ) |
Definition at line 769 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_tensor_attrib().
bool test_tensor_attrib_long | ( | ) |
Definition at line 779 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_tensor_attrib().
bool test_tensor_attrib_short | ( | ) |
Definition at line 759 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_tensor_attrib().
bool test_tensor_attrib_uchar | ( | ) |
Definition at line 744 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_tensor_attrib().
bool test_tensor_attrib_uint | ( | ) |
Definition at line 764 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_tensor_attrib().
bool test_tensor_attrib_ulong | ( | ) |
Definition at line 774 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_tensor_attrib().
bool test_tensor_attrib_ushort | ( | ) |
Definition at line 754 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_tensor_attrib().
bool test_tet10 | ( | ) |
bool test_tet4 | ( | ) |
bool test_tri3 | ( | ) |
bool test_tri6 | ( | ) |
Definition at line 250 of file VtkTest.cpp.
References MBTRI, and test_read_write_element().
bool test_unstructured_field | ( | ) |
Definition at line 1355 of file VtkTest.cpp.
References CHECK, match_vertices_and_elements(), mb, MBQUAD, read_file(), two_quad_mesh, two_quad_mesh_conn, and two_quad_mesh_coords.
bool test_vector_attrib | ( | const char * | vtk_type, |
DataType | mb_type | ||
) |
Definition at line 1184 of file VtkTest.cpp.
References check_tag_data(), element_values, two_quad_mesh, vertex_values, and write_data().
Referenced by test_vector_attrib_bit(), test_vector_attrib_char(), test_vector_attrib_double(), test_vector_attrib_float(), test_vector_attrib_int(), test_vector_attrib_long(), test_vector_attrib_short(), test_vector_attrib_uchar(), test_vector_attrib_uint(), test_vector_attrib_ulong(), and test_vector_attrib_ushort().
bool test_vector_attrib_bit | ( | ) |
Definition at line 689 of file VtkTest.cpp.
References MB_TYPE_BIT, and test_vector_attrib().
bool test_vector_attrib_char | ( | ) |
Definition at line 699 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_vector_attrib().
bool test_vector_attrib_double | ( | ) |
Definition at line 739 of file VtkTest.cpp.
References MB_TYPE_DOUBLE, and test_vector_attrib().
bool test_vector_attrib_float | ( | ) |
Definition at line 734 of file VtkTest.cpp.
References MB_TYPE_DOUBLE, and test_vector_attrib().
bool test_vector_attrib_int | ( | ) |
Definition at line 719 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_vector_attrib().
bool test_vector_attrib_long | ( | ) |
Definition at line 729 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_vector_attrib().
bool test_vector_attrib_short | ( | ) |
Definition at line 709 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_vector_attrib().
bool test_vector_attrib_uchar | ( | ) |
Definition at line 694 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_vector_attrib().
bool test_vector_attrib_uint | ( | ) |
Definition at line 714 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_vector_attrib().
bool test_vector_attrib_ulong | ( | ) |
Definition at line 724 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_vector_attrib().
bool test_vector_attrib_ushort | ( | ) |
Definition at line 704 of file VtkTest.cpp.
References MB_TYPE_INTEGER, and test_vector_attrib().
bool test_wedge | ( | ) |
Definition at line 391 of file VtkTest.cpp.
References MBPRISM, and test_read_write_element().
bool test_wedge15 | ( | ) |
bool test_write_free_nodes | ( | ) |
Definition at line 1303 of file VtkTest.cpp.
References CHECK, ErrorCode, MB_SUCCESS, MB_TYPE_INTEGER, and MBQUAD.
Definition at line 807 of file VtkTest.cpp.
References CHECK, ErrorCode, fname, moab::Interface::load_mesh(), and moab::Interface::write_mesh().
Referenced by check_tag_data(), and test_read_write_element().
void write_data | ( | char * | file, |
size_t & | len, | ||
DataType | type, | ||
unsigned | count, | ||
const int * | vals | ||
) |
Definition at line 1042 of file VtkTest.cpp.
References MB_TYPE_BIT, MB_TYPE_DOUBLE, MB_TYPE_INTEGER, and MB_TYPE_OPAQUE.
Referenced by test_scalar_attrib(), test_tensor_attrib(), and test_vector_attrib().
const int element_values[] |
Definition at line 1039 of file VtkTest.cpp.
Referenced by check_tag_values(), test_scalar_attrib(), test_tensor_attrib(), and test_vector_attrib().
const double grid_2x2x2[] |
Definition at line 347 of file VtkTest.cpp.
Referenced by test_hex20(), test_hex27(), test_hex8(), test_structured_3d(), and test_structured_grid_3d().
const double grid_3x3[] |
Definition at line 258 of file VtkTest.cpp.
Referenced by test_quad4(), test_structured_2d(), and test_structured_grid_2d().
const int hex_structured_conn[] |
Definition at line 351 of file VtkTest.cpp.
Referenced by test_hex8(), and test_structured_3d().
size_t num_tests = 0 |
Definition at line 31 of file VtkTest.cpp.
Referenced by find_volume_tests(), initialize_default_files(), main(), and register_test().
std::string poly_example = TestDir + "unittest/io/poly8-10.vtk" |
Definition at line 17 of file VtkTest.cpp.
Referenced by test_polygon_mix().
std::string polyhedra_example = TestDir + "unittest/io/polyhedra.vtk" |
Definition at line 18 of file VtkTest.cpp.
Referenced by test_polyhedra().
const int quad_structured_conn[] |
Definition at line 261 of file VtkTest.cpp.
Referenced by test_quad4(), and test_structured_2d().
test_data* test_array = 0 |
Definition at line 32 of file VtkTest.cpp.
Referenced by main(), and register_test().
const char two_quad_mesh[] |
Definition at line 1017 of file VtkTest.cpp.
Referenced by test_scalar_attrib(), test_tensor_attrib(), test_unstructured_field(), and test_vector_attrib().
const int two_quad_mesh_conn[] = { 0, 1, 4, 3, 1, 2, 5, 4 } |
Definition at line 1035 of file VtkTest.cpp.
Referenced by check_tag_values(), and test_unstructured_field().
const double two_quad_mesh_coords[] = { -1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 1, 0, 0, 1, 0, 1, 1, 0 } |
Definition at line 1034 of file VtkTest.cpp.
Referenced by check_tag_values(), and test_unstructured_field().
const int vertex_values[] |
Definition at line 1037 of file VtkTest.cpp.
Referenced by check_tag_values(), test_scalar_attrib(), test_tensor_attrib(), and test_vector_attrib().