MOAB: Mesh Oriented datABase
(version 5.5.0)
|
#include "iMeshP.h"
#include "moab_mpi.h"
#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <cassert>
#include <cmath>
#include <map>
#include <cstring>
#include <cstdio>
#include <unistd.h>
Go to the source code of this file.
Classes | |
class | PartMap |
struct | EHARR< size > |
struct | VtxCopyData |
Macros | |
#define | STRINGIFY_(X) #X |
#define | STRINGIFY(X) STRINGIFY_( X ) |
#define | CHKERR |
#define | PCHECK |
#define | ASSERT(A) |
#define | RUN_TEST(A) run_test( &( A ), #A ) |
Variables | |
const char *const | FILENAME = "iMeshP_test_file" |
#define ASSERT | ( | A | ) |
Definition at line 43 of file MOAB_iMeshP_unit_tests.cpp.
#define CHKERR |
Definition at line 25 of file MOAB_iMeshP_unit_tests.cpp.
#define PCHECK |
Definition at line 35 of file MOAB_iMeshP_unit_tests.cpp.
#define RUN_TEST | ( | A | ) | run_test( &( A ), #A ) |
Definition at line 390 of file MOAB_iMeshP_unit_tests.cpp.
#define STRINGIFY | ( | X | ) | STRINGIFY_( X ) |
Definition at line 18 of file MOAB_iMeshP_unit_tests.cpp.
#define STRINGIFY_ | ( | X | ) | #X |
Definition at line 17 of file MOAB_iMeshP_unit_tests.cpp.
int check_one_layer | ( | iMesh_Instance | imesh, |
iBase_EntityHandle | vtx, | ||
const std::vector< iBase_EntityHandle > & | sorted_vertices | ||
) |
Definition at line 2537 of file MOAB_iMeshP_unit_tests.cpp.
References CHKERR, get_adj(), iBase_FACE, iBase_FAILURE, iBase_SUCCESS, iBase_VERTEX, ierr, and vtx().
Referenced by test_create_ghost_ents().
int create_mesh | ( | const char * | filename, |
int | num_parts | ||
) |
Create mesh for use in parallel tests.
Definition at line 576 of file MOAB_iMeshP_unit_tests.cpp.
References CHKERR, filename, iBase_INTEGER, iBase_INTERLEAVED, iBase_SUCCESS, iBase_TAG_ALREADY_EXISTS, id_tag, ierr, iMesh_addEntArrToSet, iMesh_createEntArr, iMesh_createTag, iMesh_createVtxArr, iMesh_dtor, iMesh_getRootSet, iMesh_getTagHandle, iMesh_getTagSizeValues, iMesh_getTagType, iMesh_newMesh, iMesh_QUADRILATERAL, iMesh_setIntArrData, iMeshP_createPart, iMeshP_createPartitionAll, iMeshP_saveAll, root_set, and tagname.
Referenced by run_test().
int create_mesh_in_memory | ( | int | rank, |
int | size, | ||
iMesh_Instance | imesh, | ||
iMeshP_PartitionHandle & | prtn, | ||
PartMap & | map | ||
) |
Definition at line 679 of file MOAB_iMeshP_unit_tests.cpp.
References PartMap::build_map(), CHKERR, iBase_INTEGER, iBase_INTERLEAVED, iBase_SUCCESS, iBase_TAG_ALREADY_EXISTS, id_tag, ierr, iMesh_addEntArrToSet, iMesh_createEntArr, iMesh_createTag, iMesh_createVtxArr, iMesh_getTagHandle, iMesh_getTagSizeValues, iMesh_getTagType, iMesh_QUADRILATERAL, iMesh_setIntArrData, iMeshP_createPart, iMeshP_createPartitionAll, iMeshP_syncMeshAll, iMeshP_syncPartitionAll, MPI_COMM_WORLD, rank, and tagname.
Referenced by run_test().
int get_adj | ( | iMesh_Instance | imesh, |
iBase_EntityHandle | ent, | ||
int | type, | ||
std::vector< iBase_EntityHandle > & | adj | ||
) |
Definition at line 2507 of file MOAB_iMeshP_unit_tests.cpp.
References iBase_SUCCESS, ierr, and iMesh_getEntAdj.
Referenced by check_one_layer().
int get_boundary_vertices | ( | iMesh_Instance | imesh, |
std::vector< iBase_EntityHandle > & | bdry | ||
) |
Definition at line 2521 of file MOAB_iMeshP_unit_tests.cpp.
References CHKERR, get_entities(), get_num_adj_quads(), iBase_SUCCESS, iBase_VERTEX, ierr, iMesh_getRootSet, and iMesh_POINT.
Referenced by test_create_ghost_ents().
|
static |
Definition at line 372 of file MOAB_iMeshP_unit_tests.cpp.
References iBase_INTERLEAVED, iBase_SUCCESS, ierr, and iMesh_getVtxArrCoords.
Referenced by moab::Core::get_coords(), moab::Core::get_vertex_coordinates(), interface_verts(), moab::Core::list_entity(), and test_entity_owner().
|
static |
Definition at line 329 of file MOAB_iMeshP_unit_tests.cpp.
References entities, iMesh_getEntities, and size.
Referenced by get_boundary_vertices(), get_part_quads_and_verts(), test_entity_owner(), test_exchange_ents(), test_get_by_type_topo_all(), test_get_by_type_topo_local(), and test_push_tag_data_common().
int get_local_parts | ( | iMesh_Instance | instance, |
iMeshP_PartitionHandle | prtn, | ||
std::vector< iMeshP_PartHandle > & | handles, | ||
std::vector< iMeshP_Part > * | ids = 0 |
||
) |
Definition at line 307 of file MOAB_iMeshP_unit_tests.cpp.
References CHKERR, iBase_SUCCESS, ierr, iMeshP_getLocalParts, iMeshP_getPartIdsFromPartHandlesArr, and size.
Referenced by PartMap::build_map(), test_entity_copies(), test_entity_copy_parts(), test_entity_owner(), test_entity_status(), test_exchange_ents(), test_get_by_type_topo_local(), test_get_part_boundary(), and test_part_boundary_iter().
int get_num_adj_all | ( | iMesh_Instance | imesh, |
const std::vector< iBase_EntityHandle > & | verts, | ||
std::vector< int > & | num_local_adj, | ||
std::vector< int > & | num_all_adj | ||
) |
Definition at line 2560 of file MOAB_iMeshP_unit_tests.cpp.
References CHKERR, get_num_adj_quads(), iBase_SUCCESS, ierr, MPI_COMM_WORLD, size, and vertex_tag().
Referenced by test_create_ghost_ents().
int get_num_adj_quads | ( | iMesh_Instance | imesh, |
iBase_EntityHandle | vtx, | ||
int & | num | ||
) |
Definition at line 2498 of file MOAB_iMeshP_unit_tests.cpp.
References iBase_FACE, iBase_SUCCESS, ierr, iMesh_getEntAdj, and vtx().
Referenced by get_boundary_vertices(), get_num_adj_all(), and test_create_ghost_ents().
|
static |
Definition at line 2072 of file MOAB_iMeshP_unit_tests.cpp.
References CHKERR, get_part_neighbors(), PartMap::get_parts(), iBase_SUCCESS, ierr, iface, interface_verts(), neighbors(), and PartMap::part_from_coords().
Referenced by test_entity_status().
|
static |
Definition at line 1190 of file MOAB_iMeshP_unit_tests.cpp.
References neighbors().
Referenced by get_part_boundary_verts(), test_entity_copy_parts(), and test_get_neighbors().
|
static |
Definition at line 348 of file MOAB_iMeshP_unit_tests.cpp.
References CHKERR, get_entities(), iBase_FACE, iBase_SUCCESS, iBase_VERTEX, ierr, iMesh_getEntArrAdj, and iMesh_QUADRILATERAL.
Referenced by test_entity_copies(), test_entity_copy_parts(), and test_entity_status().
|
static |
Definition at line 1388 of file MOAB_iMeshP_unit_tests.cpp.
References CHKERR, get_coords(), iBase_FACE, iBase_FAILURE, iBase_SUCCESS, iBase_VERTEX, ierr, iMesh_getEntArrAdj, iMesh_getEntities, iMesh_QUADRILATERAL, iMeshP_getPartIdFromPartHandle, PartMap::local_id_from_part_id(), MPI_COMM_WORLD, and rank.
Referenced by get_part_boundary_verts(), test_entity_copy_parts(), test_get_part_boundary(), and test_part_boundary_iter().
int is_any_proc_error | ( | int | is_my_error | ) |
Definition at line 57 of file MOAB_iMeshP_unit_tests.cpp.
References MPI_COMM_WORLD.
Referenced by run_test().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 462 of file MOAB_iMeshP_unit_tests.cpp.
References FILENAME, MPI_COMM_WORLD, rank, RUN_TEST, size, test_create_ghost_ents(), test_entity_copies(), test_entity_copy_parts(), test_entity_iterator(), test_entity_owner(), test_entity_status(), test_exchange_ents(), test_get_adjacencies(), test_get_by_topo(), test_get_by_type(), test_get_neighbors(), test_get_part_boundary(), test_get_partitions(), test_get_parts(), test_part_boundary_iter(), test_part_id_handle(), test_part_rank(), test_push_tag_data_ghost(), and test_push_tag_data_iface().
int run_test | ( | int(*)(iMesh_Instance, iMeshP_PartitionHandle, const PartMap &) | func, |
const char * | func_name | ||
) |
Definition at line 392 of file MOAB_iMeshP_unit_tests.cpp.
References CHKERR, create_mesh(), create_mesh_in_memory(), FILENAME, ierr, iMesh_dtor, iMesh_newMesh, iMeshP_createPartitionAll, is_any_proc_error(), MPI_COMM_WORLD, PCHECK, rank, size, and test_load().
Referenced by _run_test(), and runner_run_tests().
int test_create_ghost_ents | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | |||
) |
Test creation of ghost entities.
Test:
Definition at line 2607 of file MOAB_iMeshP_unit_tests.cpp.
References ASSERT, check_one_layer(), get_boundary_vertices(), get_num_adj_all(), get_num_adj_quads(), iBase_FACE, iBase_SUCCESS, iBase_VERTEX, ierr, iMeshP_createGhostEntsAll, and PCHECK.
Referenced by main().
int test_entity_copies | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | |||
) |
Test information about entity copies for interface entities.
Test:
Definition at line 2320 of file MOAB_iMeshP_unit_tests.cpp.
References ASSERT, CHKERR, get_local_parts(), get_part_quads_and_verts(), VtxCopyData::handles, iBase_FAILURE, iBase_SUCCESS, ierr, iMeshP_getCopies, iMeshP_getCopyOnPart, iMeshP_getEntOwnerPart, iMeshP_getOwnerCopy, iMeshP_getPartIdsFromPartHandlesArr, MPI_COMM_WORLD, VtxCopyData::parts, PCHECK, rank, size, and vertex_tag().
Referenced by main().
int test_entity_copy_parts | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | map | ||
) |
Test information about entity copies for interface entities.
Test:
Definition at line 2220 of file MOAB_iMeshP_unit_tests.cpp.
References ASSERT, CHKERR, get_local_parts(), get_part_neighbors(), get_part_quads_and_verts(), PartMap::get_parts(), iBase_SUCCESS, ierr, iface, iMeshP_getCopyParts, iMeshP_getNumCopies, interface_verts(), MPI_COMM_WORLD, neighbors(), PartMap::part_from_coords(), PartMap::part_id_from_local_id(), PCHECK, rank, size, and vtx().
Referenced by main().
int test_entity_iterator | ( | iMesh_Instance | , |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | |||
) |
Test entity iterators.
Test:
Definition at line 1852 of file MOAB_iMeshP_unit_tests.cpp.
References iBase_SUCCESS.
Referenced by main().
int test_entity_owner | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | |||
) |
Test entity owner queries.
Test:
Definition at line 1865 of file MOAB_iMeshP_unit_tests.cpp.
References ASSERT, CHKERR, get_coords(), get_entities(), get_local_parts(), iBase_FACE, iBase_FAILURE, iBase_SUCCESS, iBase_VERTEX, ierr, iMesh_getEntArrAdj, iMesh_QUADRILATERAL, iMeshP_getEntOwnerPart, iMeshP_getEntOwnerPartArr, iMeshP_isEntOwner, iMeshP_isEntOwnerArr, MPI_COMM_WORLD, PCHECK, rank, and size.
Referenced by main().
int test_entity_status | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | map | ||
) |
Test entity status.
Test:
Definition at line 2102 of file MOAB_iMeshP_unit_tests.cpp.
References ASSERT, get_local_parts(), get_part_boundary_verts(), get_part_quads_and_verts(), iBase_SUCCESS, ierr, iMeshP_BOUNDARY, iMeshP_getEntStatus, iMeshP_getEntStatusArr, iMeshP_INTERNAL, MPI_COMM_WORLD, PCHECK, rank, and size.
Referenced by main().
int test_exchange_ents | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | map | ||
) |
Test exchange entities.
Test:
Definition at line 2679 of file MOAB_iMeshP_unit_tests.cpp.
References ASSERT, CHKERR, get_entities(), get_local_parts(), PartMap::get_parts(), iBase_FACE, iBase_SUCCESS, ierr, iMesh_QUADRILATERAL, iMeshP_exchEntArrToPartsAll, MPI_COMM_WORLD, PCHECK, rank, and size.
Referenced by main().
int test_get_adjacencies | ( | iMesh_Instance | , |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | |||
) |
Test adjacent entity query.
Test:
Definition at line 1841 of file MOAB_iMeshP_unit_tests.cpp.
References iBase_SUCCESS.
Referenced by main().
int test_get_by_topo | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | map | ||
) |
Test query by entity topology.
Test:
Definition at line 1068 of file MOAB_iMeshP_unit_tests.cpp.
References ierr, PartMap::num_parts(), PCHECK, test_get_by_type_topo_all(), and test_get_by_type_topo_local().
Referenced by main().
int test_get_by_type | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | map | ||
) |
Test query by entity type.
Test:
Definition at line 1050 of file MOAB_iMeshP_unit_tests.cpp.
References ierr, PartMap::num_parts(), PCHECK, test_get_by_type_topo_all(), and test_get_by_type_topo_local().
Referenced by main().
|
static |
Definition at line 889 of file MOAB_iMeshP_unit_tests.cpp.
References ASSERT, CHKERR, get_entities(), iBase_FACE, iBase_VERTEX, ierr, iMesh_addEntArrToSet, iMesh_createEntSet, iMesh_getRootSet, iMesh_POINT, iMesh_QUADRILATERAL, iMeshP_getNumOfTopoAll, iMeshP_getNumOfTypeAll, and PCHECK.
Referenced by test_get_by_topo(), and test_get_by_type().
|
static |
Definition at line 942 of file MOAB_iMeshP_unit_tests.cpp.
References ASSERT, CHKERR, get_entities(), get_local_parts(), iBase_ALL_TYPES, iBase_FACE, iBase_SUCCESS, iBase_VERTEX, ierr, iMesh_addEntArrToSet, iMesh_ALL_TOPOLOGIES, iMesh_createEntSet, iMesh_getRootSet, iMesh_POINT, iMesh_QUADRILATERAL, iMeshP_getEntities, iMeshP_getNumOfTopo, and iMeshP_getNumOfType.
Referenced by test_get_by_topo(), and test_get_by_type().
int test_get_neighbors | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | map | ||
) |
Test querying of part neighbors.
Test:
Definition at line 1223 of file MOAB_iMeshP_unit_tests.cpp.
References get_part_neighbors(), iBase_FAILURE, iBase_VERTEX, ierr, iMeshP_getNumPartNbors, iMeshP_getNumPartNborsArr, iMeshP_getPartHandlesFromPartsIdsArr, iMeshP_getPartNbors, iMeshP_getPartNborsArr, PartMap::local_id_from_rank(), MPI_COMM_WORLD, neighbors(), PartMap::num_parts(), PartMap::part_id_from_local_id(), PartMap::part_id_from_rank(), PCHECK, rank, and size.
Referenced by main().
int test_get_part_boundary | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | map | ||
) |
Test querying of part boundary entities.
Test:
Definition at line 1532 of file MOAB_iMeshP_unit_tests.cpp.
References CHKERR, moab::error(), get_local_parts(), PartMap::get_parts(), iBase_FAILURE, iBase_SUCCESS, iBase_VERTEX, ierr, iMesh_POINT, iMeshP_ALL_PARTS, iMeshP_getNumPartBdryEnts, iMeshP_getPartBdryEnts, interface_verts(), MPI_COMM_WORLD, and rank.
Referenced by main().
int test_get_partitions | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | |||
) |
Test partition query methods.
Test:
Definition at line 824 of file MOAB_iMeshP_unit_tests.cpp.
References ASSERT, ierr, iMeshP_getNumPartitions, iMeshP_getPartitionComm, iMeshP_getPartitions, MPI_COMM_WORLD, PCHECK, and size.
Referenced by main().
int test_get_parts | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | map | ||
) |
Test part quyery methods.
Test:
Definition at line 861 of file MOAB_iMeshP_unit_tests.cpp.
References ASSERT, PartMap::count_from_rank(), iBase_SUCCESS, ierr, iMeshP_getLocalParts, iMeshP_getNumGlobalParts, iMeshP_getNumLocalParts, MPI_COMM_WORLD, PartMap::num_parts(), PCHECK, rank, and size.
Referenced by main().
int test_load | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
PartMap & | map, | ||
int | comm_size | ||
) |
Consistency check for parallel load.
All other tests depend on this one.
Definition at line 803 of file MOAB_iMeshP_unit_tests.cpp.
References PartMap::build_map(), CHKERR, FILENAME, iBase_SUCCESS, ierr, iMesh_getRootSet, iMeshP_loadAll, PCHECK, and root_set.
Referenced by run_test().
int test_part_boundary_iter | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | map | ||
) |
Test querying of part boundary entities.
Test:
Definition at line 1699 of file MOAB_iMeshP_unit_tests.cpp.
References CHKERR, get_local_parts(), PartMap::get_parts(), iBase_FAILURE, iBase_SUCCESS, iBase_VERTEX, ierr, iMesh_endEntArrIter, iMesh_endEntIter, iMesh_getNextEntArrIter, iMesh_getNextEntIter, iMesh_POINT, iMeshP_initPartBdryEntArrIter, iMeshP_initPartBdryEntIter, interface_verts(), MPI_COMM_WORLD, and rank.
Referenced by main().
int test_part_id_handle | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | map | ||
) |
Test mapping from part id to part handle.
Test:
Test:
Definition at line 1086 of file MOAB_iMeshP_unit_tests.cpp.
References ASSERT, CHKERR, ierr, iMeshP_getPartHandleFromPartId, iMeshP_getPartHandlesFromPartsIdsArr, iMeshP_getPartIdFromPartHandle, iMeshP_getPartIdsFromPartHandlesArr, MPI_COMM_WORLD, PartMap::part_id_from_rank(), PCHECK, and rank.
Referenced by main().
int test_part_rank | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | map | ||
) |
Test get part rank.
Tests:
Definition at line 1136 of file MOAB_iMeshP_unit_tests.cpp.
References ASSERT, PartMap::get_parts(), PartMap::get_ranks(), iBase_FAILURE, iBase_SUCCESS, ierr, iMeshP_getRankOfPart, iMeshP_getRankOfPartArr, MPI_COMM_WORLD, PCHECK, rank, and size.
Referenced by main().
int test_push_tag_data_common | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
int | num_ghost_layers | ||
) |
Test commuinication of tag data.
Test:
Definition at line 2736 of file MOAB_iMeshP_unit_tests.cpp.
References ASSERT, CHKERR, get_entities(), iBase_FACE, iBase_INTEGER, iBase_SUCCESS, iBase_VERTEX, id_tag, ierr, iMesh_createTag, iMesh_getIntArrData, iMesh_getIntData, iMesh_getRootSet, iMesh_getTagHandle, iMesh_POINT, iMesh_setIntArrData, iMeshP_createGhostEntsAll, iMeshP_getEntOwnerPartArr, iMeshP_getNumCopies, iMeshP_getRankOfPartArr, iMeshP_pushTags, iMeshP_pushTagsEnt, MPI_COMM_WORLD, PCHECK, and rank.
Referenced by test_push_tag_data_ghost(), and test_push_tag_data_iface().
int test_push_tag_data_ghost | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | |||
) |
Test commuinication of tag data.
Test:
Definition at line 2877 of file MOAB_iMeshP_unit_tests.cpp.
References test_push_tag_data_common().
Referenced by main().
int test_push_tag_data_iface | ( | iMesh_Instance | imesh, |
iMeshP_PartitionHandle | prtn, | ||
const PartMap & | |||
) |
Test commuinication of tag data.
Test:
Definition at line 2866 of file MOAB_iMeshP_unit_tests.cpp.
References test_push_tag_data_common().
Referenced by main().
int vertex_tag | ( | iMesh_Instance | imesh, |
iBase_EntityHandle | vertex, | ||
int & | tag | ||
) |
get unique identifier for each vertex
Definition at line 787 of file MOAB_iMeshP_unit_tests.cpp.
References CHKERR, ierr, and iMesh_getVtxCoord.
Referenced by get_num_adj_all(), and test_entity_copies().
const char* const FILENAME = "iMeshP_test_file" |
Definition at line 19 of file MOAB_iMeshP_unit_tests.cpp.
Referenced by main(), run_test(), and test_load().