1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#include "iGeom.h"
#include "iMesh.h"
#include "iRel.h"

#include "TestUtil.hpp"

#include <cstdlib>

using namespace moab;
iGeom_Instance geom;
iMesh_Instance mesh;
iRel_Instance rel;

iBase_EntityHandle geom_ent;
iBase_EntityHandle mesh_ents[4];
iBase_EntitySetHandle mesh_set;

void test_both()
{
    int err;
    iRel_PairHandle pair;

    iRel_createPair( rel, geom, iRel_ENTITY, iRel_IGEOM_IFACE, iRel_ACTIVE, mesh, iRel_BOTH, iRel_IMESH_IFACE,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
                     iRel_ACTIVE, &pair, &err );CHECK_ERR( err );

    iRel_setEntSetRelation( rel, pair, geom_ent, mesh_set, &err );CHECK_ERR( err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.

    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,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
                                  &err );CHECK_ERR( err );

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

    free( related_ents );
}

void test_change_to_both()
{
    int err;
    iRel_PairHandle pair;

    iRel_createPair( rel, geom, iRel_ENTITY, iRel_IGEOM_IFACE, iRel_ACTIVE, mesh, iRel_SET, iRel_IMESH_IFACE,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
                     iRel_ACTIVE, &pair, &err );CHECK_ERR( err );

    iRel_setEntSetRelation( rel, pair, geom_ent, mesh_set, &err );CHECK_ERR( err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.

    iRel_changePairType( rel, pair, iRel_ENTITY, iRel_BOTH, &err );CHECK_ERR( err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.

    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,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
                                  &err );CHECK_ERR( err );

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

    free( related_ents );
}

void test_change_to_set()
{
    int err;
    iRel_PairHandle pair;

    iRel_createPair( rel, geom, iRel_ENTITY, iRel_IGEOM_IFACE, iRel_ACTIVE, mesh, iRel_BOTH, iRel_IMESH_IFACE,<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
                     iRel_ACTIVE, &pair, &err );CHECK_ERR( err );

    iRel_setEntSetRelation( rel, pair, geom_ent, mesh_set, &err );CHECK_ERR( err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.

    iRel_changePairType( rel, pair, iRel_ENTITY, iRel_SET, &err );CHECK_ERR( err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.

    for( int i = 0; i < 4; i++ )
    {
        iBase_EntityHandle related_ent;
        iRel_getEntEntRelation( rel, pair, mesh_ents[i], 1, &related_ent, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
        CHECK( err != iBase_SUCCESS );
    }
}

int main()
{
    int err;
    int num_fail = 0;

    iGeom_newGeom( 0, &geom, &err, 0 );
    iMesh_newMesh( 0, &mesh, &err, 0 );
    iRel_create( 0, &rel, &err, 0 );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.

    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 );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    iMesh_dtor( mesh, &err );
    iGeom_dtor( geom, &err );

    return num_fail;
}