MOAB: Mesh Oriented datABase  (version 5.1.1)
test_both.cpp File Reference
#include "iGeom.h"
#include "iMesh.h"
#include "iRel.h"
#include "TestUtil.hpp"
#include <cstdlib>
+ Include dependency graph for test_both.cpp:

Go to the source code of this file.

Functions

void test_both ()
void test_change_to_both ()
void test_change_to_set ()
int main ()

Variables

iGeom_Instance geom
iMesh_Instance mesh
iRel_Instance rel
iBase_EntityHandle geom_ent
iBase_EntityHandle mesh_ents [4]
iBase_EntitySetHandle mesh_set

Function Documentation

int main ( )

Definition at line 96 of file test_both.cpp.

References geom, geom_ent, iBase_INTERLEAVED, iMesh_addEntArrToSet, iMesh_createEntSet, iMesh_createVtxArr, iMesh_dtor, iMesh_newMesh, iRel_create, iRel_destroy, mesh, mesh_ents, mesh_set, rel, RUN_TEST, test_both(), test_change_to_both(), and test_change_to_set().

{
  int err;
  int num_fail = 0;

  iGeom_newGeom(0, &geom, &err, 0);
  iMesh_newMesh(0, &mesh, &err, 0);
  iRel_create(0, &rel, &err, 0);

  iGeom_createBrick(geom, 2, 2, 2, &geom_ent, &err);

  double coords[] = {
    0, 0, 0,
    0, 1, 0,
    1, 1, 0,
    1, 0, 0,
  };

  iBase_EntityHandle *mesh_ents_ptr = mesh_ents;
  int mesh_ents_alloc = 4, mesh_ents_size;
  iMesh_createVtxArr(mesh, 4, iBase_INTERLEAVED, coords, 12,
                     &mesh_ents_ptr, &mesh_ents_alloc, &mesh_ents_size, &err);

  iMesh_createEntSet(mesh, false, &mesh_set, &err);
  iMesh_addEntArrToSet(mesh, mesh_ents, mesh_ents_size, mesh_set, &err);

  num_fail += RUN_TEST(test_both);
  num_fail += RUN_TEST(test_change_to_both);
  num_fail += RUN_TEST(test_change_to_set);

  iRel_destroy(rel, &err);
  iMesh_dtor(mesh, &err);
  iGeom_dtor(geom, &err);

  return num_fail;
}
void test_both ( )

Definition at line 18 of file test_both.cpp.

References CHECK_EQUAL, CHECK_ERR, geom, geom_ent, iRel_ACTIVE, iRel_BOTH, iRel_createPair, iRel_ENTITY, iRel_getEntArrEntArrRelation, iRel_IGEOM_IFACE, iRel_IMESH_IFACE, iRel_setEntSetRelation, mesh, mesh_ents, mesh_set, and rel.

Referenced by main().

{
  int err;
  iRel_PairHandle pair;

  iRel_createPair(rel, geom, iRel_ENTITY, iRel_IGEOM_IFACE, iRel_ACTIVE,
                       mesh, iRel_BOTH,   iRel_IMESH_IFACE, iRel_ACTIVE,
                  &pair, &err);
  CHECK_ERR(err);

  iRel_setEntSetRelation(rel, pair, geom_ent, mesh_set, &err);
  CHECK_ERR(err);

  iBase_EntityHandle *related_ents = NULL;
  int related_ents_alloc = 0, related_ents_size;
  iRel_getEntArrEntArrRelation(rel, pair, mesh_ents, 4, 1,
                               &related_ents, &related_ents_alloc,
                               &related_ents_size, &err);
  CHECK_ERR(err);

  for(int i = 0; i < related_ents_size; i++)
    CHECK_EQUAL(related_ents[i], geom_ent);

  free(related_ents);
}

Definition at line 44 of file test_both.cpp.

References CHECK_EQUAL, CHECK_ERR, geom, geom_ent, iRel_ACTIVE, iRel_BOTH, iRel_changePairType, iRel_createPair, iRel_ENTITY, iRel_getEntArrEntArrRelation, iRel_IGEOM_IFACE, iRel_IMESH_IFACE, iRel_SET, iRel_setEntSetRelation, mesh, mesh_ents, mesh_set, and rel.

Referenced by main().

{
  int err;
  iRel_PairHandle pair;

  iRel_createPair(rel, geom, iRel_ENTITY, iRel_IGEOM_IFACE, iRel_ACTIVE,
                       mesh, iRel_SET,    iRel_IMESH_IFACE, iRel_ACTIVE,
                  &pair, &err);
  CHECK_ERR(err);

  iRel_setEntSetRelation(rel, pair, geom_ent, mesh_set, &err);
  CHECK_ERR(err);

  iRel_changePairType(rel, pair, iRel_ENTITY, iRel_BOTH, &err);
  CHECK_ERR(err);

  iBase_EntityHandle *related_ents = NULL;
  int related_ents_alloc = 0, related_ents_size;
  iRel_getEntArrEntArrRelation(rel, pair, mesh_ents, 4, 1,
                               &related_ents, &related_ents_alloc,
                               &related_ents_size, &err);
  CHECK_ERR(err);

  for(int i = 0; i < related_ents_size; i++)
    CHECK_EQUAL(related_ents[i], geom_ent);

  free(related_ents);
}

Variable Documentation

Definition at line 11 of file test_both.cpp.

