MOAB: Mesh Oriented datABase
(version 5.5.0)
|
#include "TestUtil.hpp"
#include "moab/Core.hpp"
#include "MBTagConventions.hpp"
#include "moab/CN.hpp"
#include "moab/Range.hpp"
#include "moab/GeomTopoTool.hpp"
#include <cmath>
#include <algorithm>
Go to the source code of this file.
Functions | |
void | read_file (Interface &moab, const std::string &input_file) |
void | check_adj_ho_nodes (Interface &moab, EntityHandle entity) |
void | check_ho_element (Interface &moab, EntityHandle entity, int mid_nodes[4]) |
void | test_ho_elements (EntityType type, int num_nodes) |
void | test_vertices () |
void | test_edges () |
void | test_quads () |
void | test_hexes () |
void | test_geometric_topology () |
void | test_geometric_sets () |
void | test_blocks () |
void | test_side_sets () |
void | test_node_sets () |
void | test_tri6 () |
void | test_tri7 () |
void | test_quad5 () |
void | test_quad8 () |
void | test_quad9 () |
void | test_tet8 () |
void | test_tet10 () |
void | test_tet14 () |
void | test_hex9 () |
void | test_hex20 () |
void | test_hex27 () |
void | test_multiple_files () |
void | test_cubit12 () |
void | test_cubit14 () |
int | main () |
void | test_element (const std::string &filename, EntityType type, int num_elem, int node_per_elem, const int *conn_list) |
template<int L> | |
std::vector< int > | find_parents (const int parent_conn[][L], int num_parent, int id) |
int | check_geometric_set (Interface &moab, int dim, int id, const int *children, int num_children, std::vector< int > parents) |
void | test_bc_sets (const char *tag_name, unsigned count, const int *ids, const std::vector< int > set_surfs[]) |
static EntityHandle | find_side (Interface &moab, EntityHandle entity, int side_dim, int side_num) |
Variables | |
static const std::string | input_file_1 = std::string( TestDir + "unittest/io/test.cub" ) |
Input test file: test.cub Cubit 10.2 file. File contains: Two merged 10x10x10 bricks sharing a single surface (surface 6). More... | |
static const std::string | ho_file = std::string( TestDir + "unittest/io/ho_test.cub" ) |
static const std::string | cubit12_file = std::string( TestDir + "unittest/io/cubtest12.cub" ) |
static const std::string | cubit14_file = std::string( TestDir + "unittest/io/cubtest14.cub" ) |
void check_adj_ho_nodes | ( | Interface & | moab, |
EntityHandle | entity | ||
) |
Definition at line 713 of file cub_file_test.cpp.
References CHECK_EQUAL, CHECK_ERR, dim, moab::CN::Dimension(), ErrorCode, find_side(), moab::CN::HasMidNodes(), moab::CN::HONodeIndex(), moab::CN::NumSubEntities(), and moab::TYPE_FROM_HANDLE().
Referenced by test_ho_elements().
int check_geometric_set | ( | Interface & | moab, |
int | dim, | ||
int | id, | ||
const int * | children, | ||
int | num_children, | ||
std::vector< int > | parents | ||
) |
Definition at line 354 of file cub_file_test.cpp.
References CHECK, CHECK_EQUAL, CHECK_ERR, children, dim, dim_tag, ErrorCode, moab::Range::front(), geom, MB_TYPE_INTEGER, MBENTITYSET, rel, and moab::Range::size().
Referenced by test_geometric_topology().
void check_ho_element | ( | Interface & | moab, |
EntityHandle | entity, | ||
int | mid_nodes[4] | ||
) |
Definition at line 745 of file cub_file_test.cpp.
References CHECK_EQUAL, CHECK_ERR, CHECK_REAL_EQUAL, moab::CN::Dimension(), ErrorCode, moab::CN::HONodeParent(), moab::CN::NumSubEntities(), moab::CN::SubEntityType(), moab::CN::SubEntityVertexIndices(), moab::TYPE_FROM_HANDLE(), and moab::CN::VerticesPerEntity().
Referenced by test_ho_elements().
std::vector< int > find_parents | ( | const int | parent_conn[][L], |
int | num_parent, | ||
int | id | ||
) |
Definition at line 341 of file cub_file_test.cpp.
|
static |
Definition at line 669 of file cub_file_test.cpp.
References CHECK_ERR, ErrorCode, moab::CN::SubEntityType(), moab::CN::SubEntityVertexIndices(), moab::TYPE_FROM_HANDLE(), and moab::CN::VerticesPerEntity().
Referenced by check_adj_ho_nodes().
int main | ( | ) |
Definition at line 173 of file cub_file_test.cpp.
References RUN_TEST, test_blocks(), test_cubit12(), test_cubit14(), test_edges(), test_geometric_sets(), test_geometric_topology(), test_hex20(), test_hex27(), test_hex9(), test_hexes(), test_multiple_files(), test_node_sets(), test_quad5(), test_quad8(), test_quad9(), test_quads(), test_side_sets(), test_tet10(), test_tet14(), test_tet8(), test_tri6(), test_tri7(), and test_vertices().
void read_file | ( | Interface & | moab, |
const std::string & | input_file | ||
) |
Definition at line 203 of file cub_file_test.cpp.
References CHECK_ERR, ErrorCode, and input_file.
Referenced by test_bc_sets(), test_blocks(), test_cubit12(), test_cubit14(), test_element(), test_geometric_sets(), test_geometric_topology(), test_ho_elements(), test_multiple_files(), and test_vertices().
void test_bc_sets | ( | const char * | tag_name, |
unsigned | count, | ||
const int * | ids, | ||
const std::vector< int > | set_surfs[] | ||
) |
Definition at line 585 of file cub_file_test.cpp.
References moab::Range::begin(), CHECK, CHECK_EQUAL, CHECK_ERR, moab::Range::clear(), dim_tag, moab::Range::end(), ErrorCode, moab::Range::front(), moab::Core::get_entities_by_dimension(), moab::Core::get_entities_by_type_and_tag(), input_file_1, mb, MB_TYPE_INTEGER, MBENTITYSET, read_file(), moab::Range::size(), moab::Core::tag_get_data(), and moab::Core::tag_get_handle().
Referenced by test_node_sets(), and test_side_sets().
void test_blocks | ( | ) |
Definition at line 555 of file cub_file_test.cpp.
References CHECK, CHECK_EQUAL, CHECK_ERR, ErrorCode, moab::Range::front(), moab::Core::get_entities_by_dimension(), moab::Core::get_entities_by_type_and_tag(), input_file_1, MATERIAL_SET_TAG_NAME, mb, MB_TYPE_INTEGER, MBENTITYSET, read_file(), moab::Range::size(), moab::Core::tag_get_data(), and moab::Core::tag_get_handle().
Referenced by main().
void test_cubit12 | ( | ) |
Definition at line 888 of file cub_file_test.cpp.
References cubit12_file, mb, and read_file().
Referenced by main().
void test_cubit14 | ( | ) |
Definition at line 895 of file cub_file_test.cpp.
References CHECK, CHECK_ERR, cubit14_file, ErrorCode, moab::GeomTopoTool::find_geomsets(), mb, MB_TYPE_INTEGER, read_file(), moab::Core::tag_get_data(), and moab::Core::tag_get_handle().
Referenced by main().
void test_edges | ( | ) |
Definition at line 297 of file cub_file_test.cpp.
References input_file_1, MBEDGE, and test_element().
Referenced by main().
void test_element | ( | const std::string & | filename, |
EntityType | type, | ||
int | num_elem, | ||
int | node_per_elem, | ||
const int * | conn_list | ||
) |
Definition at line 258 of file cub_file_test.cpp.
References moab::Range::begin(), CHECK_EQUAL, CHECK_ERR, ErrorCode, filename, moab::Core::get_connectivity(), moab::Core::get_entities_by_type(), mb, MB_TYPE_INTEGER, read_file(), moab::Range::size(), moab::Core::tag_get_data(), and moab::Core::tag_get_handle().
Referenced by test_edges(), test_hexes(), and test_quads().
void test_geometric_sets | ( | ) |
Definition at line 452 of file cub_file_test.cpp.
References moab::Range::all_of_type(), moab::Range::begin(), CHECK, CHECK_EQUAL, CHECK_ERR, moab::Range::clear(), dim, dim_tag, moab::Range::empty(), moab::Range::end(), ErrorCode, geom, moab::Core::get_adjacencies(), moab::Core::get_entities_by_dimension(), moab::Core::get_entities_by_handle(), moab::Core::get_entities_by_type(), moab::Core::get_entities_by_type_and_tag(), moab::Core::get_parent_meshsets(), input_file_1, mb, MB_TYPE_INTEGER, MBEDGE, MBENTITYSET, MBHEX, MBQUAD, MBVERTEX, moab::Range::merge(), moab::Range::num_of_type(), read_file(), moab::Range::size(), moab::subtract(), moab::Core::tag_get_handle(), and moab::Interface::UNION.
Referenced by main().
void test_geometric_topology | ( | ) |
Definition at line 406 of file cub_file_test.cpp.
References check_geometric_set(), input_file_1, mb, and read_file().
Referenced by main().
void test_hex20 | ( | ) |
Definition at line 159 of file cub_file_test.cpp.
References MBHEX, and test_ho_elements().
Referenced by main().
void test_hex27 | ( | ) |
Definition at line 163 of file cub_file_test.cpp.
References MBHEX, and test_ho_elements().
Referenced by main().
void test_hex9 | ( | ) |
Definition at line 155 of file cub_file_test.cpp.
References MBHEX, and test_ho_elements().
Referenced by main().
void test_hexes | ( | ) |
Definition at line 329 of file cub_file_test.cpp.
References input_file_1, MBHEX, and test_element().
Referenced by main().
void test_ho_elements | ( | EntityType | type, |
int | num_nodes | ||
) |
Definition at line 805 of file cub_file_test.cpp.
References moab::Range::begin(), CHECK, check_adj_ho_nodes(), CHECK_ERR, check_ho_element(), moab::Range::end(), entities, ErrorCode, moab::Core::get_entities_by_type(), moab::Core::get_entities_by_type_and_tag(), HAS_MID_NODES_TAG_NAME, moab::CN::HasMidNodes(), ho_file, MATERIAL_SET_TAG_NAME, mb, MB_TYPE_INTEGER, MBENTITYSET, read_file(), and moab::Core::tag_get_handle().
Referenced by test_hex20(), test_hex27(), test_hex9(), test_quad5(), test_quad8(), test_quad9(), test_tet10(), test_tet14(), test_tet8(), test_tri6(), and test_tri7().
void test_multiple_files | ( | ) |
Definition at line 840 of file cub_file_test.cpp.
References moab::Core::add_entities(), CHECK, CHECK_EQUAL, CHECK_ERR, moab::Core::create_meshset(), moab::Range::empty(), ErrorCode, moab::Core::get_adjacencies(), moab::Core::get_entities_by_dimension(), moab::Core::get_entities_by_handle(), moab::Core::get_entities_by_type(), input_file_1, moab::intersect(), mb, MBVERTEX, MESHSET_SET, read_file(), moab::Range::size(), moab::subtract(), and moab::Interface::UNION.
Referenced by main().
void test_node_sets | ( | ) |
Definition at line 658 of file cub_file_test.cpp.
References DIRICHLET_SET_TAG_NAME, and test_bc_sets().
Referenced by main().
void test_quad5 | ( | ) |
Definition at line 129 of file cub_file_test.cpp.
References MBQUAD, and test_ho_elements().
Referenced by main().
void test_quad8 | ( | ) |
Definition at line 133 of file cub_file_test.cpp.
References MBQUAD, and test_ho_elements().
Referenced by main().
void test_quad9 | ( | ) |
Definition at line 137 of file cub_file_test.cpp.
References MBQUAD, and test_ho_elements().
Referenced by main().
void test_quads | ( | ) |
Definition at line 312 of file cub_file_test.cpp.
References input_file_1, MBQUAD, and test_element().
Referenced by main().
void test_side_sets | ( | ) |
Definition at line 647 of file cub_file_test.cpp.
References NEUMANN_SET_TAG_NAME, and test_bc_sets().
Referenced by main().
void test_tet10 | ( | ) |
Definition at line 146 of file cub_file_test.cpp.
References MBTET, and test_ho_elements().
Referenced by main().
void test_tet14 | ( | ) |
Definition at line 150 of file cub_file_test.cpp.
References MBTET, and test_ho_elements().
Referenced by main().
void test_tet8 | ( | ) |
Definition at line 142 of file cub_file_test.cpp.
References MBTET, and test_ho_elements().
Referenced by main().
void test_tri6 | ( | ) |
Definition at line 120 of file cub_file_test.cpp.
References MBTRI, and test_ho_elements().
Referenced by main().
void test_tri7 | ( | ) |
Definition at line 124 of file cub_file_test.cpp.
References MBTRI, and test_ho_elements().
Referenced by main().
void test_vertices | ( | ) |
Definition at line 208 of file cub_file_test.cpp.
References CHECK_EQUAL, CHECK_ERR, CHECK_REAL_EQUAL, ErrorCode, moab::Core::get_coords(), moab::Core::get_entities_by_type(), input_file_1, mb, MB_TYPE_INTEGER, MBVERTEX, read_file(), moab::Range::size(), moab::Core::tag_get_data(), and moab::Core::tag_get_handle().
Referenced by main().
|
static |
Definition at line 82 of file cub_file_test.cpp.
Referenced by test_cubit12().
|
static |
Definition at line 83 of file cub_file_test.cpp.
Referenced by test_cubit14().
|
static |
Definition at line 81 of file cub_file_test.cpp.
Referenced by test_ho_elements().
|
static |
Input test file: test.cub Cubit 10.2 file. File contains: Two merged 10x10x10 bricks sharing a single surface (surface 6).
Surfaces: 2 8 / / o-------—o-------—o /. / /. / /| / . (5)/ / . (11)/ / | / . L / . L / | o-------—o-------—o | | . | . |(12) 4–|-> o . . .|. .o. . . | . o | . (1) | . (9) | / | . ^ | . ^ | / |. | |. | |/ o-------—o-------—o | | 3 9
Curves:
o----8-----o----20----o
/. /. /| 12 . 11 . 24 | / 7 / 5 / 17 o-—2--—o-—14-—o | | . | . | | | o . .6.|. .o. . 18| . o 3 . 1 . 13 / | 9 | 10 | 22 |. |. |/ o-—4--—o-—16-—o
Vertices:
8----------5----------13
/. /. /| / . / . / | / . / . / | 3-------—2-------—10 | | . | . | | | 7 . . .|. .6. . . | . 14 | . | . | / | . | . | / |. |. |/ 4-------—1-------—9
Definition at line 80 of file cub_file_test.cpp.
Referenced by test_bc_sets(), test_blocks(), test_edges(), test_geometric_sets(), test_geometric_topology(), test_hexes(), test_multiple_files(), test_quads(), and test_vertices().