MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <iostream>
#include "moab/Interface.hpp"
#include "TestUtil.hpp"
#include "Internals.hpp"
#include "moab/Core.hpp"
#include "DagMC.hpp"
Go to the source code of this file.
Defines | |
#define | IS_BUILDING_MB |
#define | CHKERR(A) |
Functions | |
void | dagmc_setup_test () |
void | dagmc_point_in () |
int | dagmc_point_in_vol_dir (double origin[3], double dir[3], int vol_idx) |
void | dagmc_point_in_vol_1 () |
void | dagmc_point_in_vol_2 () |
void | dagmc_point_in_vol_3 () |
void | dagmc_point_in_vol_4 () |
void | dagmc_point_in_vol_5 () |
void | dagmc_point_in_vol_6 () |
void | dagmc_point_on_corner_1 () |
void | dagmc_point_on_corner_2 () |
void | dagmc_point_on_corner_3 () |
void | dagmc_point_on_corner_4 () |
void | dagmc_point_on_corner_5 () |
void | dagmc_point_on_corner_6 () |
void | dagmc_point_on_corner_7 () |
void | dagmc_point_on_corner_8 () |
int | main (int, char **) |
Variables | |
DagMC * | DAG |
std::string | input_file = "unittest/test_geom.h5m" |
#define CHKERR | ( | A | ) |
do \ { \ if( MB_SUCCESS != ( A ) ) \ { \ std::cerr << "Failure (error code " << ( A ) << ") at " __FILE__ ":" << __LINE__ << std::endl; \ return A; \ } \ } while( false )
Definition at line 18 of file dagmc_pointinvol_test.cpp.
#define IS_BUILDING_MB |
Definition at line 4 of file dagmc_pointinvol_test.cpp.
void dagmc_point_in | ( | ) |
Definition at line 46 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, CHECK_ERR, DAG, and ErrorCode.
Referenced by main().
{ int result = 0; int expected_result = 1; double xyz[3] = { 0.0, 0.0, 0.0 }; int vol_idx = 1; EntityHandle vol_h = DAG->entity_by_index( 3, vol_idx ); ErrorCode rval = DAG->point_in_volume( vol_h, xyz, result );CHECK_ERR( rval ); CHECK_EQUAL( expected_result, result ); }
void dagmc_point_in_vol_1 | ( | ) |
Definition at line 84 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, dagmc_point_in_vol_dir(), and origin.
Referenced by main().
{ double dir[3] = { -1.0, 0.0, 0.0 }; double origin[3] = { 0.0, 0.0, 0.0 }; int vol_idx = 1; int expected_result = 1; int result = dagmc_point_in_vol_dir( origin, dir, vol_idx ); CHECK_EQUAL( expected_result, result ); }
void dagmc_point_in_vol_2 | ( | ) |
Definition at line 95 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, dagmc_point_in_vol_dir(), and origin.
Referenced by main().
{ int expected_result = 1; int vol_idx = 1; double dir[3] = { 1.0, 0.0, 0.0 }; double origin[3] = { 0.0, 0.0, 0.0 }; int result = dagmc_point_in_vol_dir( origin, dir, vol_idx ); CHECK_EQUAL( expected_result, result ); }
void dagmc_point_in_vol_3 | ( | ) |
Definition at line 107 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, dagmc_point_in_vol_dir(), and origin.
Referenced by main().
{ int expected_result = 1; int vol_idx = 1; double dir[3] = { 0.0, -1.0, 0.0 }; double origin[3] = { 0.0, 0.0, 0.0 }; int result = dagmc_point_in_vol_dir( origin, dir, vol_idx ); CHECK_EQUAL( expected_result, result ); }
void dagmc_point_in_vol_4 | ( | ) |
Definition at line 119 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, dagmc_point_in_vol_dir(), and origin.
Referenced by main().
{ int expected_result = 1; int vol_idx = 1; double dir[3] = { 0.0, 1.0, 0.0 }; double origin[3] = { 0.0, 0.0, 0.0 }; int result = dagmc_point_in_vol_dir( origin, dir, vol_idx ); CHECK_EQUAL( expected_result, result ); }
void dagmc_point_in_vol_5 | ( | ) |
Definition at line 131 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, dagmc_point_in_vol_dir(), and origin.
Referenced by main().
{ int expected_result = 1; int vol_idx = 1; double dir[3] = { 0.0, 0.0, -1.0 }; double origin[3] = { 0.0, 0.0, 0.0 }; int result = dagmc_point_in_vol_dir( origin, dir, vol_idx ); CHECK_EQUAL( expected_result, result ); }
void dagmc_point_in_vol_6 | ( | ) |
Definition at line 143 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, dagmc_point_in_vol_dir(), and origin.
Referenced by main().
{ int expected_result = 1; int vol_idx = 1; double dir[3] = { 0.0, 0.0, 1.0 }; double origin[3] = { 0.0, 0.0, 0.0 }; int result = dagmc_point_in_vol_dir( origin, dir, vol_idx ); CHECK_EQUAL( expected_result, result ); }
int dagmc_point_in_vol_dir | ( | double | origin[3], |
double | dir[3], | ||
int | vol_idx | ||
) |
Definition at line 57 of file dagmc_pointinvol_test.cpp.
References CHECK_ERR, DAG, and ErrorCode.
Referenced by dagmc_point_in_vol_1(), dagmc_point_in_vol_2(), dagmc_point_in_vol_3(), dagmc_point_in_vol_4(), dagmc_point_in_vol_5(), dagmc_point_in_vol_6(), dagmc_point_on_corner_1(), dagmc_point_on_corner_2(), dagmc_point_on_corner_3(), dagmc_point_on_corner_4(), dagmc_point_on_corner_5(), dagmc_point_on_corner_6(), dagmc_point_on_corner_7(), and dagmc_point_on_corner_8().
{ int result = 0; EntityHandle vol_h = DAG->entity_by_index( 3, vol_idx ); double xyz[3]; double next_surf_dist; EntityHandle next_surf; // normalise the vector double dir_norm = ( dir[0] * dir[0] ) + ( dir[1] * dir[1] ) + ( dir[2] * dir[2] ); dir[0] = dir[0] / sqrt( dir_norm ); dir[1] = dir[1] / sqrt( dir_norm ); dir[2] = dir[2] / sqrt( dir_norm ); ErrorCode rval = DAG->ray_fire( vol_h, origin, dir, next_surf, next_surf_dist );CHECK_ERR( rval ); xyz[0] = origin[0] + ( next_surf_dist * dir[0] ); xyz[1] = origin[1] + ( next_surf_dist * dir[1] ); xyz[2] = origin[2] + ( next_surf_dist * dir[2] ); std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << std::endl; rval = DAG->point_in_volume( vol_h, xyz, result, dir );CHECK_ERR( rval ); return result; }
void dagmc_point_on_corner_1 | ( | ) |
Definition at line 155 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, dagmc_point_in_vol_dir(), and origin.
Referenced by main().
{ int expected_result = 1; int vol_idx = 1; double dir[3] = { 1.0, 1.0, 1.0 }; double origin[3] = { 0.0, 0.0, 0.0 }; int result = dagmc_point_in_vol_dir( origin, dir, vol_idx ); CHECK_EQUAL( expected_result, result ); }
void dagmc_point_on_corner_2 | ( | ) |
Definition at line 167 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, dagmc_point_in_vol_dir(), and origin.
Referenced by main().
{ int expected_result = 1; int vol_idx = 1; double dir[3] = { -1.0, 1.0, 1.0 }; double origin[3] = { 0.0, 0.0, 0.0 }; int result = dagmc_point_in_vol_dir( origin, dir, vol_idx ); CHECK_EQUAL( expected_result, result ); }
void dagmc_point_on_corner_3 | ( | ) |
Definition at line 179 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, dagmc_point_in_vol_dir(), and origin.
Referenced by main().
{ int expected_result = 1; int vol_idx = 1; double dir[3] = { 1.0, 1.0, -1.0 }; double origin[3] = { 0.0, 0.0, 0.0 }; int result = dagmc_point_in_vol_dir( origin, dir, vol_idx ); CHECK_EQUAL( expected_result, result ); }
void dagmc_point_on_corner_4 | ( | ) |
Definition at line 191 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, dagmc_point_in_vol_dir(), and origin.
Referenced by main().
{ int expected_result = 1; int vol_idx = 1; double dir[3] = { -1.0, 1.0, -1.0 }; double origin[3] = { 0.0, 0.0, 0.0 }; int result = dagmc_point_in_vol_dir( origin, dir, vol_idx ); CHECK_EQUAL( expected_result, result ); }
void dagmc_point_on_corner_5 | ( | ) |
Definition at line 203 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, dagmc_point_in_vol_dir(), and origin.
{ int expected_result = 1; int vol_idx = 1; double dir[3] = { 1.0, -1.0, 1.0 }; double origin[3] = { 0.0, 0.0, 0.0 }; int result = dagmc_point_in_vol_dir( origin, dir, vol_idx ); CHECK_EQUAL( expected_result, result ); }
void dagmc_point_on_corner_6 | ( | ) |
Definition at line 215 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, dagmc_point_in_vol_dir(), and origin.
{ int expected_result = 1; int vol_idx = 1; double dir[3] = { -1.0, -1.0, 1.0 }; double origin[3] = { 0.0, 0.0, 0.0 }; int result = dagmc_point_in_vol_dir( origin, dir, vol_idx ); CHECK_EQUAL( expected_result, result ); }
void dagmc_point_on_corner_7 | ( | ) |
Definition at line 227 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, dagmc_point_in_vol_dir(), and origin.
{ int expected_result = 1; int vol_idx = 1; double dir[3] = { 1.0, -1.0, -1.0 }; double origin[3] = { 0.0, 0.0, 0.0 }; int result = dagmc_point_in_vol_dir( origin, dir, vol_idx ); CHECK_EQUAL( expected_result, result ); }
void dagmc_point_on_corner_8 | ( | ) |
Definition at line 239 of file dagmc_pointinvol_test.cpp.
References CHECK_EQUAL, dagmc_point_in_vol_dir(), and origin.
{ int expected_result = 1; int vol_idx = 1; double dir[3] = { -1.0, -1.0, -1.0 }; double origin[3] = { 0.0, 0.0, 0.0 }; int result = dagmc_point_in_vol_dir( origin, dir, vol_idx ); CHECK_EQUAL( expected_result, result ); }
void dagmc_setup_test | ( | ) |
Definition at line 30 of file dagmc_pointinvol_test.cpp.
References CHECK_ERR, DAG, ErrorCode, and input_file.
Referenced by main().
{ ErrorCode rval = DAG->load_file( input_file.c_str() ); // open the Dag file CHECK_ERR( rval ); rval = DAG->init_OBBTree();CHECK_ERR( rval ); /* int num_vols = DAG->num_entities(3); EntityHandle vol; for (int i = 0; i < num_vols; i++) vol = DAG->entity_by_index(3, i); */ // EntityHandle volume = 12682136550675316765; // CHECK_EQUAL(volume, vol); }
int main | ( | int | , |
char ** | |||
) |
Definition at line 251 of file dagmc_pointinvol_test.cpp.
References DAG, dagmc_point_in(), dagmc_point_in_vol_1(), dagmc_point_in_vol_2(), dagmc_point_in_vol_3(), dagmc_point_in_vol_4(), dagmc_point_in_vol_5(), dagmc_point_in_vol_6(), dagmc_point_on_corner_1(), dagmc_point_on_corner_2(), dagmc_point_on_corner_3(), dagmc_point_on_corner_4(), dagmc_setup_test(), and RUN_TEST.
{ int result = 0; DAG = new DagMC(); result += RUN_TEST( dagmc_setup_test ); // setup problem result += RUN_TEST( dagmc_point_in ); // point in centre // rays fired along cardinal directions result += RUN_TEST( dagmc_point_in_vol_1 ); // point in centre result += RUN_TEST( dagmc_point_in_vol_2 ); // point in centre result += RUN_TEST( dagmc_point_in_vol_3 ); // point in centre result += RUN_TEST( dagmc_point_in_vol_4 ); // point in centre result += RUN_TEST( dagmc_point_in_vol_5 ); // point in centre result += RUN_TEST( dagmc_point_in_vol_6 ); // point in centre // rays fired at nodes result += RUN_TEST( dagmc_point_on_corner_1 ); result += RUN_TEST( dagmc_point_on_corner_2 ); result += RUN_TEST( dagmc_point_on_corner_3 ); result += RUN_TEST( dagmc_point_on_corner_4 ); // result += RUN_TEST(dagmc_point_in({0.0, 0.0, 5.0}); // point in centre // result += RUN_TEST(dagmc_point_in({0.0, 0.0, -5.0}); // point in centre // result += RUN_TEST(dagmc_point_in({0.0, 5.0, 0.0}); // point in centre // result += RUN_TEST(dagmc_point_in({0.0, -5.0, 0.0}); // point in centre // result += RUN_TEST(dagmc_point_in({5.0, 0.0, 0.0}); // point in centre // result += RUN_TEST(dagmc_point_in({-5.0, 0.0, 0.0}); // point in centre delete DAG; return result; }
DagMC* DAG |
Definition at line 16 of file dagmc_pointinvol_test.cpp.
Referenced by dagmc_build_obb(), dagmc_closest_to(), dagmc_load_file(), dagmc_num_vols(), dagmc_origin_face_rayfire(), dagmc_outside_face_rayfire(), dagmc_outside_face_rayfire_history(), dagmc_outside_face_rayfire_history_fail(), dagmc_outside_face_rayfire_orient_entrance(), dagmc_outside_face_rayfire_orient_exit(), dagmc_point_in(), dagmc_point_in_vol_dir(), dagmc_rayfire(), dagmc_setup_test(), dagmc_test_boundary(), dagmc_test_obb_retreval_rayfire(), and main().
std::string input_file = "unittest/test_geom.h5m" |
Definition at line 28 of file dagmc_pointinvol_test.cpp.
Referenced by dagmc_load_file(), dagmc_load_file_dagmc(), dagmc_load_file_dagmc_build_obb(), dagmc_load_file_dagmc_internal(), dagmc_load_file_dagmc_internal_build_obb(), dagmc_load_file_dagmc_via_moab(), dagmc_load_file_dagmc_via_moab_build_obb(), dagmc_setup_test(), dagmc_test_obb_retreval(), dagmc_test_obb_retreval_rayfire(), gqt_load_file(), gqt_load_file_dagmc_build_obb(), gqt_load_file_dagmc_internal_build_obb(), gqt_load_file_dagmc_via_moab_build_obb(), gqt_point_in(), gqt_rayfire(), gqt_setup_test(), gqt_test_obb_retreval(), gqt_test_obb_retreval_rayfire(), moab::ReadOBJ::load_file(), main(), moab::ReadRTT::read_cells(), moab::ReadRTT::read_facets(), moab::ReadRTT::read_header(), read_multiple_test(), moab::ReadRTT::read_nodes(), moab::ReadRTT::read_sides(), and moab::ReadRTT::read_tets().