Referenced by HigherOrderTest::basic_hex_test(), HigherOrderTest::basic_quad_test(), HigherOrderTest::basic_tet_test(), HigherOrderTest::basic_tri_test(), build_tree(), VtkTest::check_field_attrib(), ExodusTest::check_mesh(), closedsurface_uref_hirec_convergence_study(), BCDTest::compare_bcd(), compute_normals(), ParShapeImprover::count_invalid_elements(), do_smoother(), FBiGeom_newGeomFromMesh(), findadjacency(), findconnect(), moab::RefinerTagManager::get_common_processes(), get_homogenious_example(), get_native_mesh(), get_part_example_quad(), get_part_example_tri(), get_root(), MBMesquite::ObjectiveFunctionTemplate::initialize_block_coordinate_descent(), MBMesquite::TerminationCriterion::initialize_queue(), MBMesquite::Instruction::initialize_vertex_byte(), ListSetsNTags(), moab::TempestRemapper::load_tempest_mesh_private(), MBMesquite::TargetWriter::loop_over_mesh(), MBMesquite::VertexMover::loop_over_mesh(), MBMesquite::MeshTransform::loop_over_mesh(), MBMesquite::SlaveBoundaryVertices::loop_over_mesh(), MBMesquite::TagVertexMesh::loop_over_mesh(), MBMesquite::QualityAssessor::loop_over_mesh_internal(), main(), run(), ParShapeImprover::run(), MBMesquite::InstructionQueue::run_common(), run_example(), run_global_smoother(), run_local_smoother(), run_local_smoother2(), run_quality_optimizer(), run_solution_mesh_optimizer(), run_test(), MBMesquite::PaverMinEdgeLengthWrapper::run_wrapper(), MBMesquite::SizeAdaptShapeWrapper::run_wrapper(), MBMesquite::ViscousCFDTetShapeWrapper::run_wrapper(), MBMesquite::ShapeImprover::run_wrapper(), MBMesquite::UntangleWrapper::run_wrapper(), ParShapeImprover::ParShapeImprovementWrapper::run_wrapper(), MBMesquite::DeformingDomainWrapper::run_wrapper(), ScdMesh(), ScdMeshF90(), MBMesquite::MeshDecorator::set_mesh(), MBMesquite::PatchSet::set_mesh(), moab::TempestRemapper::SetMesh(), MeshImplTest::skin_mesh_2D(), MeshImplTest::skin_mesh_3D(), MeshImplTest::skin_mesh_higher_order(), MeshImplTest::skin_mesh_mixed(), smooth_mixed_mesh(), tag_iterate(), test(), TerminationCriterionTest::test_abs_vtx_movement_culling(), TerminationCriterionTest::test_absolute_vertex_movement_edge_length(), test_both(), SphericalGeometryTest::test_cg_mesh_cond_sphere(), test_change_to_both(), test_change_to_set(), BoundedCylinderDomainTest::test_create_curve_from_mesh(), ArrayMeshTest::test_delete_tag(), test_delete_type_tag(), MeshUtilTest::test_edge_length_distribution_types(), MeshUtilTest::test_edge_length_distribution_unique(), test_existinterface(), SlaveBoundaryVerticesTest::test_fail_if_slaves_not_calculated(), SphericalDomainTest::test_fit_vertices(), PatchDataTest::test_fixed_by_geom_dim(), QualityAssessorTest::test_free_only(), test_get_set_variable_length_mesh(), test_getEntArrAdj_conn(), test_getEntArrAdj_down(), test_getEntArrAdj_invalid_size(), test_getEntArrAdj_none(), test_getEntArrAdj_up(), test_getEntArrAdj_vertex(), test_initial_inactive(), test_initial_notexist(), test_invalid_parallel_option(), MeshUtilTest::test_lambda_distribution_mixed(), SphericalGeometryTest::test_lapl_geo_sphere(), VertexCullingRegressionTest::test_laplacian_smoothing_with_cull(), test_mesh_value(), PatchDataTest::test_patch_data_mesh_calcualted_ho_nodes(), PatchDataTest::test_patch_data_mesh_flagged_ho_nodes(), PatchDataTest::test_patch_data_mesh_free_ho_nodes(), PatchDataTest::test_patch_data_mesh_slaved_ho_nodes(), PlanarGeometryTest::test_plane_quad_tangled(), PlanarGeometryTest::test_plane_tri_tangled(), PlanarGeometryTest::test_plane_tri_xz(), VtkTest::test_read_fixed_attrib(), VtkTest::test_read_quadratic(), VtkTest::test_read_rectilinear_grid(), VtkTest::test_read_simple_scalar_attrib(), VtkTest::test_read_structured_2d_points(), VtkTest::test_read_structured_3d_points(), VtkTest::test_read_structured_grid(), VtkTest::test_read_unstructured(), VtkTest::test_read_vector_attrib(), SlaveBoundaryVerticesTest::test_slaved_common(), SphericalGeometryTest::test_smart_lapl_sphere(), test_step_iter(), ArrayMeshTest::test_tag_data(), test_tag_iterate(), test_tags_retrieval(), HigherOrderTest::test_tri_open_domain(), HigherOrderTest::test_tri_slac(), VtkTest::test_write(), VtkTest::test_write_field_attrib(), VtkTest::test_write_quadratic(), moab::WriteCCMIO::transform_coords(), uwt(), write_mesh(), moab::WriteTemplate::write_nodes(), moab::WriteSLAC::write_nodes(), moab::WriteNCDF::write_nodes(), moab::WriteCCMIO::write_problem_description(), and write_vtk_mesh().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines